mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
UPSTREAM: 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. Bug: 254441685 Fixes:db215756ae("KVM: x86: More precisely identify NMI from guest when handling PMI") Signed-off-by: Yanfei Xu <yanfei.xu@intel.com> Message-Id: <20220523140821.1345605-1-yanfei.xu@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commitffd1925a59) Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: If52325e8b61118e79a70ab4770de95b646ef62f8
This commit is contained in:
committed by
Treehugger Robot
parent
9ac15d293a
commit
c5e5da76bd
@@ -7829,7 +7829,7 @@ static unsigned int vmx_handle_intel_pt_intr(void)
|
||||
struct kvm_vcpu *vcpu = kvm_get_running_vcpu();
|
||||
|
||||
/* '0' on failure so that the !PT case can use a RET0 static call. */
|
||||
if (!kvm_arch_pmi_in_guest(vcpu))
|
||||
if (!vcpu || !kvm_handling_nmi_from_guest(vcpu))
|
||||
return 0;
|
||||
|
||||
kvm_make_request(KVM_REQ_PMI, vcpu);
|
||||
|
||||
Reference in New Issue
Block a user