]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/sev: Create snp_shutdown()
authorTycho Andersen (AMD) <tycho@kernel.org>
Tue, 24 Mar 2026 16:12:57 +0000 (10:12 -0600)
committerBorislav Petkov (AMD) <bp@alien8.de>
Sun, 29 Mar 2026 10:15:17 +0000 (12:15 +0200)
commitb65546b14d273dde2a56c0313da36a6aeb5c3f32
tree721bedc686386ea4bdfebda59250b60ffc003f0b
parentca2ca373ec854d203c74e6ac1c4e08a70e8d2509
x86/sev: Create snp_shutdown()

After SNP_SHUTDOWN, two things should be done:

1. clear the RMP table
2. disable MFDM to prevent the FW_WARN in k8_check_syscfg_dram_mod_en() in
   the event of a kexec

Create and export to the CCP driver a function that does them.

Also change the MFDM helper to allow for disabling the bit, since the SNP x86
shutdown path needs to disable MFDM.

The comment for k8_check_syscfg_dram_mod_en() notes, the "BIOS" is supposed
clear it, or the kernel in the case of module unload and shutdown followed by
kexec.

Signed-off-by: Tycho Andersen (AMD) <tycho@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://patch.msgid.link/20260324161301.1353976-4-tycho@kernel.org
arch/x86/include/asm/sev.h
arch/x86/virt/svm/sev.c