All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading
@ 2016-08-04  6:38 Anton Blanchard
  2016-08-04  8:38   ` Michael Ellerman
  2016-08-09 11:26 ` Michael Ellerman
  0 siblings, 2 replies; 8+ messages in thread
From: Anton Blanchard @ 2016-08-04  6:38 UTC (permalink / raw)
  To: benh, paulus, mpe, herbert, davem; +Cc: alastair, linuxppc-dev, linux-crypto

From: Anton Blanchard <anton@samba.org>

This patch utilises the GENERIC_CPU_AUTOPROBE infrastructure
to automatically load the crc32c-vpmsum module if the CPU supports
it.

Signed-off-by: Anton Blanchard <anton@samba.org>
---
 arch/powerpc/crypto/crc32c-vpmsum_glue.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/crypto/crc32c-vpmsum_glue.c b/arch/powerpc/crypto/crc32c-vpmsum_glue.c
index bfe3d37..9fa046d 100644
--- a/arch/powerpc/crypto/crc32c-vpmsum_glue.c
+++ b/arch/powerpc/crypto/crc32c-vpmsum_glue.c
@@ -4,6 +4,7 @@
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
+#include <linux/cpufeature.h>
 #include <asm/switch_to.h>
 
 #define CHKSUM_BLOCK_SIZE	1
@@ -157,7 +158,7 @@ static void __exit crc32c_vpmsum_mod_fini(void)
 	crypto_unregister_shash(&alg);
 }
 
-module_init(crc32c_vpmsum_mod_init);
+module_cpu_feature_match(PPC_MODULE_FEATURE_VEC_CRYPTO, crc32c_vpmsum_mod_init);
 module_exit(crc32c_vpmsum_mod_fini);
 
 MODULE_AUTHOR("Anton Blanchard <anton@samba.org>");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading
  2016-08-04  6:38 [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading Anton Blanchard
@ 2016-08-04  8:38   ` Michael Ellerman
  2016-08-09 11:26 ` Michael Ellerman
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2016-08-04  8:38 UTC (permalink / raw)
  To: Anton Blanchard, benh, paulus, herbert, davem
  Cc: linuxppc-dev, linux-crypto, alastair

Anton Blanchard <anton@ozlabs.org> writes:

> From: Anton Blanchard <anton@samba.org>
>
> This patch utilises the GENERIC_CPU_AUTOPROBE infrastructure
> to automatically load the crc32c-vpmsum module if the CPU supports
> it.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>  arch/powerpc/crypto/crc32c-vpmsum_glue.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/crypto/crc32c-vpmsum_glue.c b/arch/powerpc/crypto/crc32c-vpmsum_glue.c
> index bfe3d37..9fa046d 100644
> --- a/arch/powerpc/crypto/crc32c-vpmsum_glue.c
> +++ b/arch/powerpc/crypto/crc32c-vpmsum_glue.c
> @@ -4,6 +4,7 @@
>  #include <linux/module.h>
>  #include <linux/string.h>
>  #include <linux/kernel.h>
> +#include <linux/cpufeature.h>
>  #include <asm/switch_to.h>
>  
>  #define CHKSUM_BLOCK_SIZE	1
> @@ -157,7 +158,7 @@ static void __exit crc32c_vpmsum_mod_fini(void)
>  	crypto_unregister_shash(&alg);
>  }
>  
> -module_init(crc32c_vpmsum_mod_init);
> +module_cpu_feature_match(PPC_MODULE_FEATURE_VEC_CRYPTO, crc32c_vpmsum_mod_init);

Is VEC_CRYPTO the right feature?

That's new power8 crypto stuff.

I thought this only used VMX? (but I haven't looked closely)

cheers

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading
@ 2016-08-04  8:38   ` Michael Ellerman
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2016-08-04  8:38 UTC (permalink / raw)
  To: Anton Blanchard, benh, paulus, herbert, davem
  Cc: alastair, linuxppc-dev, linux-crypto

Anton Blanchard <anton@ozlabs.org> writes:

> From: Anton Blanchard <anton@samba.org>
>
> This patch utilises the GENERIC_CPU_AUTOPROBE infrastructure
> to automatically load the crc32c-vpmsum module if the CPU supports
> it.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>  arch/powerpc/crypto/crc32c-vpmsum_glue.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/crypto/crc32c-vpmsum_glue.c b/arch/powerpc/crypto/crc32c-vpmsum_glue.c
> index bfe3d37..9fa046d 100644
> --- a/arch/powerpc/crypto/crc32c-vpmsum_glue.c
> +++ b/arch/powerpc/crypto/crc32c-vpmsum_glue.c
> @@ -4,6 +4,7 @@
>  #include <linux/module.h>
>  #include <linux/string.h>
>  #include <linux/kernel.h>
> +#include <linux/cpufeature.h>
>  #include <asm/switch_to.h>
>  
>  #define CHKSUM_BLOCK_SIZE	1
> @@ -157,7 +158,7 @@ static void __exit crc32c_vpmsum_mod_fini(void)
>  	crypto_unregister_shash(&alg);
>  }
>  
> -module_init(crc32c_vpmsum_mod_init);
> +module_cpu_feature_match(PPC_MODULE_FEATURE_VEC_CRYPTO, crc32c_vpmsum_mod_init);

Is VEC_CRYPTO the right feature?

That's new power8 crypto stuff.

I thought this only used VMX? (but I haven't looked closely)

cheers

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading
  2016-08-04  8:38   ` Michael Ellerman
@ 2016-08-04 10:26     ` Anton Blanchard
  -1 siblings, 0 replies; 8+ messages in thread
From: Anton Blanchard @ 2016-08-04 10:26 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: herbert, paulus, linux-crypto, alastair, linuxppc-dev, davem

Hi Michael,

> Is VEC_CRYPTO the right feature?
> 
> That's new power8 crypto stuff.

The vpmsum* instructions are part of the same pipeline as the vcipher*
instructions, introduced in POWER8.

> I thought this only used VMX? (but I haven't looked closely)

Yes, vcipher* and vpmsum* are VMX instructions.

Anton

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading
@ 2016-08-04 10:26     ` Anton Blanchard
  0 siblings, 0 replies; 8+ messages in thread
From: Anton Blanchard @ 2016-08-04 10:26 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Anton Blanchard, benh, paulus, herbert, davem, alastair,
	linuxppc-dev, linux-crypto

Hi Michael,

> Is VEC_CRYPTO the right feature?
> 
> That's new power8 crypto stuff.

The vpmsum* instructions are part of the same pipeline as the vcipher*
instructions, introduced in POWER8.

> I thought this only used VMX? (but I haven't looked closely)

Yes, vcipher* and vpmsum* are VMX instructions.

Anton

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading
  2016-08-04 10:26     ` Anton Blanchard
  (?)
@ 2016-08-05  6:51     ` Michael Ellerman
  2016-08-08 15:22       ` Herbert Xu
  -1 siblings, 1 reply; 8+ messages in thread
From: Michael Ellerman @ 2016-08-05  6:51 UTC (permalink / raw)
  To: Anton Blanchard
  Cc: Anton Blanchard, benh, paulus, herbert, davem, alastair,
	linuxppc-dev, linux-crypto

Anton Blanchard <anton@samba.org> writes:

> Hi Michael,
>
>> Is VEC_CRYPTO the right feature?
>> 
>> That's new power8 crypto stuff.
>
> The vpmsum* instructions are part of the same pipeline as the vcipher*
> instructions, introduced in POWER8.

OK.

>> I thought this only used VMX? (but I haven't looked closely)
>
> Yes, vcipher* and vpmsum* are VMX instructions.

Right. The confusion is that we have PPC_FEATURE_HAS_ALTIVEC, but that
doesn't mean we have *these* VMX instructions.

This is actually an arch/powerpc patch, so I'll merge it unless Herbert
objects.

cheers

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading
  2016-08-05  6:51     ` Michael Ellerman
@ 2016-08-08 15:22       ` Herbert Xu
  0 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2016-08-08 15:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: anton, anton, benh, paulus, davem, alastair, linuxppc-dev, linux-crypto

Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> This is actually an arch/powerpc patch, so I'll merge it unless Herbert
> objects.

It's fine with me.

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] 8+ messages in thread

* Re: crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading
  2016-08-04  6:38 [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading Anton Blanchard
  2016-08-04  8:38   ` Michael Ellerman
@ 2016-08-09 11:26 ` Michael Ellerman
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2016-08-09 11:26 UTC (permalink / raw)
  To: Anton Blanchard, benh, paulus, herbert, davem
  Cc: linuxppc-dev, linux-crypto, alastair

On Thu, 2016-04-08 at 06:38:15 UTC, Anton Blanchard wrote:
> From: Anton Blanchard <anton@samba.org>
> 
> This patch utilises the GENERIC_CPU_AUTOPROBE infrastructure
> to automatically load the crc32c-vpmsum module if the CPU supports
> it.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/d2cf5be07ff7c7cde8bef8551a

cheers

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-09 11:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-04  6:38 [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading Anton Blanchard
2016-08-04  8:38 ` Michael Ellerman
2016-08-04  8:38   ` Michael Ellerman
2016-08-04 10:26   ` Anton Blanchard
2016-08-04 10:26     ` Anton Blanchard
2016-08-05  6:51     ` Michael Ellerman
2016-08-08 15:22       ` Herbert Xu
2016-08-09 11:26 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.