diff mbox series

aes-gcm-p10: Use the correct bit to test for P10

Message ID 20241106121019.25629-1-msuchanek@suse.de (mailing list archive)
State Handled Elsewhere
Headers show
Series aes-gcm-p10: Use the correct bit to test for P10 | expand

Commit Message

Michal Suchánek Nov. 6, 2024, 12:09 p.m. UTC
A hwcap feature bit is passed to cpu_has_feature, resulting in testing
for CPU_FTR_MMCRA instead of the 3.1 platform revision.

Fixes: c954b252dee9 ("crypto: powerpc/p10-aes-gcm - Register modules as SIMD")
Reported-by: Nicolai Stange <nstange@suse.com>
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 arch/powerpc/crypto/aes-gcm-p10-glue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Ellerman Nov. 7, 2024, 11:43 a.m. UTC | #1
Michal Suchanek <msuchanek@suse.de> writes:
> A hwcap feature bit is passed to cpu_has_feature, resulting in testing
> for CPU_FTR_MMCRA instead of the 3.1 platform revision.

Ouch. Good find.

Notably all IBM Power CPUs have MMCRA set, so the feature test is
essentially a nop.

> Fixes: c954b252dee9 ("crypto: powerpc/p10-aes-gcm - Register modules as SIMD")

^ which is only in linux-next so no stable tag needed.

> Reported-by: Nicolai Stange <nstange@suse.com>
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> ---
>  arch/powerpc/crypto/aes-gcm-p10-glue.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)

cheers

> diff --git a/arch/powerpc/crypto/aes-gcm-p10-glue.c b/arch/powerpc/crypto/aes-gcm-p10-glue.c
> index e52629334cf8..1f8b67775658 100644
> --- a/arch/powerpc/crypto/aes-gcm-p10-glue.c
> +++ b/arch/powerpc/crypto/aes-gcm-p10-glue.c
> @@ -414,7 +414,7 @@ static int __init p10_init(void)
>  {
>  	int ret;
>  
> -	if (!cpu_has_feature(PPC_FEATURE2_ARCH_3_1))
> +	if (!cpu_has_feature(CPU_FTR_ARCH_31))
>  		return 0;
>  
>  	ret = simd_register_aeads_compat(gcm_aes_algs,
> -- 
> 2.46.1
Herbert Xu Nov. 15, 2024, 11:58 a.m. UTC | #2
On Wed, Nov 06, 2024 at 01:09:33PM +0100, Michal Suchanek wrote:
> A hwcap feature bit is passed to cpu_has_feature, resulting in testing
> for CPU_FTR_MMCRA instead of the 3.1 platform revision.
> 
> Fixes: c954b252dee9 ("crypto: powerpc/p10-aes-gcm - Register modules as SIMD")
> Reported-by: Nicolai Stange <nstange@suse.com>
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> ---
>  arch/powerpc/crypto/aes-gcm-p10-glue.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/arch/powerpc/crypto/aes-gcm-p10-glue.c b/arch/powerpc/crypto/aes-gcm-p10-glue.c
index e52629334cf8..1f8b67775658 100644
--- a/arch/powerpc/crypto/aes-gcm-p10-glue.c
+++ b/arch/powerpc/crypto/aes-gcm-p10-glue.c
@@ -414,7 +414,7 @@  static int __init p10_init(void)
 {
 	int ret;
 
-	if (!cpu_has_feature(PPC_FEATURE2_ARCH_3_1))
+	if (!cpu_has_feature(CPU_FTR_ARCH_31))
 		return 0;
 
 	ret = simd_register_aeads_compat(gcm_aes_algs,