From: Melody Wang <huibo.wang@amd.com>
To: <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Tom Lendacky <thomas.lendacky@amd.com>,
Melody Wang <huibo.wang@amd.com>
Subject: [PATCH v2 0/8] Alternate Injection: Secure Interrupt Delivery for SEV-SNP Guests - Guest Support
Date: Mon, 14 Sep 2026 00:57:16 +0000 [thread overview]
Message-ID: <cover.1789345277.git.huibo.wang@amd.com> (raw)
Hi all,
This revision fixes all the review comments from version 1.
The changes include:
1. Changed a few comments for better understanding, deleted some unnecessary
code, corrected some typos, and some minor code fixes from the review
comments by Sashiko and Boris.
2. Unified sev_apic_ghcb_msr_write() and sev_apic_ghcb_msr_read().
3. Move x2apic_svsm.o after x2apic_savic.o so that the secure AVIC gets
preferred on machines supporting it.
4. Reworked svsm_apic_probe() as Boris suggested.
5. Updated tools with renamed MSR_AMD64_SNP_ALTERNATE_INJ_BIT and
MSR_AMD64_SNP_ALT_INJ for completeness' sake.
6. Changed svsm_apic_send_IPI_self() with writing to the dedicated
APIC_SELF_IPI instead of writing to APIC_ICR.
Thanks,
Melody
Changelog:
v1
--
The revision fixes all of the review comments from version 0.
The changes include:
1. Changed a few commit messages, new file names, variables name and order,
function names and more comments for better understanding.
2. Added a pre-patch to fix the problem that in two functions in the the SVSM
vTPM guest implementation do not disable preemption when fetching CAA. It
is moving the CAA fetching operation inside svsm_perform_call_protocol().
This series relies on this fix too.
3. Removed svsm_do_call() helper function and some intermediary layer
functions in SVSM APIC driver.
4. Removed the Secure AVIC check in SVSM APIC driver since it will never be
touched.
5. Terminate boot when Alternate Injection is enabled in vmpl0.
6. Added a common function for SVSM APIC read and write.
7. Added a new SEV_TERM_SET_LINUX value for Alternate Injection and APIC ghcb
msr read/write.
8. Reworked sev_prepare() to reflect the error conditions correctly.
9. Moved allowing all of interrupts right after registering the SVSM APIC
protocol.
v0
--
Alternate Injection is a method to provide secure interrupt delivery for
SEV-SNP guests against malicious injection attacks. By handing over the
control of the interrupt injection to the guest itself, the security is
applied. Alternate Injection use Secure VM Service Module (SVSM), and APIC
emulation in the SVSM to secure interrupt delivery.
This is the guest side patches. The patch set includes the following:
1. Add support for enabling Alternate Injection.
2. Add support for the SVSM APIC protocol which uses a subset of the
X2APIC MSRs.
3. Add support to allow the guest OS to request Alternate
Injection.
Melody Wang (8):
x86/sev: Make SVSM calls preemption-safe
x86/sev: Add support for Alternate Injection
x86/apic: Add an SVSM APIC driver
x86/sev: Route unsupported APIC register accesses to the hypervisor
APIC emulation
x86/sev: Add a function to contain all SEV-specific setup operations
x86/sev: Register the guest with the SVSM APIC protocol
x86/sev: Allow the guest to configure interrupt vectors for the
hypervisor
x86/sev: Indicate that Alternate Injection is supported in the guest
arch/x86/Kconfig | 14 ++
arch/x86/boot/compressed/sev.c | 50 ++++-
arch/x86/boot/compressed/sev.h | 13 ++
arch/x86/coco/core.c | 3 +
arch/x86/coco/sev/core.c | 48 ++---
arch/x86/coco/sev/svsm.c | 10 +-
arch/x86/include/asm/msr-index.h | 4 +-
arch/x86/include/asm/sev-common.h | 2 +
arch/x86/include/asm/sev.h | 20 +-
arch/x86/kernel/apic/Makefile | 1 +
arch/x86/kernel/apic/x2apic_savic.c | 8 +-
arch/x86/kernel/apic/x2apic_svsm.c | 243 ++++++++++++++++++++++++
drivers/firmware/efi/libstub/x86-stub.c | 17 +-
include/linux/cc_platform.h | 8 +
tools/arch/x86/include/asm/msr-index.h | 4 +-
15 files changed, 385 insertions(+), 60 deletions(-)
create mode 100644 arch/x86/kernel/apic/x2apic_svsm.c
--
2.43.0
next reply other threads:[~2026-09-14 0:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 0:57 Melody Wang [this message]
2026-09-14 0:57 ` [PATCH v2 1/8] x86/sev: Make SVSM calls preemption-safe Melody Wang
2026-09-14 0:57 ` [PATCH v2 2/8] x86/sev: Add support for Alternate Injection Melody Wang
2026-09-14 0:57 ` [PATCH v2 3/8] x86/apic: Add an SVSM APIC driver Melody Wang
2026-09-14 0:57 ` [PATCH v2 4/8] x86/sev: Route unsupported APIC register accesses to the hypervisor APIC emulation Melody Wang
2026-09-14 0:57 ` [PATCH v2 5/8] x86/sev: Add a function to contain all SEV-specific setup operations Melody Wang
2026-09-14 20:04 ` Ard Biesheuvel
2026-09-14 0:57 ` [PATCH v2 6/8] x86/sev: Register the guest with the SVSM APIC protocol Melody Wang
2026-09-14 20:06 ` Ard Biesheuvel
2026-09-14 0:57 ` [PATCH v2 7/8] x86/sev: Allow the guest to configure interrupt vectors for the hypervisor Melody Wang
2026-09-14 0:57 ` [PATCH v2 8/8] x86/sev: Indicate that Alternate Injection is supported in the 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=cover.1789345277.git.huibo.wang@amd.com \
--to=huibo.wang@amd.com \
--cc=linux-kernel@vger.kernel.org \
--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®