diff mbox series

powerpc/crypto: Fix aes-gcm-p10 build when VSX=n

Message ID 20230515124731.122962-1-mpe@ellerman.id.au (mailing list archive)
State Accepted
Commit 8133a3f0aa66ed3d7d974c89ac6aca6fe6cec837
Headers show
Series powerpc/crypto: Fix aes-gcm-p10 build when VSX=n | expand

Commit Message

Michael Ellerman May 15, 2023, 12:47 p.m. UTC
When VSX is disabled, eg. microwatt_defconfig, the build fails with:

  In function ‘enable_kernel_vsx’,
      inlined from ‘vsx_begin’ at arch/powerpc/crypto/aes-gcm-p10-glue.c:68:2,
      inlined from ‘p10_aes_gcm_crypt.constprop’ at arch/powerpc/crypto/aes-gcm-p10-glue.c:244:2:
  ...
  arch/powerpc/include/asm/switch_to.h:86:9: note: in expansion of macro ‘BUILD_BUG’
     86 |         BUILD_BUG();
        |         ^~~~~~~~~

Fix it by making the p10-aes-gcm code depend on VSX.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/crypto/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joel Stanley May 17, 2023, 1:51 a.m. UTC | #1
On Mon, 15 May 2023 at 12:48, Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> When VSX is disabled, eg. microwatt_defconfig, the build fails with:
>
>   In function ‘enable_kernel_vsx’,
>       inlined from ‘vsx_begin’ at arch/powerpc/crypto/aes-gcm-p10-glue.c:68:2,
>       inlined from ‘p10_aes_gcm_crypt.constprop’ at arch/powerpc/crypto/aes-gcm-p10-glue.c:244:2:
>   ...
>   arch/powerpc/include/asm/switch_to.h:86:9: note: in expansion of macro ‘BUILD_BUG’
>      86 |         BUILD_BUG();
>         |         ^~~~~~~~~
>
> Fix it by making the p10-aes-gcm code depend on VSX.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  arch/powerpc/crypto/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/crypto/Kconfig b/arch/powerpc/crypto/Kconfig
> index 7113f9355165..ad1872518992 100644
> --- a/arch/powerpc/crypto/Kconfig
> +++ b/arch/powerpc/crypto/Kconfig
> @@ -96,7 +96,7 @@ config CRYPTO_AES_PPC_SPE
>
>  config CRYPTO_AES_GCM_P10
>         tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)"
> -       depends on PPC64 && CPU_LITTLE_ENDIAN
> +       depends on PPC64 && CPU_LITTLE_ENDIAN && VSX

VSX depends on PPC_BOOK3S_64 but I guess there's no harm in keeping
the PPC64 here?

>         select CRYPTO_LIB_AES
>         select CRYPTO_ALGAPI
>         select CRYPTO_AEAD
> --
> 2.40.1
>
Michael Ellerman May 25, 2023, 2:18 p.m. UTC | #2
Joel Stanley <joel@jms.id.au> writes:
> On Mon, 15 May 2023 at 12:48, Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> When VSX is disabled, eg. microwatt_defconfig, the build fails with:
>>
>>   In function ‘enable_kernel_vsx’,
>>       inlined from ‘vsx_begin’ at arch/powerpc/crypto/aes-gcm-p10-glue.c:68:2,
>>       inlined from ‘p10_aes_gcm_crypt.constprop’ at arch/powerpc/crypto/aes-gcm-p10-glue.c:244:2:
>>   ...
>>   arch/powerpc/include/asm/switch_to.h:86:9: note: in expansion of macro ‘BUILD_BUG’
>>      86 |         BUILD_BUG();
>>         |         ^~~~~~~~~
>>
>> Fix it by making the p10-aes-gcm code depend on VSX.
>>
>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
> Reviewed-by: Joel Stanley <joel@jms.id.au>
>
>> ---
>>  arch/powerpc/crypto/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/crypto/Kconfig b/arch/powerpc/crypto/Kconfig
>> index 7113f9355165..ad1872518992 100644
>> --- a/arch/powerpc/crypto/Kconfig
>> +++ b/arch/powerpc/crypto/Kconfig
>> @@ -96,7 +96,7 @@ config CRYPTO_AES_PPC_SPE
>>
>>  config CRYPTO_AES_GCM_P10
>>         tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)"
>> -       depends on PPC64 && CPU_LITTLE_ENDIAN
>> +       depends on PPC64 && CPU_LITTLE_ENDIAN && VSX
>
> VSX depends on PPC_BOOK3S_64 but I guess there's no harm in keeping
> the PPC64 here?

I guess it's somewhat redundant. But also harmless, and possibly clearer
for folks who don't have the ingrained knowledge that VSX is 64-bit
Book3S only. So yeah I think I'll leave it as-is.

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/crypto/Kconfig b/arch/powerpc/crypto/Kconfig
index 7113f9355165..ad1872518992 100644
--- a/arch/powerpc/crypto/Kconfig
+++ b/arch/powerpc/crypto/Kconfig
@@ -96,7 +96,7 @@  config CRYPTO_AES_PPC_SPE
 
 config CRYPTO_AES_GCM_P10
 	tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)"
-	depends on PPC64 && CPU_LITTLE_ENDIAN
+	depends on PPC64 && CPU_LITTLE_ENDIAN && VSX
 	select CRYPTO_LIB_AES
 	select CRYPTO_ALGAPI
 	select CRYPTO_AEAD