KVM: x86 emulator: Don't write-back cpu-state on X86EMUL_INTERCEPTED
This patch prevents the changed CPU state to be written back when the emulator detected that the instruction was intercepted by the guest. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
@ -4516,6 +4516,9 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu,
|
||||
restart:
|
||||
r = x86_emulate_insn(&vcpu->arch.emulate_ctxt);
|
||||
|
||||
if (r == EMULATION_INTERCEPTED)
|
||||
return EMULATE_DONE;
|
||||
|
||||
if (r == EMULATION_FAILED) {
|
||||
if (reexecute_instruction(vcpu, cr2))
|
||||
return EMULATE_DONE;
|
||||
|
Reference in New Issue
Block a user