KVM: Fix mov cr0 #GP at wrong instruction
authorAvi Kivity <avi@redhat.com>
Thu, 10 Jun 2010 14:02:14 +0000 (17:02 +0300)
committerAvi Kivity <avi@redhat.com>
Sun, 1 Aug 2010 07:46:32 +0000 (10:46 +0300)
commit49a9b07edcf4aff159c1f3d3a27e58cf38bc27cd
tree750ff11b09e7baa3f4c811ce7c85bf7546b051ae
parent2acf923e38fb6a4ce0c57115decbb38d334902ac
KVM: Fix mov cr0 #GP at wrong instruction

On Intel, we call skip_emulated_instruction() even if we injected a #GP,
resulting in the #GP pointing at the wrong address.

Fix by injecting the exception and skipping the instruction at the same place,
so we can do just one or the other.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c