OSDN Git Service

KVM: x86: emulate #UD while in guest mode
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 11 Jan 2018 15:55:24 +0000 (16:55 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 11 Jan 2018 15:55:24 +0000 (16:55 +0100)
commitbd89525a823ce6edddcedbe9aed79faa1b9cf544
tree0fa8919b8016ba59387b83ca38c0d39cf99bbb73
parentab271bd4dfd568060ffcf5a21b667c7c5df7ab99
KVM: x86: emulate #UD while in guest mode

This reverts commits ae1f57670703656cc9f293722c3b8b6782f8ab3f
and ac9b305caa0df6f5b75d294e4b86c1027648991e.

If the hardware doesn't support MOVBE, but L0 sets CPUID.01H:ECX.MOVBE
in L1's emulated CPUID information, then L1 is likely to pass that
CPUID bit through to L2. L2 will expect MOVBE to work, but if L1
doesn't intercept #UD, then any MOVBE instruction executed in L2 will
raise #UD, and the exception will be delivered in L2.

Commit ac9b305caa0df6f5b75d294e4b86c1027648991e is a better and more
complete version of ae1f57670703 ("KVM: nVMX: Do not emulate #UD while
in guest mode"); however, neither considers the above case.

Suggested-by: Jim Mattson <jmattson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c