linux-stable/Documentation/x86
Nikunj A Dadhania 2d4c140e9a x86/sev: Add SEV-SNP guest feature negotiation support
commit 8c29f01654 upstream.

The hypervisor can enable various new features (SEV_FEATURES[1:63]) and start a
SNP guest. Some of these features need guest side implementation. If any of
these features are enabled without it, the behavior of the SNP guest will be
undefined.  It may fail booting in a non-obvious way making it difficult to
debug.

Instead of allowing the guest to continue and have it fail randomly later,
detect this early and fail gracefully.

The SEV_STATUS MSR indicates features which the hypervisor has enabled.  While
booting, SNP guests should ascertain that all the enabled features have guest
side implementation. In case a feature is not implemented in the guest, the
guest terminates booting with GHCB protocol Non-Automatic Exit(NAE) termination
request event, see "SEV-ES Guest-Hypervisor Communication Block Standardization"
document (currently at https://developer.amd.com/wp-content/resources/56421.pdf),
section "Termination Request".

Populate SW_EXITINFO2 with mask of unsupported features that the hypervisor can
easily report to the user.

More details in the AMD64 APM Vol 2, Section "SEV_STATUS MSR".

  [ bp:
    - Massage.
    - Move snp_check_features() call to C code.
    Note: the CC:stable@ aspect here is to be able to protect older, stable
    kernels when running on newer hypervisors. Or not "running" but fail
    reliably and in a well-defined manner instead of randomly. ]

Fixes: cbd3d4f7c4 ("x86/sev: Check SEV-SNP features support")
Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/r/20230118061943.534309-1-nikunj@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-01 08:34:50 +01:00
..
i386
x86_64 dma-mapping updates 2022-08-06 10:56:45 -07:00
amd-memory-encryption.rst x86/sev: Add SEV-SNP guest feature negotiation support 2023-02-01 08:34:50 +01:00
amd_hsmp.rst
boot.rst
booting-dt.rst
buslock.rst
cpuinfo.rst x86/cpu: Remove "nosmep" 2022-04-04 10:17:00 +02:00
earlyprintk.rst
elf_auxvec.rst
entry_64.rst docs: x86: replace do_IRQ int the entry_64.rst with common_interrupt() 2022-09-27 13:21:44 -06:00
exception-tables.rst Documentation: x86: Fix obsolete name of page fault handler 2022-04-05 10:28:36 -06:00
features.rst
ifs.rst Documentation: In-Field Scan 2022-05-12 15:35:29 +02:00
index.rst It was a moderately busy cycle for documentation; highlights include: 2022-05-25 11:17:41 -07:00
intel-hfi.rst
intel_txt.rst
iommu.rst Documentation: x86: rework IOMMU documentation 2022-04-28 07:59:45 -06:00
kernel-stacks.rst
mds.rst
microcode.rst x86/microcode: Document the whole late loading problem 2022-08-18 15:57:53 +02:00
mtrr.rst
orc-unwinder.rst objtool: update objtool.txt references 2022-07-07 13:10:00 -06:00
pat.rst
pti.rst
resctrl.rst
sgx.rst Documentation/x86: Introduce enclave runtime management section 2022-07-07 10:13:03 -07:00
sva.rst
tdx.rst Documentation/x86: Document TDX kernel architecture 2022-04-08 06:57:09 -07:00
tlb.rst
topology.rst
tsx_async_abort.rst
usb-legacy-support.rst
xstate.rst
zero-page.rst x86/boot: Add a pointer to Confidential Computing blob in bootparams 2022-04-07 16:47:11 +02:00