]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sev: Use SEV-SNP AP creation to start secondary CPUs
authorTom Lendacky <thomas.lendacky@amd.com>
Mon, 7 Mar 2022 21:33:32 +0000 (15:33 -0600)
committerBorislav Petkov <bp@suse.de>
Wed, 6 Apr 2022 15:06:49 +0000 (17:06 +0200)
commit75b897048bdaaf1997c6743e0bf7b2a2e7cad0e4
tree9f12fd9423ad05806c230dd998e9c7a18e77212a
parent411fd968c6805b8f2b6e77938fd0c51fdce9d154
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
arch/x86/include/asm/sev-common.h
arch/x86/include/asm/sev.h
arch/x86/include/uapi/asm/svm.h
arch/x86/kernel/sev.c
arch/x86/kernel/smpboot.c