[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v4 2/9] xen/arm: Add more registers for saving and restoring vcpu registers



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@xxxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.