From: Jaeyong Yoo <jaeyong.yoo@samsung.com>
To: xen-devel@lists.xen.org
Cc: Jaeyong Yoo <jaeyong.yoo@samsung.com>
Subject: [PATCH v4 2/9] xen/arm: Add more registers for saving and restoring vcpu registers
Date: Fri, 04 Oct 2013 13:43:58 +0900 [thread overview]
Message-ID: <1380861845-23268-3-git-send-email-jaeyong.yoo@samsung.com> (raw)
In-Reply-To: <1380861845-23268-1-git-send-email-jaeyong.yoo@samsung.com>
Add more registers for saving and restoring vcpu registers for live migration.
Those registers are selected from the registers stored when vcpu context switching.
Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
---
tools/include/xen-foreign/reference.size | 2 +-
xen/arch/arm/domain.c | 34 +++++++++++++++++++++++++++++++
xen/arch/arm/domctl.c | 35 ++++++++++++++++++++++++++++++++
xen/include/public/arch-arm.h | 35 ++++++++++++++++++++++++++++++++
4 files changed, 105 insertions(+), 1 deletion(-)
diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
index b3347b4..dd7b0f8 100644
--- a/tools/include/xen-foreign/reference.size
+++ b/tools/include/xen-foreign/reference.size
@@ -5,7 +5,7 @@ start_info | - - 1112 1168
trap_info | - - 8 16
cpu_user_regs | - - 68 200
vcpu_guest_core_regs | 304 304 - -
-vcpu_guest_context | 336 336 2800 5168
+vcpu_guest_context | 440 440 2800 5168
arch_vcpu_info | 0 0 24 16
vcpu_time_info | 32 32 32 32
vcpu_info | 48 48 64 64
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index cb0424d..d3bac4d 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -601,6 +601,40 @@ int arch_set_info_guest(
v->arch.ttbr1 = ctxt->ttbr1;
v->arch.ttbcr = ctxt->ttbcr;
+ v->arch.dacr = ctxt->dacr;
+ v->arch.ifar = ctxt->ifar;
+ v->arch.ifsr = ctxt->ifsr;
+ v->arch.dfar = ctxt->dfar;
+ v->arch.dfsr = ctxt->dfsr;
+
+#ifdef CONFIG_ARM_32
+ v->arch.mair0 = ctxt->mair0;
+ v->arch.mair1 = ctxt->mair1;
+#else
+ v->arch.mair = ctxt->mair;
+#endif
+
+ /* Control Registers */
+ v->arch.actlr = ctxt->actlr;
+ v->arch.cpacr = ctxt->cpacr;
+
+ v->arch.contextidr = ctxt->contextidr;
+ v->arch.tpidr_el0 = ctxt->tpidr_el0;
+ v->arch.tpidr_el1 = ctxt->tpidr_el1;
+ v->arch.tpidrro_el0 = ctxt->tpidrro_el0;
+
+ /* CP 15 */
+ v->arch.csselr = ctxt->csselr;
+
+ v->arch.afsr0 = ctxt->afsr0;
+ v->arch.afsr1 = ctxt->afsr1;
+ v->arch.vbar = ctxt->vbar;
+ v->arch.par = ctxt->par;
+ v->arch.teecr = ctxt->teecr;
+ v->arch.teehbr = ctxt->teehbr;
+ v->arch.joscr = ctxt->joscr;
+ v->arch.jmcr = ctxt->jmcr;
+
v->is_initialised = 1;
if ( ctxt->flags & VGCF_online )
diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index 86c07de..78fb322 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -115,6 +115,41 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
ctxt->ttbr1 = v->arch.ttbr1;
ctxt->ttbcr = v->arch.ttbcr;
+ ctxt->dacr = v->arch.dacr;
+ ctxt->ifar = v->arch.ifar;
+ ctxt->ifsr = v->arch.ifsr;
+ ctxt->dfar = v->arch.dfar;
+ ctxt->dfsr = v->arch.dfsr;
+
+#ifdef CONFIG_ARM_32
+ ctxt->mair0 = v->arch.mair0;
+ ctxt->mair1 = v->arch.mair1;
+#else
+ ctxt->mair = v->arch.mair;
+#endif
+
+ /* Control Registers */
+ ctxt->actlr = v->arch.actlr;
+ ctxt->sctlr = v->arch.sctlr;
+ ctxt->cpacr = v->arch.cpacr;
+
+ ctxt->contextidr = v->arch.contextidr;
+ ctxt->tpidr_el0 = v->arch.tpidr_el0;
+ ctxt->tpidr_el1 = v->arch.tpidr_el1;
+ ctxt->tpidrro_el0 = v->arch.tpidrro_el0;
+
+ /* CP 15 */
+ ctxt->csselr = v->arch.csselr;
+
+ ctxt->afsr0 = v->arch.afsr0;
+ ctxt->afsr1 = v->arch.afsr1;
+ ctxt->vbar = v->arch.vbar;
+ ctxt->par = v->arch.par;
+ ctxt->teecr = v->arch.teecr;
+ ctxt->teehbr = v->arch.teehbr;
+ ctxt->joscr = v->arch.joscr;
+ ctxt->jmcr = v->arch.jmcr;
+
if ( !test_bit(_VPF_down, &v->pause_flags) )
ctxt->flags |= VGCF_online;
}
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 5d359af..bf6dc9a 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -253,6 +253,41 @@ struct vcpu_guest_context {
uint32_t sctlr, ttbcr;
uint64_t ttbr0, ttbr1;
+ uint32_t ifar, dfar;
+ uint32_t ifsr, dfsr;
+ uint32_t dacr;
+ uint64_t par;
+
+#ifdef CONFIG_ARM_32
+ uint32_t mair0, mair1;
+ uint32_t tpidr_el0;
+ uint32_t tpidr_el1;
+ uint32_t tpidrro_el0;
+ uint32_t vbar;
+#else
+ uint64_t mair;
+ uint64_t tpidr_el0;
+ uint64_t tpidr_el1;
+ uint64_t tpidrro_el0;
+ uint64_t vbar;
+#endif
+
+ /* Control Registers */
+ uint32_t actlr;
+ uint32_t cpacr;
+
+ uint32_t afsr0, afsr1;
+
+ uint32_t contextidr;
+
+ uint32_t teecr, teehbr; /* ThumbEE, 32-bit guests only */
+
+#ifdef CONFIG_ARM_32
+ uint32_t joscr, jmcr;
+#endif
+
+ /* CP 15 */
+ uint32_t csselr;
};
typedef struct vcpu_guest_context vcpu_guest_context_t;
DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
--
1.8.1.2
next prev parent reply other threads:[~2013-10-04 4:43 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-04 4:43 [PATCH v4 0/9] xen/arm: live migration support in arndale board Jaeyong Yoo
2013-10-04 4:43 ` [PATCH v4 1/9] xen/arm: Implement hvm save and restore Jaeyong Yoo
2013-10-07 12:49 ` Julien Grall
2013-10-04 4:43 ` Jaeyong Yoo [this message]
2013-10-10 10:40 ` [PATCH v4 2/9] xen/arm: Add more registers for saving and restoring vcpu registers Ian Campbell
2013-10-11 8:30 ` Jaeyong Yoo
2013-10-11 8:43 ` Ian Campbell
2013-10-11 10:22 ` Tim Deegan
2013-10-11 10:25 ` Ian Campbell
2013-10-14 4:39 ` Jaeyong Yoo
2013-10-17 2:14 ` Jaeyong Yoo
2013-10-17 10:01 ` Ian Campbell
2013-10-04 4:43 ` [PATCH v4 3/9] xen/arm: Implement set_memory_map hypercall for arm Jaeyong Yoo
2013-10-10 10:56 ` Ian Campbell
2013-10-11 10:06 ` Eugene Fedotov
2013-10-11 10:09 ` Ian Campbell
2013-10-11 10:18 ` Tim Deegan
2013-10-31 8:56 ` Eugene Fedotov
2013-11-01 9:04 ` Ian Campbell
2013-11-01 9:14 ` Ian Campbell
2013-11-01 9:51 ` Eugene Fedotov
2013-11-01 9:48 ` Ian Campbell
2013-11-01 10:08 ` Eugene Fedotov
2013-11-01 10:30 ` Ian Campbell
2013-10-04 4:44 ` [PATCH v4 4/9] xen/arm: Implement get_maximum_gpfn " Jaeyong Yoo
2013-10-04 4:44 ` [PATCH v4 5/9] xen/arm: Implement modify_returncode Jaeyong Yoo
2013-10-04 4:44 ` [PATCH v4 6/9] xen/arm: Fixing clear_guest_offset macro Jaeyong Yoo
2013-10-07 12:53 ` Julien Grall
2013-10-10 12:00 ` Ian Campbell
2013-10-04 4:44 ` [PATCH v4 7/9] xen/arm: Implement virtual-linear page table for guest p2m mapping in live migration Jaeyong Yoo
2013-10-16 12:50 ` Ian Campbell
2013-10-17 8:58 ` Jaeyong Yoo
2013-10-17 10:06 ` Ian Campbell
2013-10-17 10:25 ` Jaeyong Yoo
2013-10-04 4:44 ` [PATCH v4 8/9] xen/arm: Implement hypercall for dirty page tracing Jaeyong Yoo
2013-10-07 13:02 ` Julien Grall
2013-10-07 15:51 ` Eugene Fedotov
2013-10-10 14:10 ` Julien Grall
2013-10-16 13:44 ` Ian Campbell
2013-10-17 10:12 ` Jaeyong Yoo
2013-10-17 10:30 ` Ian Campbell
2013-10-17 11:05 ` Jaeyong Yoo
2013-10-17 11:47 ` Ian Campbell
2013-10-18 4:17 ` Jaeyong Yoo
2013-10-18 9:11 ` Ian Campbell
2013-10-04 4:44 ` [PATCH v4 9/9] xen/arm: Implement toolstack for xl restore/save and migrate Jaeyong Yoo
2013-10-16 13:55 ` Ian Campbell
2013-10-17 10:14 ` Jaeyong Yoo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380861845-23268-3-git-send-email-jaeyong.yoo@samsung.com \
--to=jaeyong.yoo@samsung.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).