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

[Xen-devel] [PATCH] xen: arm: Fixing ttbcr (TCR_EL1 for AArch64) size.



This patch fixes size of ttbcr register (TCR_EL1 in case of AArch64)
and it's programming considering size in case of context switch.

Currently ttbcr is defined as 32b register but for AArch64 TCR_EL1
size is 64b.

Signed-off-by: Anup Patel <anup.patel@xxxxxxxxxx>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@xxxxxxxxxx>
---
 xen/arch/arm/domain.c        |    8 ++++++++
 xen/include/asm-arm/domain.h |    4 ++++
 2 files changed, 12 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 52d2403..74ab046 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -89,7 +89,11 @@ static void ctxt_switch_from(struct vcpu *p)
 
     /* MMU */
     p->arch.vbar = READ_SYSREG(VBAR_EL1);
+#ifdef CONFIG_ARM_32
     p->arch.ttbcr = READ_SYSREG(TCR_EL1);
+#else
+    p->arch.ttbcr = READ_SYSREG64(TCR_EL1);
+#endif
     p->arch.ttbr0 = READ_SYSREG64(TTBR0_EL1);
     p->arch.ttbr1 = READ_SYSREG64(TTBR1_EL1);
     if ( is_pv32_domain(p->domain) )
@@ -168,7 +172,11 @@ static void ctxt_switch_to(struct vcpu *n)
 
     /* MMU */
     WRITE_SYSREG(n->arch.vbar, VBAR_EL1);
+#if defined(CONFIG_ARM_32)
     WRITE_SYSREG(n->arch.ttbcr, TCR_EL1);
+#else
+    WRITE_SYSREG64(n->arch.ttbcr, TCR_EL1);
+#endif
     WRITE_SYSREG64(n->arch.ttbr0, TTBR0_EL1);
     WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
     if ( is_pv32_domain(n->domain) )
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index d5cae2e..2aa4443 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -165,7 +165,11 @@ struct arch_vcpu
 
     /* MMU */
     register_t vbar;
+#ifdef CONFIG_ARM_32
     uint32_t ttbcr;
+#else
+    uint64_t ttbcr;
+#endif
     uint64_t ttbr0, ttbr1;
 
     uint32_t dacr; /* 32-bit guests only */
-- 
1.7.9.5


_______________________________________________
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®.