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

[Xen-devel] [PATCH 38/45] xen: arm: select_user_reg support for 64-bit hypervisor



Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 xen/arch/arm/traps.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d9abf83..7ea524c 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -77,6 +77,7 @@ register_t *select_user_reg(struct cpu_user_regs *regs, int 
reg)
 {
     BUG_ON( !guest_mode(regs) );
 
+#ifdef CONFIG_ARM_32
     /*
      * We rely heavily on the layout of cpu_user_regs to avoid having
      * to handle all of the registers individually. Use BUILD_BUG_ON to
@@ -129,6 +130,15 @@ register_t *select_user_reg(struct cpu_user_regs *regs, 
int reg)
         BUG();
     }
 #undef REGOFFS
+#else
+    /* In 64 bit the syndrome register contains the AArch64 register
+     * number even if the trap was from AArch32 mode. Except that
+     * AArch32 R15 (PC) is encoded as 0b11111.
+     */
+    if ( reg == 0x1f /* && is aarch32 guest */)
+        return &regs->pc;
+    return &regs->x0 + reg;
+#endif
 }
 
 static const char *decode_fsc(uint32_t fsc, int *level)
-- 
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®.