Re: [PATCH v4 5/7] x86/sev: Register the guest with the SVSM APIC protocol
From: Melody Wang
Date: Wed Oct 14 2026 - 23:57:19 EST
Hi Ard,
On 10/14/26 2:43 AM, Ard Biesheuvel wrote:
I'm struggling to follow the logic here: doesn't this attempt to locate
the protocol on non-SEV/SNP systems as well?
Alternate Injection is only working for SEV-SNP guest.
Wouldn't it be sufficient to do
if (!snp_vmpl ||
!(sev_get_status() & MSR_AMD64_SNP_ALTERNATE_INJ))
return 0;
and leave the early_is_sevsnp_guest() check alone?
The thing is, snp_vmpl hasn't been initialized here yet. We read here a 0. So I need early_is_sevsnp_guest() to initialize it to U8_MAX so that I know that there's an SVSM present.
Then I can enable AltInj.
--
Thanks,
Melody