Skip to content

Commit b2c9d43

Browse files
anadavbonzini
authored andcommitted
KVM: x86: Return UNHANDLABLE on unsupported SYSENTER
Now that KVM injects #UD on "unhandlable" error, it makes better sense to return such error on sysenter instead of directly injecting #UD to the guest. This allows to track more easily the unhandlable cases the emulator does not support. Signed-off-by: Nadav Amit <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent db324fe commit b2c9d43

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/x86/kvm/emulate.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,11 +2358,9 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt)
23582358
&& !vendor_intel(ctxt))
23592359
return emulate_ud(ctxt);
23602360

2361-
/* XXX sysenter/sysexit have not been tested in 64bit mode.
2362-
* Therefore, we inject an #UD.
2363-
*/
2361+
/* sysenter/sysexit have not been tested in 64bit mode. */
23642362
if (ctxt->mode == X86EMUL_MODE_PROT64)
2365-
return emulate_ud(ctxt);
2363+
return X86EMUL_UNHANDLEABLE;
23662364

23672365
setup_syscalls_segments(ctxt, &cs, &ss);
23682366

0 commit comments

Comments
 (0)