diff options
author | Avi Kivity <avi@redhat.com> | 2010-06-10 18:02:15 +0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-01 11:46:34 +0400 |
commit | a83b29c6ad6d6497e569edbc29e556a384cebddd (patch) | |
tree | 444c440ec0e1f8e0d73d89cfc66fd185b03223c9 /arch/x86/kvm/vmx.c | |
parent | 49a9b07edcf4aff159c1f3d3a27e58cf38bc27cd (diff) | |
download | linux-a83b29c6ad6d6497e569edbc29e556a384cebddd.tar.xz |
KVM: Fix mov cr4 #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>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 1baf4b2d98ee..f64d65dc38c6 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3189,8 +3189,8 @@ static int handle_cr(struct kvm_vcpu *vcpu) skip_emulated_instruction(vcpu); return 1; case 4: - kvm_set_cr4(vcpu, val); - skip_emulated_instruction(vcpu); + err = kvm_set_cr4(vcpu, val); + complete_insn_gp(vcpu, err); return 1; case 8: { u8 cr8_prev = kvm_get_cr8(vcpu); |