Re: [PATCH v2 03/14] x86/sev: Check for the presence of an SVSM in the SNP Secrets page

From: Tom Lendacky
Date: Mon Mar 11 2024 - 10:53:53 EST


On 3/8/24 18:33, Dionna Amalie Glaze wrote:
On Fri, Mar 8, 2024 at 10:36 AM Tom Lendacky <thomas.lendacky@xxxxxxx> wrote:

During early boot phases, check for the presence of an SVSM when running
as an SEV-SNP guest.

An SVSM is present if the 64-bit value at offset 0x148 into the secrets
page is non-zero. If an SVSM is present, save the SVSM Calling Area
address (CAA), located at offset 0x150 into the secrets page, and set
the VMPL level of the guest, which should be non-zero, to indicate the
presence of an SVSM.

Signed-off-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
---
arch/x86/boot/compressed/sev.c | 35 ++++++++---------
arch/x86/include/asm/sev-common.h | 4 ++
arch/x86/include/asm/sev.h | 25 +++++++++++-
arch/x86/kernel/sev-shared.c | 64 +++++++++++++++++++++++++++++++
arch/x86/kernel/sev.c | 16 ++++++++
5 files changed, 125 insertions(+), 19 deletions(-)


+
+/*
+ * Maintain the GPA of the SVSM Calling Area (CA) in order to utilize the SVSM
+ * services needed when not runnuing in VMPL0.

running*

otherwise lgtm

Will fix.

Thanks,
Tom