From: "Jan Beulich" Subject: [PATCH] x86emul: suppress writeback upon unsuccessful MMX/SSE/AVX insn emulation Date: Wed, 18 May 2016 08:49:01 -0600 Message-ID: <573C9CFD02000078000EC9FF@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part4E7828CD.1__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b32mZ-0001PN-Ih for xen-devel@lists.xenproject.org; Wed, 18 May 2016 14:49:07 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel Cc: Andrew Cooper , Wei Liu , wogiz@openmailbox.org List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part4E7828CD.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This in particular prevents updating guest IP when handling the retry needed to forward the memory access to qemu. Signed-off-by: Jan Beulich --- 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 =3D=3D OP_MEM) ) rc =3D ops->write(ea.mem.seg, ea.mem.off, mmvalp, ea.bytes, ctxt); + if ( rc ) + goto done; dst.type =3D OP_NONE; break; } @@ -4430,6 +4432,8 @@ x86_emulate( if ( !rc && (b !=3D 0x6f) && (ea.type =3D=3D OP_MEM) ) rc =3D ops->write(ea.mem.seg, ea.mem.off, mmvalp, ea.bytes, ctxt); + if ( rc ) + goto done; dst.type =3D OP_NONE; break; } --=__Part4E7828CD.1__= Content-Type: text/plain; name="x86emul-SSE-error-handling.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86emul-SSE-error-handling.patch" x86emul: suppress writeback upon unsuccessful MMX/SSE/AVX insn emulation=0A= =0AThis in particular prevents updating guest IP when handling the = retry=0Aneeded to forward the memory access to qemu.=0A=0ASigned-off-by: = Jan Beulich =0A=0A--- a/xen/arch/x86/x86_emulate/x86_emu= late.c=0A+++ b/xen/arch/x86/x86_emulate/x86_emulate.c=0A@@ -4178,6 +4178,8 = @@ x86_emulate(=0A if ( !rc && (b & 1) && (ea.type =3D=3D OP_MEM) = )=0A rc =3D ops->write(ea.mem.seg, ea.mem.off, mmvalp,=0A = ea.bytes, ctxt);=0A+ if ( rc )=0A+ = goto done;=0A dst.type =3D OP_NONE;=0A break;=0A = }=0A@@ -4430,6 +4432,8 @@ x86_emulate(=0A if ( !rc && (b !=3D = 0x6f) && (ea.type =3D=3D OP_MEM) )=0A rc =3D ops->write(ea.mem.= seg, ea.mem.off, mmvalp,=0A ea.bytes, = ctxt);=0A+ if ( rc )=0A+ goto done;=0A dst.type = =3D OP_NONE;=0A break;=0A }=0A --=__Part4E7828CD.1__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --=__Part4E7828CD.1__=--