All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] xen: arm: handle thumb mode guest in continuations
@ 2015-03-25 15:34 Ian Campbell
  2015-03-25 23:33 ` Julien Grall
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2015-03-25 15:34 UTC (permalink / raw)
  To: xen-devel; +Cc: julien.grall, tim, Ian Campbell, stefano.stabellini

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@citrix.com>
---
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

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

end of thread, other threads:[~2015-03-26 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-25 15:34 [PATCH 3/3] xen: arm: handle thumb mode guest in continuations Ian Campbell
2015-03-25 23:33 ` Julien Grall
2015-03-26 10:06   ` 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.