linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/7] Enabling VMX module for PPC64
@ 2015-02-05 17:21 Leonidas S. Barbosa
  2015-02-05 21:58 ` Paul Bolle
  0 siblings, 1 reply; 3+ messages in thread
From: Leonidas S. Barbosa @ 2015-02-05 17:21 UTC (permalink / raw)
  To: Herbert Xu, linux-crypto, linux-kernel

This patch enables VMX module in PPC64.

Signed-off-by: Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
---
 drivers/crypto/Kconfig      | 12 ++++++++++++
 drivers/crypto/Makefile     |  1 +
 drivers/crypto/vmx/Kconfig  |  9 +++++++++
 drivers/crypto/vmx/Makefile | 21 +++++++++++++++++++++
 4 files changed, 43 insertions(+)
 create mode 100644 drivers/crypto/vmx/Kconfig
 create mode 100644 drivers/crypto/vmx/Makefile

diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 2fb0fdf..979cbff 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -436,4 +436,16 @@ config CRYPTO_DEV_QCE
 	  hardware. To compile this driver as a module, choose M here. The
 	  module will be called qcrypto.
 
+config CRYPTO_DEV_VMX
+	bool "Support for VMX cryptographic acceleration instructions"
+	depends on PPC64
+	default n
+	help
+	  Support for VMX cryptographic acceleration instructions.
+
+if CRYPTO_DEV_VMX
+	source "drivers/crypto/vmx/Kconfig"
+endif
+
 endif # CRYPTO_HW
+
diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
index 3924f93..20a7127 100644
--- a/drivers/crypto/Makefile
+++ b/drivers/crypto/Makefile
@@ -25,3 +25,4 @@ obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o
 obj-$(CONFIG_CRYPTO_DEV_UX500) += ux500/
 obj-$(CONFIG_CRYPTO_DEV_QAT) += qat/
 obj-$(CONFIG_CRYPTO_DEV_QCE) += qce/
+obj-$(CONFIG_CRYPTO_DEV_VMX) += vmx/
diff --git a/drivers/crypto/vmx/Kconfig b/drivers/crypto/vmx/Kconfig
new file mode 100644
index 0000000..6728864
--- /dev/null
+++ b/drivers/crypto/vmx/Kconfig
@@ -0,0 +1,9 @@
+config CRYPTO_DEV_VMX_ENCRYPT
+	tristate "Encryption acceleration support on P8 CPU"
+	depends on PPC64
+	default y
+	help 
+	  Support for VMX cryptographic acceleration instructions on Power8 CPU.
+	  This module supports acceleration for AES and GHASH in hardware. If you
+	  choose 'M' here, this module will be called vmx-crypto.
+	  
diff --git a/drivers/crypto/vmx/Makefile b/drivers/crypto/vmx/Makefile
new file mode 100644
index 0000000..8898ce6
--- /dev/null
+++ b/drivers/crypto/vmx/Makefile
@@ -0,0 +1,21 @@
+obj-$(CONFIG_CRYPTO_DEV_VMX_ENCRYPT) += vmx-crypto.o
+vmx-crypto-objs := vmx.o aesp8-ppc.o ghashp8-ppc.o aes.o aes_cbc.o aes_ctr.o ghash.o
+
+ifeq ($(CONFIG_PPC64),y)
+ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
+TARGET := linux-ppc64le
+else
+TARGET := linux-pcc64
+endif
+endif
+
+quiet_cmd_perl = PERL $@
+      cmd_perl = $(PERL) $(<) $(TARGET) > $(@)
+
+$(src)/aesp8-ppc.S: $(src)/aesp8-ppc.pl
+	$(call cmd,perl)
+  
+$(src)/ghashp8-ppc.S: $(src)/ghashp8-ppc.pl
+	$(call cmd,perl)
+
+.PRECIOUS: $(obj)/aesp8-ppc.S $(obj)/ghashp8-ppc.S
-- 
2.1.0


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

* Re: [PATCH 7/7] Enabling VMX module for PPC64
  2015-02-05 17:21 [PATCH 7/7] Enabling VMX module for PPC64 Leonidas S. Barbosa
@ 2015-02-05 21:58 ` Paul Bolle
  2015-02-06 16:41   ` Leonidas S. Barbosa
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Bolle @ 2015-02-05 21:58 UTC (permalink / raw)
  To: Leonidas S. Barbosa; +Cc: Herbert Xu, linux-crypto, linux-kernel

On Thu, 2015-02-05 at 15:21 -0200, Leonidas S. Barbosa wrote:
> This patch enables VMX module in PPC64.
> 
> Signed-off-by: Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
> ---
>  drivers/crypto/Kconfig      | 12 ++++++++++++
>  drivers/crypto/Makefile     |  1 +
>  drivers/crypto/vmx/Kconfig  |  9 +++++++++
>  drivers/crypto/vmx/Makefile | 21 +++++++++++++++++++++
>  4 files changed, 43 insertions(+)
>  create mode 100644 drivers/crypto/vmx/Kconfig
>  create mode 100644 drivers/crypto/vmx/Makefile
> 
> diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
> index 2fb0fdf..979cbff 100644
> --- a/drivers/crypto/Kconfig
> +++ b/drivers/crypto/Kconfig
> @@ -436,4 +436,16 @@ config CRYPTO_DEV_QCE
>  	  hardware. To compile this driver as a module, choose M here. The
>  	  module will be called qcrypto.
>  
> +config CRYPTO_DEV_VMX
> +	bool "Support for VMX cryptographic acceleration instructions"
> +	depends on PPC64
> +	default n
> +	help
> +	  Support for VMX cryptographic acceleration instructions.
> +
> +if CRYPTO_DEV_VMX
> +	source "drivers/crypto/vmx/Kconfig"
> +endif
> +
>  endif # CRYPTO_HW
> +

Unneeded extra line.

> diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
> index 3924f93..20a7127 100644
> --- a/drivers/crypto/Makefile
> +++ b/drivers/crypto/Makefile
> @@ -25,3 +25,4 @@ obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o
>  obj-$(CONFIG_CRYPTO_DEV_UX500) += ux500/
>  obj-$(CONFIG_CRYPTO_DEV_QAT) += qat/
>  obj-$(CONFIG_CRYPTO_DEV_QCE) += qce/
> +obj-$(CONFIG_CRYPTO_DEV_VMX) += vmx/
> diff --git a/drivers/crypto/vmx/Kconfig b/drivers/crypto/vmx/Kconfig
> new file mode 100644
> index 0000000..6728864
> --- /dev/null
> +++ b/drivers/crypto/vmx/Kconfig
> @@ -0,0 +1,9 @@
> +config CRYPTO_DEV_VMX_ENCRYPT
> +	tristate "Encryption acceleration support on P8 CPU"
> +	depends on PPC64

The net effect of the "if CRYPTO_DEV_VMX" wrapper round the source-ing
of this file is that CRYPTO_DEV_VMX_ENCRYPT depends on CRYPTO_DEV_VMX.
That makes depending on PPC64 superfluous here. You might as well make
this symbol depend on CRYPTO_DEV_VMX and drop the "if CRYPTO_DEV_VMX"
wrapper.

> +	default y
> +	help 
> +	  Support for VMX cryptographic acceleration instructions on Power8 CPU.
> +	  This module supports acceleration for AES and GHASH in hardware. If you
> +	  choose 'M' here, this module will be called vmx-crypto.
> +	  

Trailing line of whitespace only.

> diff --git a/drivers/crypto/vmx/Makefile b/drivers/crypto/vmx/Makefile
> new file mode 100644
> index 0000000..8898ce6
> --- /dev/null
> +++ b/drivers/crypto/vmx/Makefile
> @@ -0,0 +1,21 @@
> +obj-$(CONFIG_CRYPTO_DEV_VMX_ENCRYPT) += vmx-crypto.o
> +vmx-crypto-objs := vmx.o aesp8-ppc.o ghashp8-ppc.o aes.o aes_cbc.o aes_ctr.o ghash.o
> +
> +ifeq ($(CONFIG_PPC64),y)

Can this test ever fail?

> +ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
> +TARGET := linux-ppc64le
> +else
> +TARGET := linux-pcc64
> +endif
> +endif
> +
> +quiet_cmd_perl = PERL $@
> +      cmd_perl = $(PERL) $(<) $(TARGET) > $(@)
> +
> +$(src)/aesp8-ppc.S: $(src)/aesp8-ppc.pl
> +	$(call cmd,perl)
> +  
> +$(src)/ghashp8-ppc.S: $(src)/ghashp8-ppc.pl
> +	$(call cmd,perl)
> +
> +.PRECIOUS: $(obj)/aesp8-ppc.S $(obj)/ghashp8-ppc.S


Paul Bolle


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

* Re: [PATCH 7/7] Enabling VMX module for PPC64
  2015-02-05 21:58 ` Paul Bolle
@ 2015-02-06 16:41   ` Leonidas S. Barbosa
  0 siblings, 0 replies; 3+ messages in thread
From: Leonidas S. Barbosa @ 2015-02-06 16:41 UTC (permalink / raw)
  To: Paul Bolle; +Cc: Herbert Xu, linux-crypto, linux-kernel

Thanks for the advices Paul.
Resending patch set as V2.

> > +vmx-crypto-objs := vmx.o aesp8-ppc.o ghashp8-ppc.o aes.o aes_cbc.o aes_ctr.o ghash.o
> > +
> > +ifeq ($(CONFIG_PPC64),y)
> 
> Can this test ever fail?
In fact we don't need this first IF, since it already depends on
PPC64.


---
Leonidas.


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

end of thread, other threads:[~2015-02-06 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05 17:21 [PATCH 7/7] Enabling VMX module for PPC64 Leonidas S. Barbosa
2015-02-05 21:58 ` Paul Bolle
2015-02-06 16:41   ` Leonidas S. Barbosa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).