From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] x86emul: minor cleanup Date: Thu, 08 Jun 2017 09:49:18 -0600 Message-ID: <59398E1E0200007800160F7E@prv-mh.provo.novell.com> References: <59398E1E0200007800160F7E@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part97AFFAEE.1__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIzgZ-00067a-On for xen-devel@lists.xenproject.org; Thu, 08 Jun 2017 15:49:23 +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 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. --=__Part97AFFAEE.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Drop a redundant input constraint, correct a comment, and (re)move fix.insn_bytes adjustments (these aren't needed for custom stub invocations when the instruction placed in the stub can't raise #XF) plus a corresponding check_xmm_exn() invocation. Signed-off-by: Jan Beulich --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -5681,8 +5681,7 @@ x86_emulate( [eflags] "+g" (_regs.eflags), [tmp] "=3D&r" (dummy), "+m" (*mmvalp), "+m" (fic.exn_raised) - : [func] "rm" (stub.func), "a" (mmvalp), - [mask] "i" (EFLAGS_MASK)); + : "a" (mmvalp), [mask] "i" (EFLAGS_MASK)); =20 put_stub(stub); check_xmm_exn(&fic); @@ -6086,7 +6085,7 @@ x86_emulate( case X86EMUL_OPC_F3(0x0f, 0x6f): /* movdqu xmm/m128,xmm */ case X86EMUL_OPC_VEX_F3(0x0f, 0x6f): /* vmovdqu {x,y}mm/mem,{x,y}mm = */ case X86EMUL_OPC_66(0x0f, 0x7f): /* movdqa xmm,xmm/m128 */ - case X86EMUL_OPC_VEX_66(0x0f, 0x7f): /* vmovdqa {x,y}mm,{x,y}mm/m128 = */ + case X86EMUL_OPC_VEX_66(0x0f, 0x7f): /* vmovdqa {x,y}mm,{x,y}mm/mem = */ case X86EMUL_OPC_F3(0x0f, 0x7f): /* movdqu xmm,xmm/m128 */ case X86EMUL_OPC_VEX_F3(0x0f, 0x7f): /* vmovdqu {x,y}mm,{x,y}mm/mem = */ movdqa: @@ -7022,7 +7021,6 @@ x86_emulate( if ( !mode_64bit() ) vex.w =3D 0; opc[1] =3D modrm & 0xc7; - fic.insn_bytes =3D PFX_BYTES + 2; opc[2] =3D 0xc3; =20 copy_REX_VEX(opc, rex_prefix, vex); @@ -7035,6 +7033,7 @@ x86_emulate( opc =3D init_prefixes(stub); opc[0] =3D b; opc[1] =3D modrm; + fic.insn_bytes =3D PFX_BYTES + 2; /* Restore high bit of XMM destination. */ if ( sfence ) { @@ -7469,20 +7468,16 @@ x86_emulate( vex.w =3D 0; opc[1] =3D modrm & 0x38; opc[2] =3D imm1; - fic.insn_bytes =3D PFX_BYTES + 3; opc[3] =3D 0xc3; if ( vex.opcx =3D=3D vex_none ) { /* Cover for extra prefix byte. */ --opc; - ++fic.insn_bytes; } =20 copy_REX_VEX(opc, rex_prefix, vex); invoke_stub("", "", "=3Dm" (dst.val) : "a" (&dst.val)); - put_stub(stub); - check_xmm_exn(&fic); =20 ASSERT(!state->simd_size); dst.bytes =3D dst.type =3D=3D OP_REG || b =3D=3D 0x17 ? 4 : 1 << = (b & 3); --=__Part97AFFAEE.1__= Content-Type: text/plain; name="x86emul-cleanup.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86emul-cleanup.patch" x86emul: minor cleanup=0A=0ADrop a redundant input constraint, correct a = comment, and (re)move=0Afix.insn_bytes adjustments (these aren't needed = for custom stub=0Ainvocations when the instruction placed in the stub = can't raise #XF)=0Aplus a corresponding check_xmm_exn() invocation.=0A=0ASi= gned-off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/x86_em= ulate/x86_emulate.c=0A+++ b/xen/arch/x86/x86_emulate/x86_emulate.c=0A@@ = -5681,8 +5681,7 @@ x86_emulate(=0A [eflags] "+g" = (_regs.eflags),=0A [tmp] "=3D&r" (dummy), "+m" = (*mmvalp),=0A "+m" (fic.exn_raised)=0A- = : [func] "rm" (stub.func), "a" (mmvalp),=0A- = [mask] "i" (EFLAGS_MASK));=0A+ : "a" (mmvalp), [mask] = "i" (EFLAGS_MASK));=0A =0A put_stub(stub);=0A check_xmm_exn= (&fic);=0A@@ -6086,7 +6085,7 @@ x86_emulate(=0A case X86EMUL_OPC_F3(0x0= f, 0x6f): /* movdqu xmm/m128,xmm */=0A case X86EMUL_OPC_VEX_F3(0x0f= , 0x6f): /* vmovdqu {x,y}mm/mem,{x,y}mm */=0A case X86EMUL_OPC_66(0x0f,= 0x7f): /* movdqa xmm,xmm/m128 */=0A- case X86EMUL_OPC_VEX_66(0x0f, = 0x7f): /* vmovdqa {x,y}mm,{x,y}mm/m128 */=0A+ case X86EMUL_OPC_VEX_66(0x= 0f, 0x7f): /* vmovdqa {x,y}mm,{x,y}mm/mem */=0A case X86EMUL_OPC_F3(0x0= f, 0x7f): /* movdqu xmm,xmm/m128 */=0A case X86EMUL_OPC_VEX_F3(0x0f= , 0x7f): /* vmovdqu {x,y}mm,{x,y}mm/mem */=0A movdqa:=0A@@ -7022,7 = +7021,6 @@ x86_emulate(=0A if ( !mode_64bit() )=0A = vex.w =3D 0;=0A opc[1] =3D modrm & 0xc7;=0A- fic.insn_bytes = =3D PFX_BYTES + 2;=0A opc[2] =3D 0xc3;=0A =0A copy_REX_VEX(= opc, rex_prefix, vex);=0A@@ -7035,6 +7033,7 @@ x86_emulate(=0A opc = =3D init_prefixes(stub);=0A opc[0] =3D b;=0A opc[1] =3D = modrm;=0A+ fic.insn_bytes =3D PFX_BYTES + 2;=0A /* Restore = high bit of XMM destination. */=0A if ( sfence )=0A {=0A@@ = -7469,20 +7468,16 @@ x86_emulate(=0A vex.w =3D 0;=0A = opc[1] =3D modrm & 0x38;=0A opc[2] =3D imm1;=0A- fic.insn_by= tes =3D PFX_BYTES + 3;=0A opc[3] =3D 0xc3;=0A if ( = vex.opcx =3D=3D vex_none )=0A {=0A /* Cover for extra = prefix byte. */=0A --opc;=0A- ++fic.insn_bytes;=0A = }=0A =0A copy_REX_VEX(opc, rex_prefix, vex);=0A = invoke_stub("", "", "=3Dm" (dst.val) : "a" (&dst.val));=0A-=0A = put_stub(stub);=0A- check_xmm_exn(&fic);=0A =0A ASSERT(!stat= e->simd_size);=0A dst.bytes =3D dst.type =3D=3D OP_REG || b =3D=3D = 0x17 ? 4 : 1 << (b & 3);=0A --=__Part97AFFAEE.1__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --=__Part97AFFAEE.1__=--