diff options
author | Tom Lendacky <thomas.lendacky@amd.com> | 2022-03-07 22:33:32 +0100 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2022-04-06 17:06:49 +0200 |
commit | 0afb6b660a6b58cb336d1175ed687bf9525849a4 (patch) | |
tree | 9f12fd9423ad05806c230dd998e9c7a18e77212a /arch/x86/include/asm/sev-common.h | |
parent | x86/mm: Validate memory when changing the C-bit (diff) | |
download | linux-0afb6b660a6b58cb336d1175ed687bf9525849a4.tar.xz linux-0afb6b660a6b58cb336d1175ed687bf9525849a4.zip |
x86/sev: Use SEV-SNP AP creation to start secondary CPUs
To provide a more secure way to start APs under SEV-SNP, use the SEV-SNP
AP Creation NAE event. This allows for guest control over the AP register
state rather than trusting the hypervisor with the SEV-ES Jump Table
address.
During native_smp_prepare_cpus(), invoke an SEV-SNP function that, if
SEV-SNP is active, will set/override apic->wakeup_secondary_cpu. This
will allow the SEV-SNP AP Creation NAE event method to be used to boot
the APs. As a result of installing the override when SEV-SNP is active,
this method of starting the APs becomes the required method. The override
function will fail to start the AP if the hypervisor does not have
support for AP creation.
[ bp: Work in forgotten review comments. ]
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220307213356.2797205-23-brijesh.singh@amd.com
Diffstat (limited to 'arch/x86/include/asm/sev-common.h')
-rw-r--r-- | arch/x86/include/asm/sev-common.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/sev-common.h b/arch/x86/include/asm/sev-common.h index 1aa72b5c2490..e9b6815b3b3d 100644 --- a/arch/x86/include/asm/sev-common.h +++ b/arch/x86/include/asm/sev-common.h @@ -104,6 +104,7 @@ enum psc_op { (((u64)(v) & GENMASK_ULL(63, 12)) >> 12) #define GHCB_HV_FT_SNP BIT_ULL(0) +#define GHCB_HV_FT_SNP_AP_CREATION BIT_ULL(1) /* SNP Page State Change NAE event */ #define VMGEXIT_PSC_MAX_ENTRY 253 |