* [PATCH] crypto: caam - enable hash api only on ARM platforms per default
@ 2024-06-26 15:57 Marco Felsch
2024-07-05 9:39 ` Horia Geanta
0 siblings, 1 reply; 6+ messages in thread
From: Marco Felsch @ 2024-06-26 15:57 UTC (permalink / raw)
To: horia.geanta@nxp.com, pankaj.gupta@nxp.com, gaurav.jain@nxp.com,
Herbert Xu
Cc: kernel, linux-crypto, linux-kernel
Tests showed that ARMv8-A crypto extensions as implemented on the ARM
Cortex-A53 on the i.MX8M family of processors are substantially faster
than the same primitives offered by the CAAM.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
drivers/crypto/caam/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/Kconfig b/drivers/crypto/caam/Kconfig
index c631f99e415f..5828ac64c988 100644
--- a/drivers/crypto/caam/Kconfig
+++ b/drivers/crypto/caam/Kconfig
@@ -126,7 +126,7 @@ config CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI
config CRYPTO_DEV_FSL_CAAM_AHASH_API
bool "Register hash algorithm implementations with Crypto API"
- default y
+ default y if ARM
select CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC
select CRYPTO_HASH
help
--
2.39.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] crypto: caam - enable hash api only on ARM platforms per default
2024-06-26 15:57 [PATCH] crypto: caam - enable hash api only on ARM platforms per default Marco Felsch
@ 2024-07-05 9:39 ` Horia Geanta
2024-07-05 11:01 ` Herbert Xu
0 siblings, 1 reply; 6+ messages in thread
From: Horia Geanta @ 2024-07-05 9:39 UTC (permalink / raw)
To: Marco Felsch, Horia Geanta, Pankaj Gupta, Gaurav Jain, Herbert Xu
Cc: kernel, linux-crypto, linux-kernel
On 6/26/2024 6:57 PM, Marco Felsch wrote:
> Tests showed that ARMv8-A crypto extensions as implemented on the ARM
> Cortex-A53 on the i.MX8M family of processors are substantially faster
> than the same primitives offered by the CAAM.
>
I disagree with compiling out the hash support.
If needed, algorithm priority could be changed - even at runtime,
using NETLINK_CRYPTO messages (needs CONFIG_CRYPTO_USER=y/m).
Thanks,
Horia
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] crypto: caam - enable hash api only on ARM platforms per default
2024-07-05 9:39 ` Horia Geanta
@ 2024-07-05 11:01 ` Herbert Xu
2024-07-09 8:54 ` Marco Felsch
0 siblings, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2024-07-05 11:01 UTC (permalink / raw)
To: Horia Geanta
Cc: Marco Felsch, Pankaj Gupta, Gaurav Jain, kernel, linux-crypto,
linux-kernel
On Fri, Jul 05, 2024 at 09:39:19AM +0000, Horia Geanta wrote:
>
> I disagree with compiling out the hash support.
>
> If needed, algorithm priority could be changed - even at runtime,
> using NETLINK_CRYPTO messages (needs CONFIG_CRYPTO_USER=y/m).
We should change the default priority.
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] crypto: caam - enable hash api only on ARM platforms per default
2024-07-05 11:01 ` Herbert Xu
@ 2024-07-09 8:54 ` Marco Felsch
2024-07-09 20:11 ` Herbert Xu
0 siblings, 1 reply; 6+ messages in thread
From: Marco Felsch @ 2024-07-09 8:54 UTC (permalink / raw)
To: Herbert Xu
Cc: Horia Geanta, Pankaj Gupta, Gaurav Jain, kernel, linux-crypto,
linux-kernel
On 24-07-05, Herbert Xu wrote:
> On Fri, Jul 05, 2024 at 09:39:19AM +0000, Horia Geanta wrote:
> >
> > I disagree with compiling out the hash support.
We don't compile it out, we just don't set the default=y since on ARMv8
it's not required.
> > If needed, algorithm priority could be changed - even at runtime,
> > using NETLINK_CRYPTO messages (needs CONFIG_CRYPTO_USER=y/m).
>
> We should change the default priority.
We had an patch exactly doing this but depending on the SoC the default
prio may valid since the CAAM is used on ARMv7 and ARMv8 NXP SoCs. To
not cause any regression we went this way.
Regards,
Marco
>
> Thanks,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] crypto: caam - enable hash api only on ARM platforms per default
2024-07-09 8:54 ` Marco Felsch
@ 2024-07-09 20:11 ` Herbert Xu
2024-07-10 6:51 ` Marco Felsch
0 siblings, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2024-07-09 20:11 UTC (permalink / raw)
To: Marco Felsch
Cc: Horia Geanta, Pankaj Gupta, Gaurav Jain, kernel, linux-crypto,
linux-kernel
On Tue, Jul 09, 2024 at 10:54:54AM +0200, Marco Felsch wrote:
>
> We had an patch exactly doing this but depending on the SoC the default
> prio may valid since the CAAM is used on ARMv7 and ARMv8 NXP SoCs. To
> not cause any regression we went this way.
I don't understand. Why not just set the priority depending on
IS_ENABLED(CONFIG_ARM)? That way it's strictly better than the
Kconfig patch:
1) If the driver is indeed slower then you'd have achieved the same
result of preferring the non-driver algorithm.
2) If the driver ends up being faster then at least the admin can
adjust the priorities.
Or perhaps your Kconfig option should set the priority.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] crypto: caam - enable hash api only on ARM platforms per default
2024-07-09 20:11 ` Herbert Xu
@ 2024-07-10 6:51 ` Marco Felsch
0 siblings, 0 replies; 6+ messages in thread
From: Marco Felsch @ 2024-07-10 6:51 UTC (permalink / raw)
To: Herbert Xu
Cc: Horia Geanta, Pankaj Gupta, Gaurav Jain, kernel, linux-crypto,
linux-kernel
On 24-07-10, Herbert Xu wrote:
> On Tue, Jul 09, 2024 at 10:54:54AM +0200, Marco Felsch wrote:
> >
> > We had an patch exactly doing this but depending on the SoC the default
> > prio may valid since the CAAM is used on ARMv7 and ARMv8 NXP SoCs. To
> > not cause any regression we went this way.
>
> I don't understand. Why not just set the priority depending on
> IS_ENABLED(CONFIG_ARM)?
Argh.. you're right. I had something other in my mind, sry.
> That way it's strictly better than the Kconfig patch:
>
> 1) If the driver is indeed slower then you'd have achieved the same
> result of preferring the non-driver algorithm.
>
> 2) If the driver ends up being faster then at least the admin can
> adjust the priorities.
>
> Or perhaps your Kconfig option should set the priority.
NACK since no admin knows the prios. I will go with the "IS_ENABLED"
solution, thank you!
Regards,
Marco
> Cheers,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-10 7:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26 15:57 [PATCH] crypto: caam - enable hash api only on ARM platforms per default Marco Felsch
2024-07-05 9:39 ` Horia Geanta
2024-07-05 11:01 ` Herbert Xu
2024-07-09 8:54 ` Marco Felsch
2024-07-09 20:11 ` Herbert Xu
2024-07-10 6:51 ` Marco Felsch
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®