Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/sev, crypto/ccp: Move SNP init to ccp driver

Use the new snp_prepare() to initialize SNP from the ccp driver instead of at
boot time. This means that SNP is not enabled unless it is really going to be
used (i.e. kvm_amd loads the ccp driver automatically).

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-5-tycho@kernel.org

authored by

Tycho Andersen (AMD) and committed by
Borislav Petkov (AMD)
299933b1 b65546b1

+2 -2
-2
arch/x86/virt/svm/sev.c
··· 562 562 if (!setup_rmptable()) 563 563 return -ENOSYS; 564 564 565 - snp_prepare(); 566 - 567 565 /* 568 566 * Setting crash_kexec_post_notifiers to 'true' to ensure that SNP panic 569 567 * notifier is invoked to do SNP IOMMU shutdown before kdump.
+2
drivers/crypto/ccp/sev-dev.c
··· 1373 1373 return -EOPNOTSUPP; 1374 1374 } 1375 1375 1376 + snp_prepare(); 1377 + 1376 1378 /* SNP_INIT requires MSR_VM_HSAVE_PA to be cleared on all CPUs. */ 1377 1379 on_each_cpu(snp_set_hsave_pa, NULL, 1); 1378 1380