From: Jim Mattson <jmattson@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: Jim Mattson <jmattson@google.com>, Yosry Ahmed <yosry@kernel.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] KVM: SVM: Set NMI_VECTOR in event_inj in svm_inject_nmi()
Date: Wed, 28 Oct 2026 06:26:53 -0700 [thread overview]
Message-ID: <20261028132657.1416783-2-jmattson@google.com> (raw)
In-Reply-To: <20261028132657.1416783-1-jmattson@google.com>
Include NMI_VECTOR (2) in svm->vmcb->control.event_inj when injecting an
NMI in svm_inject_nmi(), matching vmx_inject_nmi().
Although hardware ignores EVENTINJ.VECTOR on VMRUN when TYPE is NMI (APM
Vol. 2, "Event Injection"), omitting NMI_VECTOR causes
svm_get_entry_info() to report vector 0 instead of 2 to the kvm_entry
tracepoint, and causes svm_cancel_injection() to copy an exit_int_info
value with vector 0 into the active VMCB.
Fixes: 95ba82731374 ("KVM: SVM: Add NMI injection support")
Signed-off-by: Jim Mattson <jmattson@google.com>
---
arch/x86/kvm/svm/svm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 136069dfcd44..41e85702b380 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -3914,7 +3914,7 @@ static void svm_inject_nmi(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
- svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_NMI;
+ svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_NMI | NMI_VECTOR;
if (svm->nmi_l1_to_l2)
return;
--
2.56.0.307.g5fe7bd680c-goog
next prev parent reply other threads:[~2026-10-28 13:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 13:26 [PATCH 1/2] KVM: nSVM: Set NMI_VECTOR in synthesized NMI exit_int_info Jim Mattson
2026-10-28 13:26 ` Jim Mattson [this message]
2026-10-28 17:11 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261028132657.1416783-2-jmattson@google.com \
--to=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=yosry@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®