Skip to contentSkip to conversation

crypto: p10-aes-gcm - remove duplicate include header

PATCH In review [email protected] 4 participants 8 messages Mar 14, 2023 – Mar 24, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: p10-aes-gcm - remove duplicate include header

From: Ye Xingchen <[email protected]>

crypto/algapi.h is included more than once.

---
 arch/powerpc/crypto/aes-gcm-p10-glue.c | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/crypto/aes-gcm-p10-glue.c +0 -1
index c95f5b7cc456..1533c8cdd26f 100644
@@ -8,7 +8,6 @@
 #include <asm/unaligned.h>
 #include <asm/simd.h>
 #include <asm/switch_to.h>
-#include <crypto/algapi.h>
 #include <crypto/aes.h>
 #include <crypto/algapi.h>
 #include <crypto/b128ops.h>
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Le 14/03/2023 à 09:31, [email protected] a écrit :

Quoted 5 lines

From: Ye Xingchen <[email protected]>

crypto/algapi.h is included more than once.

You already sent this patch, see
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/[email protected]/

Any reason for resending ?

Christophe

Quoted 16 lines
---
  arch/powerpc/crypto/aes-gcm-p10-glue.c | 1 -
  1 file changed, 1 deletion(-)
arch/powerpc/crypto/aes-gcm-p10-glue.c +0 -1
index c95f5b7cc456..1533c8cdd26f 100644
@@ -8,7 +8,6 @@
  #include <asm/unaligned.h>
  #include <asm/simd.h>
  #include <asm/switch_to.h>
-#include <crypto/algapi.h>
  #include <crypto/aes.h>
  #include <crypto/algapi.h>
  #include <crypto/b128ops.h>
maintainer
#2 lore raw
Quoted 2 lines · Christophe Leroy

Any reason for resending ?

The p10 patches were reverted, and have only just been re-instated.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#3 lore raw
Quoted 5 lines · Herbert Xu
Quoted 2 lines · Christophe Leroy

Any reason for resending ?

The p10 patches were reverted, and have only just been re-instated.

Hmm. Seems none of them were ever Cc'ed to linuxppc-dev. So this is the first I've seen of them.

We seem to have two almost identical copies of ppc-xlate.pl now :/

  $ find . -name ppc-xlate.pl
  ./arch/powerpc/crypto/ppc-xlate.pl
  ./drivers/crypto/vmx/ppc-xlate.pl

And notably the new one doesn't have the changes from commit 505ea33089dc ("powerpc/64: Add big-endian ELFv2 flavour to crypto VMX asm generation"), so that probably breaks the build for some configs.

There's also now two new .pl files with identical names, but different content to the copies in drivers/crypto/vmx:

  $ find . -name "*-ppc.pl" | xargs wc -l
     370 ./arch/powerpc/crypto/ghashp8-ppc.pl
     585 ./arch/powerpc/crypto/aesp8-ppc.pl
     243 ./drivers/crypto/vmx/ghashp8-ppc.pl
    3846 ./drivers/crypto/vmx/aesp8-ppc.pl
    5044 total

Also PPC_MODULE_FEATURE_P10 should be in arch/powerpc/include/asm/cpufeature.h.

And CRYPTO_AES_GCM_P10 should not depend on POWER10_CPU, that restricts it to being built when the kernel is built to run *only* on Power10, which basically no one does, certainly no distro.

The code needs to detect at runtime if it's on Power10, and only register itself if so.

cheers

maintainer
#4 lore raw
Quoted 3 lines · Michael Ellerman

Hmm. Seems none of them were ever Cc'ed to linuxppc-dev. So this is the first I've seen of them.

Sorry, I didn't know that you weren't aware of this change. I will be more careful with these ppc patches in future.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#5 lore raw
Quoted 7 lines · Herbert Xu
Quoted 3 lines · Michael Ellerman

Hmm. Seems none of them were ever Cc'ed to linuxppc-dev. So this is the first I've seen of them.

Sorry, I didn't know that you weren't aware of this change. I will be more careful with these ppc patches in future.

No worries, not your fault. My comments were mostly intended for Danny.

Although one question I do have for you is what rules, if any, do we have for deciding whether crypto code goes in drivers/crypto vs arch/*/crypto?

On powerpc we have some in arch/powerpc/crypto and some in drivers/crypto/vmx, and I don't really know why it's split that way.

It seems like drivers/crypto is where non-CPU crypto accelerator drivers go, but then it also has lots of in-CPU crypto code as well AFAICS.

I wonder if we should move drivers/crypto/vmx into arch/powerpc/crypto, so that all the powerpc CRYPTOGAMS code is in one place. That would help to clean up some of the duplication of perl scripts we now have.

cheers

maintainer
#6 lore raw
Quoted 4 lines · Michael Ellerman

Although one question I do have for you is what rules, if any, do we have for deciding whether crypto code goes in drivers/crypto vs arch/*/crypto?

If it's on the CPU then it should probably live under arch. Yes there have been exceptions in the past, with VIA PadLock on x86 and vmx on PPC being prime examples.

Quoted 3 lines

I wonder if we should move drivers/crypto/vmx into arch/powerpc/crypto, so that all the powerpc CRYPTOGAMS code is in one place. That would help to clean up some of the duplication of perl scripts we now have.

Yes I think that would certainly make sense.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
maintainer
#7 lore raw
In reply to [email protected]
Quoted 8 lines · On Tue, Mar 14, 2023 at 04:31:51PM +0800, [email protected] wrote:

From: Ye Xingchen <[email protected]>

crypto/algapi.h is included more than once.

---
 arch/powerpc/crypto/aes-gcm-p10-glue.c | 1 -
 1 file changed, 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt