aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-06-10 10:02:16 -0400
committerAvi Kivity <avi@redhat.com>2010-08-01 03:46:35 -0400
commit2390218b6aa2eb3784b0a82fa811c19097dc793a (patch)
treefacf41c6ed5c3d2eafa939e7ab9209cc1594cddb /arch/x86/kvm/vmx.c
parenta83b29c6ad6d6497e569edbc29e556a384cebddd (diff)
KVM: Fix mov cr3 #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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f64d65dc38c6..345a35470511 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3185,8 +3185,8 @@ static int handle_cr(struct kvm_vcpu *vcpu)
3185 complete_insn_gp(vcpu, err); 3185 complete_insn_gp(vcpu, err);
3186 return 1; 3186 return 1;
3187 case 3: 3187 case 3:
3188 kvm_set_cr3(vcpu, val); 3188 err = kvm_set_cr3(vcpu, val);
3189 skip_emulated_instruction(vcpu); 3189 complete_insn_gp(vcpu, err);
3190 return 1; 3190 return 1;
3191 case 4: 3191 case 4:
3192 err = kvm_set_cr4(vcpu, val); 3192 err = kvm_set_cr4(vcpu, val);