crypto/arm64: sm4 - Drop cpu feature table for PMULL
Subsystems (2)
PATCH 1/1 crypto/arm64: sm4 - Drop cpu feature table for PMULL
The result of having that table is that the sm4-ce-gcm module is autoloaded if the CPU supports the PMULL cpu feature. However that module is only usefull if there are both SM4 and PMULL. The module is already auto-loaded if the CPU has SM4 and calls sm4_ce_gcm_init() then which fails without PMULL.
So dropping the PMULL cpu feature table has the only affect that on machines with PMULL but without SM4 the useless module isn't loaded any more.
---
Hello,
PSA: I don't know what these cpu features are and what the sm4-ce-gcm module does. I just stumbled over that MODULE_DEVICE_TABLE(cpu, ...) and convinced myself by looking at the code about the above analysis. It wouldn't be a big surprise to me if I missed something relevant. So please apply some distrust before the patch.
Best regards
Uwe
arch/arm64/crypto/sm4-ce-gcm-glue.c | 6 ------ 1 file changed, 6 deletions(-)
arch/arm64/crypto/sm4-ce-gcm-glue.c +0 -6
@@ -247,12 +247,6 @@ static void __exit sm4_ce_gcm_exit(void)crypto_unregister_aead (&sm4_gcm_alg); } -static const struct cpu_feature __maybe_unused sm4_ce_gcm_cpu_feature[] = { - {cpu_feature (PMULL ) }, - {} -}; -MODULE_DEVICE_TABLE (cpu, sm4_ce_gcm_cpu_feature); -module_cpu_feature_match (SM4 , sm4_ce_gcm_init);module_exit (sm4_ce_gcm_exit);
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
Signature · 1 line
2.56.0.rc1
Quoted 11 lines · Uwe Kleine-König
The result of having that table is that the sm4-ce-gcm module is autoloaded if the CPU supports the PMULL cpu feature. However that module is only usefull if there are both SM4 and PMULL. The module is already auto-loaded if the CPU has SM4 and calls
sm4_ce_gcm_init()then which fails without PMULL.So dropping the PMULL cpu feature table has the only affect that on machines with PMULL but without SM4 the useless module isn't loaded any more.
Signed-off-by Uwe Kleine-König <[email protected]>
Quoted 8 lines
---
Hello,PSA: I don't know what these cpu features are and what the sm4-ce-gcm module does. I just stumbled over that
MODULE_DEVICE_TABLE(cpu, ...)and convinced myself by looking at the code about the above analysis. It wouldn't be a big surprise to me if I missed something relevant. So please apply some distrust before the patch.
I guess this and your other patch look fine, if Herbert wants to apply them. Note that we've actually been moving away from having separate modules for the architecture-optimized crypto code, and when that happens to this code the MODULE_DEVICE_TABLE will go away anyway.
- Eric