* [PATCH] crypto/arm64: sm4 - Drop cpu feature table for PMULL
@ 2026-11-09 16:10 Uwe Kleine-König
2026-11-10 21:08 ` Eric Biggers
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2026-11-09 16:10 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Catalin Marinas, Will Deacon
Cc: Mark Rutland, linux-crypto, linux-arm-kernel, linux-kernel
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 <u.kleine-koenig@baylibre.com>
---
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(-)
diff --git a/arch/arm64/crypto/sm4-ce-gcm-glue.c b/arch/arm64/crypto/sm4-ce-gcm-glue.c
index ef06f4f768a1..ffed81b40220 100644
--- a/arch/arm64/crypto/sm4-ce-gcm-glue.c
+++ b/arch/arm64/crypto/sm4-ce-gcm-glue.c
@@ -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
--
2.56.0.rc1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto/arm64: sm4 - Drop cpu feature table for PMULL
2026-11-09 16:10 [PATCH] crypto/arm64: sm4 - Drop cpu feature table for PMULL Uwe Kleine-König
@ 2026-11-10 21:08 ` Eric Biggers
0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2026-11-10 21:08 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Herbert Xu, David S. Miller, Catalin Marinas, Will Deacon,
Mark Rutland, linux-crypto, linux-arm-kernel, linux-kernel
On Mon, Nov 09, 2026 at 05:10:52PM +0100, Uwe Kleine-König wrote:
> 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 <u.kleine-koenig@baylibre.com>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-10 21:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 16:10 [PATCH] crypto/arm64: sm4 - Drop cpu feature table for PMULL Uwe Kleine-König
2026-11-10 21:08 ` Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®