]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Fix the intel_pt PMI handling wrongly considered from guest
authorYanfei Xu <yanfei.xu@intel.com>
Mon, 23 May 2022 14:08:21 +0000 (22:08 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 25 May 2022 09:18:27 +0000 (05:18 -0400)
commit3445089e2883e08315c2728846adfba9b4f2e6c3
treebd58ed1a829eec226ffcb569e943fe448e453086
parent6cf9545eb966f452dcec3b68d53ddf0f7d3cb503
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: 2220920c0105 ("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>
arch/x86/kvm/vmx/vmx.c