diff mbox

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

Message ID 573C9CFD02000078000EC9FF@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich May 18, 2016, 2:49 p.m. UTC
This in particular prevents updating guest IP when handling the retry
needed to forward the memory access to qemu.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
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.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -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;
     }

Comments

Andrew Cooper May 18, 2016, 3:04 p.m. UTC | #1
On 18/05/16 15:49, Jan Beulich wrote:
> This in particular prevents updating guest IP when handling the retry
> needed to forward the memory access to qemu.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Oops.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Wei Liu May 18, 2016, 3:07 p.m. UTC | #2
On Wed, May 18, 2016 at 08:49:01AM -0600, Jan Beulich wrote:
> This in particular prevents updating guest IP when handling the retry
> needed to forward the memory access to qemu.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Release-acked-by: Wei Liu <wei.liu2@citrix.com>

> 
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -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;
>      }
> 
> 
>
diff mbox

Patch

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -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;
     }