]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto/ccp: Implement SNP x86 shutdown
authorTycho Andersen (AMD) <tycho@kernel.org>
Tue, 24 Mar 2026 16:13:00 +0000 (10:13 -0600)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 30 Mar 2026 10:02:12 +0000 (12:02 +0200)
commitf995fc377ac7d3757e1d94e6403940c4b8f3d76e
treea4e55da32799e29c828e21f1b829cb4e373b316a
parent7b2bc5f0ab983a7aad7fa5180cede4b3e91fc164
crypto/ccp: Implement SNP x86 shutdown

The SEV firmware has support to disable SNP during an SNP_SHUTDOWN_EX command.
Verify that this support is available and set the flag so that SNP is disabled
when it is not being used.

In cases where SNP is disabled, skip the call to amd_iommu_snp_disable(), as
all of the IOMMU pages have already been made shared. Also skip the panic
case, since snp_shutdown() does IPIs.

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>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://patch.msgid.link/20260324161301.1353976-7-tycho@kernel.org
drivers/crypto/ccp/sev-dev.c
include/linux/psp-sev.h