]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sev: Get the AP jump table address from secrets page
authorBrijesh Singh <brijesh.singh@amd.com>
Fri, 22 Apr 2022 13:56:24 +0000 (08:56 -0500)
committerBorislav Petkov <bp@suse.de>
Wed, 27 Apr 2022 11:31:38 +0000 (13:31 +0200)
commit0c4033d5eee272de9461f77516e5bdf5cb6ba5ab
tree9b1e88b57fa942f2f31375b44d321fb140d42e8b
parent4fbaaa9d736ae4bb11956178854fdc7e202c3177
x86/sev: Get the AP jump table address from secrets page

The GHCB specification section 2.7 states that when SEV-SNP is enabled,
a guest should not rely on the hypervisor to provide the address of the
AP jump table. Instead, if a guest BIOS wants to provide an AP jump
table, it should record the address in the SNP secrets page so the guest
operating system can obtain it directly from there.

Fix this on the guest kernel side by having SNP guests use the AP jump
table address published in the secrets page rather than issuing a GHCB
request to get it.

  [ mroth:
    - Improve error handling when ioremap()/memremap() return NULL
    - Don't mix function calls with declarations
    - Add missing __init
    - Tweak commit message ]

Fixes: b3b8efb98c80 ("x86/sev: Use SEV-SNP AP creation to start secondary CPUs")
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220422135624.114172-3-michael.roth@amd.com
arch/x86/include/asm/sev.h
arch/x86/kernel/sev.c
drivers/virt/coco/sev-guest/sev-guest.h