mirror-linux/arch/x86/boot
Tom Lendacky 7b306dfa32 x86/sev: Evict cache lines during SNP memory validation
An SNP cache coherency vulnerability requires a cache line eviction
mitigation when validating memory after a page state change to private.
The specific mitigation is to touch the first and last byte of each 4K
page that is being validated. There is no need to perform the mitigation
when performing a page state change to shared and rescinding validation.

CPUID bit Fn8000001F_EBX[31] defines the COHERENCY_SFW_NO CPUID bit
that, when set, indicates that the software mitigation for this
vulnerability is not needed.

Implement the mitigation and invoke it when validating memory (making it
private) and the COHERENCY_SFW_NO bit is not set, indicating the SNP
guest is vulnerable.

Co-developed-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
2025-08-06 19:17:22 +02:00
..
compressed x86/efi: Implement support for embedding SBAT data for x86 2025-06-21 13:53:44 +02:00
startup x86/sev: Evict cache lines during SNP memory validation 2025-08-06 19:17:22 +02:00
.gitignore x86 boot build: make git ignore stale 'tools' directory 2025-03-24 23:09:14 -07:00
Makefile x86/efi: Implement support for embedding SBAT data for x86 2025-06-21 13:53:44 +02:00
a20.c
apm.c
bioscall.S x86/boot: Remove semicolon from "rep" prefixes 2025-04-18 09:32:57 +02:00
bitops.h x86/boot: Remove superfluous type casting from arch/x86/boot/bitops.h 2022-08-15 19:17:43 +02:00
boot.h Merge branch 'x86/boot' into x86/core, to merge dependent commits 2025-05-13 10:35:27 +02:00
cmdline.c
copy.S x86/boot: Remove semicolon from "rep" prefixes 2025-04-18 09:32:57 +02:00
cpu.c x86/cpu: Remove X86_FEATURE_NAMES 2023-05-15 20:03:08 +02:00
cpucheck.c x86/cpufeatures: Generate the <asm/cpufeaturemasks.h> header based on build config 2025-03-19 11:15:11 +01:00
cpuflags.c x86/sev: Evict cache lines during SNP memory validation 2025-08-06 19:17:22 +02:00
cpuflags.h x86/boot: Do not test if AC and ID eflags are changeable on x86_64 2025-03-08 20:36:26 +01:00
ctype.h
early_serial_console.c
edd.c
genimage.sh x86/build: Fix broken copy command in genimage.sh when making isoimage 2025-02-25 21:13:33 +01:00
header.S x86/efi: Implement support for embedding SBAT data for x86 2025-06-21 13:53:44 +02:00
install.sh kbuild: Abort make on install failures 2024-07-20 13:34:54 +09:00
io.h x86/boot: Port I/O: Allow to hook up alternative helpers 2022-04-07 08:27:52 -07:00
main.c x86/boot: Clean up the arch/x86/boot/main.c code a bit 2024-05-22 09:36:49 +02:00
memory.c
mkcpustr.c x86/cpufeatures: Generate the <asm/cpufeaturemasks.h> header based on build config 2025-03-19 11:15:11 +01:00
msr.h x86/boot: Introduce helpers for MSR reads/writes 2022-04-06 12:59:17 +02:00
mtools.conf.in
pm.c x86/asm: Always set A (accessed) flag in GDT descriptors 2023-12-20 10:57:51 +01:00
pmjump.S
printf.c x86/boot: Address clang -Wimplicit-fallthrough in vsprintf() 2024-05-17 09:22:56 +02:00
regs.c
setup.ld x86/boot: Drop CRC-32 checksum and the build tool that generates it 2025-03-07 23:59:10 +01:00
string.c x86/boot: Remove semicolon from "rep" prefixes 2025-04-18 09:32:57 +02:00
string.h x86/boot: Remove unused function atou() 2024-11-07 18:08:23 +01:00
tty.c
version.c kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
vesa.h
video-bios.c
video-mode.c
video-vesa.c sysfb: Enable boot time VESA graphic mode selection 2022-03-04 20:55:33 +01:00
video-vga.c
video.c x86/boot: Remove semicolon from "rep" prefixes 2025-04-18 09:32:57 +02:00
video.h