linux-stable/arch/x86/boot
Brijesh Singh cbd3d4f7c4 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
2022-04-06 13:10:23 +02:00
..
compressed x86/sev: Check SEV-SNP features support 2022-04-06 13:10:23 +02:00
tools x86/build: Declutter the build output 2020-08-20 08:17:40 +02:00
.gitignore x86/boot: Modernize genimage script; hdimage+EFI support 2021-05-10 12:27:50 +02:00
Makefile x86/build: Move the install rule to arch/x86/Makefile 2021-08-25 11:57:38 +02:00
a20.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
apm.c x86/boot: Fix comment spelling 2020-03-17 20:52:52 +01:00
bioscall.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
bitops.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
boot.h isystem: ship and use stdarg.h 2021-08-19 09:02:55 +09:00
cmdline.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
copy.S x86/asm: Do not annotate functions with GLOBAL 2019-10-18 11:25:58 +02:00
cpu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
cpucheck.c x86/boot: Use MSR read/write helpers instead of inline assembly 2022-04-06 13:02:13 +02:00
cpuflags.c
cpuflags.h
ctype.h
early_serial_console.c x86: Clean up 'sizeof x' => 'sizeof(x)' 2018-10-29 07:13:28 +01:00
edd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
genimage.sh x86/boot: Fix make hdimage with older versions of mtools 2021-09-29 11:06:47 +02:00
header.S x86: Bump ZO_z_extra_bytes margin for zstd 2020-07-31 11:49:08 +02:00
install.sh
main.c x86/boot: Use common BUILD_BUG_ON 2019-08-16 14:15:50 +02:00
memory.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
mkcpustr.c x86/cpu: Print VMX flags in /proc/cpuinfo using VMX_FEATURES_* 2020-01-13 18:36:02 +01:00
msr.h x86/boot: Introduce helpers for MSR reads/writes 2022-04-06 12:59:17 +02:00
mtools.conf.in x86/boot: Fix make hdimage with older versions of mtools 2021-09-29 11:06:47 +02:00
pm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
pmjump.S x86/asm: Do not annotate functions with GLOBAL 2019-10-18 11:25:58 +02:00
printf.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
regs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
setup.ld x86/boot: Add .text.* to setup.ld 2020-08-14 12:52:35 +02:00
string.c x86/boot: Add kstrtoul() from lib/ 2020-05-04 15:19:07 +02:00
string.h x86/boot/string: Add missing function prototypes 2021-12-10 19:49:06 +01:00
tty.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
version.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
vesa.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 48 2019-05-24 17:27:13 +02:00
video-bios.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
video-mode.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
video-vesa.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
video-vga.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
video.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
video.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00