mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Melody Wang <huibo.wang@amd.com>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <bonzini@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
	Joerg Roedel <joro@8bytes.org>,
	Tom Lendacky <thomas.lendacky@amd.com>, <x86@kernel.org>,
	Melody Wang <huibo.wang@amd.com>
Subject: [RFC PATCH  1/9] x86/sev: Define extended #HV doorbell page structure
Date: Tue, 10 Nov 2026 08:28:46 +0000	[thread overview]
Message-ID: <64d588e4148556fba3587cf399c512e658c4cfff.1794295647.git.huibo.wang@amd.com> (raw)
In-Reply-To: <cover.1794295647.git.huibo.wang@amd.com>

Alternate Injection extends the #HV doorbell page with additional
information about interrupts or events related to interrupt processing
for VMPL1-3.

Define the extended #HV doorbell page according to the spec.

Signed-off-by: Melody Wang <huibo.wang@amd.com>
---
 arch/x86/include/asm/svm.h | 60 +++++++++++++++++++++++++++++++++++---
 1 file changed, 56 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
index 32a35ee10bce..c658eba189dc 100644
--- a/arch/x86/include/asm/svm.h
+++ b/arch/x86/include/asm/svm.h
@@ -259,8 +259,43 @@ struct __attribute__ ((__packed__)) vmcb_control_area {
  * is shared between the guest and hypervisor to communicate exception and
  * interrupt events.
  */
+struct ext_irq_desc {
+	/* first 16-bit word */
+	union {
+		struct {
+			u16 si_vector:		8,
+			    nmi:		1,
+			    mce:		1,
+			    trigger_mode:	1,
+			    reserved6:		3,
+			    multi_interrupts:	1,
+			    reserved7:		1;
+		};
+
+		u16 ext_word0;
+	};
+
+	/* Second 16-bit word */
+	union {
+		struct {
+			u16 reserved8:		15,
+			    interrupt_vector:	1;
+		};
+
+		u16 ext_word1;
+	};
+
+	/*
+	 * Set the corresponding vmpl?_irq bit in the bitmap after setting
+	 * multiple bits here.
+	 */
+	u16 interrupt_bit_vector[14];
+
+	u8 reserved9[32];
+} __packed;
+
 struct hvdb_events {
-	/* First 64 bytes of HV doorbell page defined in GHCB specification */
+	/* first 16-bit word PendingEvent */
 	union {
 		struct {
 			/* Non-maskable event indicators */
@@ -274,10 +309,27 @@ struct hvdb_events {
 		u16 pending_events;
 	};
 
-	u8 no_eoi_required;
+	/* Second 16-bit word InjectionInfo */
+	union {
+		struct {
+			u16 no_eoi_required:	1,
+			    reserved3:		7,
+			    vmpl1_irq:		1,
+			    vmpl2_irq:		1,
+			    vmpl3_irq:		1,
+			    reserved4:		5;
+		};
+
+		u16 second_word;
+	};
+
+	/* IRQ info associated with the SVSM itself */
+	u8 svsm_irq_info[64 - 4];
 
-	u8 reserved3[61];
-};
+	/* VMPL[1-3] extended IRQ descriptions */
+	struct ext_irq_desc irqs[3];
+
+} __packed;
 
 struct hvdb {
 	struct hvdb_events events;
-- 
2.43.0


  reply	other threads:[~2026-11-10  8:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  8:28 [RFC PATCH 0/9] Alternate Injection: Secure Interrupt Delivery for SEV-SNP Guests Melody Wang
2026-11-10  8:28 ` Melody Wang [this message]
2026-11-10  8:28 ` [RFC PATCH 2/9] KVM: SVM: Add support for Alternate Injection for the SEV-SNP #HV doorbell page NAE event Melody Wang
2026-11-10  8:28 ` [RFC PATCH 3/9] KVM: SVM: Add Alternate Injection support Melody Wang
2026-11-10  8:28 ` [RFC PATCH 4/9] KVM: SVM: Add Alternate Injection path Melody Wang
2026-11-10  8:28 ` [RFC PATCH 5/9] KVM: SVM: Bypass lapic for VMPL1-3 guest with Alternate Injection enabled Melody Wang
2026-11-10  8:28 ` [RFC PATCH 6/9] KVM: SVM: Inject #HV into VMPL0 " Melody Wang
2026-11-10  8:28 ` [RFC PATCH 7/9] KVM: SVM: Notify the SVSM an intercept happened during interrupt delivery Melody Wang
2026-11-10  8:28 ` [RFC PATCH 8/9] KVM: SVM: Clear AVIC Enable when Alternate Injection is enabled Melody Wang
2026-11-10  8:28 ` [RFC PATCH 9/9] KVM: SVM: Enable Alternate Injection for an SEV-SNP guest Melody Wang

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=64d588e4148556fba3587cf399c512e658c4cfff.1794295647.git.huibo.wang@amd.com \
    --to=huibo.wang@amd.com \
    --cc=bonzini@redhat.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@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®