Skip to content

Commit

Permalink
KVM: x86: Preserve injected TF across emulation
Browse files Browse the repository at this point in the history
Call directly into the vendor services for getting/setting rflags in
emulate_instruction to ensure injected TF survives the emulation.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Jan Kiszka authored and Avi Kivity committed Apr 25, 2010
1 parent c310bac commit 83bf000
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -3447,7 +3447,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);

vcpu->arch.emulate_ctxt.vcpu = vcpu;
vcpu->arch.emulate_ctxt.eflags = kvm_get_rflags(vcpu);
vcpu->arch.emulate_ctxt.eflags = kvm_x86_ops->get_rflags(vcpu);
vcpu->arch.emulate_ctxt.mode =
(!is_protmode(vcpu)) ? X86EMUL_MODE_REAL :
(vcpu->arch.emulate_ctxt.eflags & X86_EFLAGS_VM)
Expand Down Expand Up @@ -3526,7 +3526,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
return EMULATE_DO_MMIO;
}

kvm_set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags);
kvm_x86_ops->set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags);

if (vcpu->mmio_is_write) {
vcpu->mmio_needed = 0;
Expand Down

0 comments on commit 83bf000

Please sign in to comment.