mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Melody Wang <huibo.wang@amd.com>
To: x86@kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	ardb@kernel.org
Subject: Re: [PATCH v3 6/8] x86/sev: Register the guest with the SVSM APIC protocol
Date: Wed, 23 Sep 2026 13:46:48 -0700	[thread overview]
Message-ID: <d54742a0-c95e-4c9f-bc24-51dd6586c451@amd.com> (raw)
In-Reply-To: <656edc5467df7d8c33676f0a80c3042885d95f9b.1789927246.git.huibo.wang@amd.com>

Hi all,

On 9/20/26 11:16 AM, Melody Wang wrote:
> diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
> index 49388524a61f..35b8641119b9 100644
> --- a/drivers/firmware/efi/libstub/x86-stub.c
> +++ b/drivers/firmware/efi/libstub/x86-stub.c
> @@ -793,6 +793,9 @@ static bool sev_prepare(void)
>   			unsupported);
>   		return true;
>   	}
> +
> +	svsm_register_alt_inj();
> +

Sashiko said this:

"Does this code handle non-EFI direct kernel boots correctly?
When an SEV-SNP guest is booted directly and bypasses the EFI stub (such as
when using QEMU's -kernel with a setup_data CC blob), sev_prepare() is
skipped entirely.
This completely bypasses the svsm_register_alt_inj() call.
The main kernel checks for Alternate Injection support via
cc_platform_has(CC_ATTR_SNP_ALTERNATE_INJECTION). This check relies
strictly on the sev_status MSR hardware bit set by the SVSM and ignores
whether the guest successfully registered the APIC emulation.
Could this cause the APIC probe to issue SVSM APIC calls via
__svsm_apic_msr_rw() that are rejected by the SVSM, leading to an
unconditional crash via sev_es_terminate() early in the boot sequence?"

Alternate Injection does not work without OVMF support so no need to 
handle the non-EFI direct kernel boots.

Thanks,
Melody
>   	return false;
>   }
>   

-- 
Thanks,
Melody


  reply	other threads:[~2026-09-23 20:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20 18:12 [PATCH v3 0/8] Alternate Injection: Secure Interrupt Delivery for SEV-SNP Guests - Guest Support Melody Wang
2026-09-20 18:12 ` [PATCH v3 1/8] x86/sev: Make SVSM calls preemption-safe Melody Wang
2026-09-20 18:16   ` Melody Wang
2026-09-20 18:12 ` [PATCH v3 2/8] x86/sev: Add support for Alternate Injection Melody Wang
2026-09-20 18:16   ` Melody Wang
2026-09-20 18:16 ` [PATCH v3 0/8] Alternate Injection: Secure Interrupt Delivery for SEV-SNP Guests - Guest Support Melody Wang
2026-09-20 18:16 ` [PATCH v3 3/8] x86/apic: Add an SVSM APIC driver Melody Wang
2026-09-22  1:31   ` Melody Wang
2026-09-23 20:31   ` Borislav Petkov
2026-09-20 18:16 ` [PATCH v3 4/8] x86/sev: Route unsupported APIC register accesses to the hypervisor APIC emulation Melody Wang
2026-09-20 18:16 ` [PATCH v3 5/8] x86/sev: Add a function to contain all SEV-specific setup operations Melody Wang
2026-09-20 18:16 ` [PATCH v3 6/8] x86/sev: Register the guest with the SVSM APIC protocol Melody Wang
2026-09-23 20:46   ` Melody Wang [this message]
2026-09-20 18:16 ` [PATCH v3 7/8] x86/sev: Allow the guest to configure interrupt vectors for the hypervisor Melody Wang
2026-09-23 20:46   ` Melody Wang
2026-09-20 18:17 ` [PATCH v3 8/8] x86/sev: Indicate that Alternate Injection is supported in the guest Melody Wang
2026-09-23 20:56 ` [PATCH v3 0/8] Alternate Injection: Secure Interrupt Delivery for SEV-SNP Guests - Guest Support Ard Biesheuvel

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=d54742a0-c95e-4c9f-bc24-51dd6586c451@amd.com \
    --to=huibo.wang@amd.com \
    --cc=ardb@kernel.org \
    --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®