Re: [PATCH v1 6/8] x86/sev: Register the guest with the SVSM APIC protocol
From: Borislav Petkov
Date: Wed Sep 09 2026 - 21:39:36 EST
On Sat, Aug 29, 2026 at 03:39:44AM +0000, Melody Wang wrote:
> @@ -520,5 +520,22 @@ bool sev_prepare(void)
> return true;
> }
>
> + /* Register Alternate Injection */
> + if (early_is_sevsnp_guest() && snp_vmpl) {
> + struct svsm_call call = {};
> + int ret;
> +
> + if (!(sev_get_status() & MSR_AMD64_SNP_ALTERNATE_INJ))
> + return 0;
Function is a bool - this needs to be
return false;
> +
> + call.caa = (struct svsm_ca *)boot_svsm_caa_pa;
> + call.rax = SVSM_APIC_CALL(SVSM_APIC_CONFIG_EMULATION);
> + call.rcx = SVSM_AI_REGISTER;
> +
> + ret = svsm_call_msr_protocol(&call);
> + if (ret)
> + sev_es_terminate(SEV_TERM_SET_LINUX, GHCB_TERM_ALT_INJ_FAIL);
> + }
> +
> return false;
> }
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette