From: "Jan Beulich" Subject: [PATCH v2 14/16] x86emul: sort opcode 0f01 special case switch() statement Date: Wed, 28 Sep 2016 02:18:02 -0600 Message-ID: <57EB98DA020000780011320B@prv-mh.provo.novell.com> References: <57EB94940200007800113179@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part0234B3AA.1__=" Return-path: Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpA5d-0001kr-N6 for xen-devel@lists.xenproject.org; Wed, 28 Sep 2016 08:19:41 +0000 In-Reply-To: <57EB94940200007800113179@prv-mh.provo.novell.com> 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. --=__Part0234B3AA.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sort the special case opcode 0f01 entries numerically, insert blank lines between each of the cases, and properly place opening braces. No functional change. Signed-off-by: Jan Beulich --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -4195,6 +4195,14 @@ x86_emulate( } #endif =20 + case 0xd4: /* vmfunc */ + generate_exception_if(lock_prefix | rep_prefix() | (vex.pfx = =3D=3D vex_66), + EXC_UD, -1); + fail_if(!ops->vmfunc); + if ( (rc =3D ops->vmfunc(ctxt) !=3D X86EMUL_OKAY) ) + goto done; + goto no_writeback; + case 0xdf: /* invlpga */ generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1); generate_exception_if(!mode_ring0(), EXC_GP, 0); @@ -4203,7 +4211,9 @@ x86_emulate( ctxt)) ) goto done; goto no_writeback; - case 0xf9: /* rdtscp */ { + + case 0xf9: /* rdtscp */ + { uint64_t tsc_aux; fail_if(ops->read_msr =3D=3D NULL); if ( (rc =3D ops->read_msr(MSR_TSC_AUX, &tsc_aux, ctxt)) !=3D = 0 ) @@ -4211,14 +4221,9 @@ x86_emulate( _regs.ecx =3D (uint32_t)tsc_aux; goto rdtsc; } - case 0xd4: /* vmfunc */ - generate_exception_if(lock_prefix | rep_prefix() | (vex.pfx = =3D=3D vex_66), - EXC_UD, -1); - fail_if(ops->vmfunc =3D=3D NULL); - if ( (rc =3D ops->vmfunc(ctxt) !=3D X86EMUL_OKAY) ) - goto done; - goto no_writeback; - case 0xfc: /* clzero */ { + + case 0xfc: /* clzero */ + { unsigned int eax =3D 1, ebx =3D 0, dummy =3D 0; unsigned long zero =3D 0; =20 --=__Part0234B3AA.1__= Content-Type: text/plain; name="x86emul-sort-0f01.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86emul-sort-0f01.patch" x86emul: sort opcode 0f01 special case switch() statement=0A=0ASort the = special case opcode 0f01 entries numerically, insert blank=0Alines between = each of the cases, and properly place opening braces.=0A=0ANo functional = change.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = a/xen/arch/x86/x86_emulate/x86_emulate.c=0A+++ b/xen/arch/x86/x86_emulate/x= 86_emulate.c=0A@@ -4195,6 +4195,14 @@ x86_emulate(=0A }=0A = #endif=0A =0A+ case 0xd4: /* vmfunc */=0A+ generate_excep= tion_if(lock_prefix | rep_prefix() | (vex.pfx =3D=3D vex_66),=0A+ = EXC_UD, -1);=0A+ fail_if(!ops->vmfunc);= =0A+ if ( (rc =3D ops->vmfunc(ctxt) !=3D X86EMUL_OKAY) )=0A+ = goto done;=0A+ goto no_writeback;=0A+=0A = case 0xdf: /* invlpga */=0A generate_exception_if(!in_protmode(= ctxt, ops), EXC_UD, -1);=0A generate_exception_if(!mode_ring0()= , EXC_GP, 0);=0A@@ -4203,7 +4211,9 @@ x86_emulate(=0A = ctxt)) )=0A goto done;=0A goto = no_writeback;=0A- case 0xf9: /* rdtscp */ {=0A+=0A+ case = 0xf9: /* rdtscp */=0A+ {=0A uint64_t tsc_aux;=0A = fail_if(ops->read_msr =3D=3D NULL);=0A if ( (rc =3D = ops->read_msr(MSR_TSC_AUX, &tsc_aux, ctxt)) !=3D 0 )=0A@@ -4211,14 +4221,9 = @@ x86_emulate(=0A _regs.ecx =3D (uint32_t)tsc_aux;=0A = goto rdtsc;=0A }=0A- case 0xd4: /* vmfunc */=0A- = generate_exception_if(lock_prefix | rep_prefix() | (vex.pfx =3D=3D = vex_66),=0A- EXC_UD, -1);=0A- = fail_if(ops->vmfunc =3D=3D NULL);=0A- if ( (rc =3D ops->vmfunc(c= txt) !=3D X86EMUL_OKAY) )=0A- goto done;=0A- = goto no_writeback;=0A- case 0xfc: /* clzero */ {=0A+=0A+ case = 0xfc: /* clzero */=0A+ {=0A unsigned int eax =3D 1, ebx = =3D 0, dummy =3D 0;=0A unsigned long zero =3D 0;=0A =0A --=__Part0234B3AA.1__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --=__Part0234B3AA.1__=--