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.

crypto: ccp - Add psp_init_on_probe module parameter

Add psp_init_on_probe module parameter that allows for skipping the
PSP's SEV platform initialization during module init. User may decouple
module init from PSP init due to use of the INIT_EX support in upcoming
patch which allows for users to save PSP's internal state to file. The
file may be unavailable at module init.

Also moves the PSP ABI version log message to after successful PSP init
instead of module init in case this new parameter is used.

Signed-off-by: Peter Gonda <pgonda@google.com>
Acked-by: Brijesh Singh <brijesh.singh@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Marc Orr <marcorr@google.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Rientjes <rientjes@google.com>
Cc: John Allen <john.allen@amd.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Peter Gonda and committed by
Herbert Xu
b64fa5fc cc17982d

+12 -7
+12 -7
drivers/crypto/ccp/sev-dev.c
··· 43 43 module_param(psp_probe_timeout, int, 0644); 44 44 MODULE_PARM_DESC(psp_probe_timeout, " default timeout value, in seconds, during PSP device probe"); 45 45 46 + static bool psp_init_on_probe = true; 47 + module_param(psp_init_on_probe, bool, 0444); 48 + MODULE_PARM_DESC(psp_init_on_probe, " if true, the PSP will be initialized on module init. Else the PSP will be initialized on the first command requiring it"); 49 + 46 50 MODULE_FIRMWARE("amd/amd_sev_fam17h_model0xh.sbin"); /* 1st gen EPYC */ 47 51 MODULE_FIRMWARE("amd/amd_sev_fam17h_model3xh.sbin"); /* 2nd gen EPYC */ 48 52 MODULE_FIRMWARE("amd/amd_sev_fam19h_model0xh.sbin"); /* 3rd gen EPYC */ ··· 309 305 310 306 dev_dbg(sev->dev, "SEV firmware initialized\n"); 311 307 312 - return rc; 308 + dev_info(sev->dev, "SEV API:%d.%d build:%d\n", sev->api_major, 309 + sev->api_minor, sev->build); 310 + 311 + return 0; 313 312 } 314 313 315 314 int sev_platform_init(int *error) ··· 1116 1109 dev_warn(sev->dev, 1117 1110 "SEV: TMR allocation failed, SEV-ES support unavailable\n"); 1118 1111 1112 + if (!psp_init_on_probe) 1113 + return; 1114 + 1119 1115 /* Initialize the platform */ 1120 1116 rc = sev_platform_init(&error); 1121 - if (rc) { 1117 + if (rc) 1122 1118 dev_err(sev->dev, "SEV: failed to INIT error %#x, rc %d\n", 1123 1119 error, rc); 1124 - return; 1125 - } 1126 - 1127 - dev_info(sev->dev, "SEV API:%d.%d build:%d\n", sev->api_major, 1128 - sev->api_minor, sev->build); 1129 1120 1130 1121 return; 1131 1122