KVM: x86: Fix the intel_pt PMI handling wrongly considered from guest
PATCH v2 1/1 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 set a type of kvm_intr_type to handling_intr_from_guest to tell if it's dealing an IRQ or NMI. For the PMI scenario, it could be IRQ or NMI.
However the intel_pt PMI certainly is a NMI PMI, hence using kvm_handling_nmi_from_guest() to distinguish if the intel_pt PMI comes from guest is more appropriate. This modification can avoid the host wrongly considered the intel_pt PMI comes from a guest once the host intel_pt PMI breaks the handling of vm-exit of external interrupts.
---v1->v2:
1.Fix vmx_handle_intel_pt_intr() directly instead of changing the generic function. 2.Tune the commit message.
arch/x86/kvm/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/vmx/vmx.c +1 -1
@@ -7856,7 +7856,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 (!kvm_handling_nmi_from_guest (vcpu))return 0 ;kvm_make_request (KVM_REQ_PMI , vcpu);
Signature · 1 line
2.32.0