mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
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
This commit is contained in:
committed by
Borislav Petkov (AMD)
parent
b65546b14d
commit
299933b118
@@ -1373,6 +1373,8 @@ static int __sev_snp_init_locked(int *error, unsigned int max_snp_asid)
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
snp_prepare();
|
||||
|
||||
/* SNP_INIT requires MSR_VM_HSAVE_PA to be cleared on all CPUs. */
|
||||
on_each_cpu(snp_set_hsave_pa, NULL, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user