Skip to contentSkip to conversation

x86emul: suppress writeback upon unsuccessful MMX/SSE/AVX insn emulation

PATCH In review Jan Beulich 3 participants 3 messages May 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86emul: suppress writeback upon unsuccessful MMX/SSE/AVX insn emulation

This in particular prevents updating guest IP when handling the retry needed to forward the memory access to qemu.

xen/arch/x86/x86_emulate/x86_emulate.c +4 -0
@@ -4178,6 +4178,8 @@ x86_emulate(
         if ( !rc && (b & 1) && (ea.type == OP_MEM) )
             rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp,
                             ea.bytes, ctxt);
+        if ( rc )
+            goto done;
         dst.type = OP_NONE;
         break;
     }
@@ -4430,6 +4432,8 @@ x86_emulate(
         if ( !rc && (b != 0x6f) && (ea.type == OP_MEM) )
             rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp,
                             ea.bytes, ctxt);
+        if ( rc )
+            goto done;
         dst.type = OP_NONE;
         break;
     }

x86emul: suppress writeback upon unsuccessful MMX/SSE/AVX insn emulation

This in particular prevents updating guest IP when handling the retry needed to forward the memory access to qemu.

xen/arch/x86/x86_emulate/x86_emulate.c +4 -0
@@ -4178,6 +4178,8 @@ x86_emulate(
         if ( !rc && (b & 1) && (ea.type == OP_MEM) )
             rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp,
                             ea.bytes, ctxt);
+        if ( rc )
+            goto done;
         dst.type = OP_NONE;
         break;
     }
@@ -4430,6 +4432,8 @@ x86_emulate(
         if ( !rc && (b != 0x6f) && (ea.type == OP_MEM) )
             rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp,
                             ea.bytes, ctxt);
+        if ( rc )
+            goto done;
         dst.type = OP_NONE;
         break;
     }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
In reply to Jan Beulich
Quoted 4 lines · Jan Beulich

This in particular prevents updating guest IP when handling the retry needed to forward the memory access to qemu.

Quoted 16 lines
xen/arch/x86/x86_emulate/x86_emulate.c +2 -0
@@ -4178,6 +4178,8 @@ x86_emulate(
         if ( !rc && (b & 1) && (ea.type == OP_MEM) )
             rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp,
                             ea.bytes, ctxt);
+        if ( rc )
+            goto done;
         dst.type = OP_NONE;
         break;
     }

xen/arch/x86/x86_emulate/x86_emulate.c x86_emulate( · line 4439

Quoted 8 lines
xen/arch/x86/x86_emulate/x86_emulate.c +2 -0
@@ -4430,6 +4432,8 @@ x86_emulate(
         if ( !rc && (b != 0x6f) && (ea.type == OP_MEM) )
             rc = ops->write(ea.mem.seg, ea.mem.off, mmvalp,
                             ea.bytes, ctxt);
+        if ( rc )
+            goto done;
         dst.type = OP_NONE;
         break;
     }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel