]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sev: Check SEV-SNP features support
authorBrijesh Singh <brijesh.singh@amd.com>
Wed, 9 Feb 2022 18:10:06 +0000 (12:10 -0600)
committerBorislav Petkov <bp@suse.de>
Wed, 6 Apr 2022 11:10:23 +0000 (13:10 +0200)
commitf0492060dc1b7e86c16e0abfa315ee5e24c24046
tree4c7df4cd0f61c1781905d4294a7cb9bd8d51579d
parent8d605679fbdd001a5d581120a3412b0191ceb63d
x86/sev: Check SEV-SNP features support

Version 2 of the GHCB specification added the advertisement of features
that are supported by the hypervisor. If the hypervisor supports SEV-SNP
then it must set the SEV-SNP features bit to indicate that the base
functionality is supported.

Check that feature bit while establishing the GHCB; if failed, terminate
the guest.

Version 2 of the GHCB specification adds several new Non-Automatic Exits
(NAEs), most of them are optional except the hypervisor feature. Now
that the hypervisor feature NAE is implemented, bump the GHCB maximum
supported protocol version.

While at it, move the GHCB protocol negotiation check from the #VC
exception handler to sev_enable() so that all feature detection happens
before the first #VC exception.

While at it, document why the GHCB page cannot be setup from
load_stage2_idt().

  [ bp: Massage commit message. ]

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-13-brijesh.singh@amd.com
arch/x86/boot/compressed/idt_64.c
arch/x86/boot/compressed/sev.c
arch/x86/include/asm/sev-common.h
arch/x86/include/asm/sev.h
arch/x86/include/uapi/asm/svm.h
arch/x86/kernel/sev-shared.c
arch/x86/kernel/sev.c