]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: x86: fix #UD address of failed Hyper-V hypercalls
authorRadim Krčmář <rkrcmar@redhat.com>
Thu, 24 May 2018 15:50:56 +0000 (17:50 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 25 May 2018 19:33:31 +0000 (21:33 +0200)
commit696ca779a928d0e93d61c38ffc3a4d8914a9b9a0
tree2c402b64e57a7e751e75cbc2cb2dac6256b7e73a
parent1eaafe91a0df4157521b6417b3dd8430bf5f52f0
KVM: x86: fix #UD address of failed Hyper-V hypercalls

If the hypercall was called from userspace or real mode, KVM injects #UD
and then advances RIP, so it looks like #UD was caused by the following
instruction.  This probably won't cause more than confusion, but could
give an unexpected access to guest OS' instruction emulator.

Also, refactor the code to count hv hypercalls that were handled by the
virt userspace.

Fixes: 6356ee0c9602 ("x86: Delay skip of emulated hypercall instruction")
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/hyperv.c
arch/x86/kvm/x86.c