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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user