]> git.baikalelectronics.ru Git - kernel.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)
commit3bba72ad71a13563b51974e87cf97dadf15349b6
tree2c402b64e57a7e751e75cbc2cb2dac6256b7e73a
parentc46c3f21b225f726b99d9b70ec90f329da481fe3
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: 8435e95b106f ("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