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

[Xen-devel] [PATCH RFC v2 3/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>
Singed-off-by: Alexey Sokolov <sokolov.a@xxxxxxxxxxx>
---
 xen/arch/arm/domain.c         | 34 ++++++++++++++++++++++++++++++++++
 xen/arch/arm/domctl.c         | 35 +++++++++++++++++++++++++++++++++++
 xen/include/public/arch-arm.h | 35 +++++++++++++++++++++++++++++++++++
 3 files changed, 104 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 4c434a1..73dd0de 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -572,6 +572,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 0203501..a0719b0 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -107,6 +107,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 8aa62d3..352c08d 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -191,6 +191,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®.