* [PATCH v2] x86emul: simplify prefix handling for VMFUNC
@ 2017-01-18 14:48 Jan Beulich
2017-01-18 14:48 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2017-01-18 14:48 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper
[-- Attachment #1: Type: text/plain, Size: 901 bytes --]
LOCK prefixes get dealt with elsewhere, and 66, F2, and F3 can all be
checked for in one go by looking at vex.pfx.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Retain explicit generation of #UD.
---
Note: The SDM doesn't indicate 66, F2, and F3 to be invalid; Intel
meanwhile half-way indicated the SDM to be wrong here, and Andrew
(thanks!) has verified this in practice.
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4679,8 +4679,7 @@ x86_emulate(
#endif
case 0xd4: /* vmfunc */
- generate_exception_if(lock_prefix | rep_prefix() | (vex.pfx == vex_66),
- EXC_UD);
+ generate_exception_if(vex.pfx, EXC_UD);
fail_if(!ops->vmfunc);
if ( (rc = ops->vmfunc(ctxt)) != X86EMUL_OKAY )
goto done;
[-- Attachment #2: x86emul-VMFUNC-prefixes.patch --]
[-- Type: text/plain, Size: 943 bytes --]
x86emul: simplify prefix handling for VMFUNC
LOCK prefixes get dealt with elsewhere, and 66, F2, and F3 can all be
checked for in one go by looking at vex.pfx.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Retain explicit generation of #UD.
---
Note: The SDM doesn't indicate 66, F2, and F3 to be invalid; Intel
meanwhile half-way indicated the SDM to be wrong here, and Andrew
(thanks!) has verified this in practice.
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4679,8 +4679,7 @@ x86_emulate(
#endif
case 0xd4: /* vmfunc */
- generate_exception_if(lock_prefix | rep_prefix() | (vex.pfx == vex_66),
- EXC_UD);
+ generate_exception_if(vex.pfx, EXC_UD);
fail_if(!ops->vmfunc);
if ( (rc = ops->vmfunc(ctxt)) != X86EMUL_OKAY )
goto done;
[-- Attachment #3: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-18 14:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-18 14:48 [PATCH v2] x86emul: simplify prefix handling for VMFUNC Jan Beulich
2017-01-18 14:48 ` Andrew Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).