Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83bf0002 authored by Jan Kiszka's avatar Jan Kiszka Committed by Avi Kivity
Browse files

KVM: x86: Preserve injected TF across emulation



Call directly into the vendor services for getting/setting rflags in
emulate_instruction to ensure injected TF survives the emulation.

Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent c310bac5
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3447,7 +3447,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
		kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
		kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);


		vcpu->arch.emulate_ctxt.vcpu = vcpu;
		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 =
		vcpu->arch.emulate_ctxt.mode =
			(!is_protmode(vcpu)) ? X86EMUL_MODE_REAL :
			(!is_protmode(vcpu)) ? X86EMUL_MODE_REAL :
			(vcpu->arch.emulate_ctxt.eflags & X86_EFLAGS_VM)
			(vcpu->arch.emulate_ctxt.eflags & X86_EFLAGS_VM)
@@ -3526,7 +3526,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
		return EMULATE_DO_MMIO;
		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) {
	if (vcpu->mmio_is_write) {
		vcpu->mmio_needed = 0;
		vcpu->mmio_needed = 0;