Skip to content

Commit ffd1925

Browse files
YanfeiXubonzini
authored andcommitted
KVM: x86: Fix the intel_pt PMI handling wrongly considered from guest
When kernel handles the vm-exit caused by external interrupts and NMI, it always sets kvm_intr_type to tell if it's dealing an IRQ or NMI. For the PMI scenario, it could be IRQ or NMI. However, intel_pt PMIs are only generated for HARDWARE perf events, and HARDWARE events are always configured to generate NMIs. Use kvm_handling_nmi_from_guest() to precisely identify if the intel_pt PMI came from the guest; this avoids false positives if an intel_pt PMI/NMI arrives while the host is handling an unrelated IRQ VM-Exit. Fixes: db21575 ("KVM: x86: More precisely identify NMI from guest when handling PMI") Signed-off-by: Yanfei Xu <[email protected]> Message-Id: <[email protected]> Cc: [email protected] Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 366d4a1 commit ffd1925

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7853,7 +7853,7 @@ static unsigned int vmx_handle_intel_pt_intr(void)
78537853
struct kvm_vcpu *vcpu = kvm_get_running_vcpu();
78547854

78557855
/* '0' on failure so that the !PT case can use a RET0 static call. */
7856-
if (!kvm_arch_pmi_in_guest(vcpu))
7856+
if (!vcpu || !kvm_handling_nmi_from_guest(vcpu))
78577857
return 0;
78587858

78597859
kvm_make_request(KVM_REQ_PMI, vcpu);

0 commit comments

Comments
 (0)