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

[Xen-devel] [PATCH v3 09/15] xen: arm: Set EL1 register width in HCR_EL2 during context switch.



Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
v3: Remove ifdef and rely on is_pv32_domain == true on arm32
---
 xen/arch/arm/domain.c           |    5 +++++
 xen/include/asm-arm/processor.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 70fbc0d..a409d11 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -207,6 +207,11 @@ static void ctxt_switch_to(struct vcpu *n)
 
     isb();
 
+    if ( is_pv32_domain(n->domain) )
+        hcr &= ~HCR_RW;
+    else
+        hcr |= HCR_RW;
+
     WRITE_SYSREG(hcr, HCR_EL2);
     isb();
 
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 8b9b320..9e4995c 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -40,6 +40,7 @@
 #define PSR_GUEST_INIT  (PSR_ABT_MASK|PSR_FIQ_MASK|PSR_IRQ_MASK)
 
 /* HCR Hyp Configuration Register */
+#define HCR_RW          (1<<31) /* ARM64 only */
 #define HCR_TGE         (1<<27)
 #define HCR_TVM         (1<<26)
 #define HCR_TTLB        (1<<25)
-- 
1.7.2.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®.