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

[Xen-devel] [PATCH 3/3] xen: arm: handle thumb mode guest in continuations



PC only needs adjusting by 2, otherwise we rerun the instruction prior
to the hvc as well.

hvc is unpredictable if used within a Thumb IT (conditional execution)
block, so we don't need to worry about rewinding any of that state.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
Should be backported
---
 xen/arch/arm/domain.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 10f13e4..2d2197e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -387,10 +387,11 @@ unsigned long hypercall_create_continuation(
         else
 #endif
         {
+            int is_thumb = (regs->cpsr & PSR_THUMB);
             regs->r12 = op;
 
             /* Ensure the hypercall trap instruction is re-executed. */
-            regs->pc -= 4;  /* re-execute 'hvc #XEN_HYPERCALL_TAG' */
+            regs->pc -= is_thumb?2:4; /* re-execute 'hvc #XEN_HYPERCALL_TAG' */
 
             for ( i = 0; *p != '\0'; i++ )
             {
-- 
1.7.10.4


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