All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: arm: Fixing ttbcr (TCR_EL1 for AArch64) size.
@ 2013-12-03 12:03 Pranavkumar Sawargaonkar
  2013-12-03 13:47 ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Pranavkumar Sawargaonkar @ 2013-12-03 12:03 UTC (permalink / raw)
  To: xen-devel
  Cc: ian.campbell, Anup Patel, patches, patches, julien.grall,
	stefano.stabellini, Pranavkumar Sawargaonkar

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@linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
---
 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-12-04 14:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-03 12:03 [PATCH] xen: arm: Fixing ttbcr (TCR_EL1 for AArch64) size Pranavkumar Sawargaonkar
2013-12-03 13:47 ` Ian Campbell
2013-12-03 15:40   ` Ian Campbell
2013-12-03 16:09     ` Julien Grall
2013-12-03 16:20       ` Pranavkumar Sawargaonkar
2013-12-03 17:27         ` Ian Campbell
2013-12-03 17:44           ` Pranavkumar Sawargaonkar
2013-12-04 14:52             ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.