Skip to contentSkip to conversation

crypto:vmx: Move ppc vmx diirectory to arch/powerpc/crypto.

PATCH In review Danny Tsen 2 participants 3 messages Jan 2, 2024 – Jan 26, 2024

Subsystems (3)
lore
Share & tools
lore

Danny Tsen

author
#0 lore raw

PATCH 1/1 crypto:vmx: Move ppc vmx diirectory to arch/powerpc/crypto.

Relocate all crypto files in vmx driver to arch/powerpc/crypto directory and remove vmx directory.

drivers/crypto/vmx/aes.c rename to arch/powerpc/crypto/aes.c drivers/crypto/vmx/aes_cbc.c rename to arch/powerpc/crypto/aes_cbc.c drivers/crypto/vmx/aes_ctr.c rename to arch/powerpc/crypto/aes_ctr.c drivers/crypto/vmx/aes_xts.c rename to arch/powerpc/crypto/aes_xts.c drivers/crypto/vmx/aesp8-ppc.h rename to arch/powerpc/crypto/aesp8-ppc.h drivers/crypto/vmx/aesp8-ppc.pl rename to arch/powerpc/crypto/aesp8-ppc.pl drivers/crypto/vmx/ghash.c rename to arch/powerpc/crypto/ghash.c drivers/crypto/vmx/ghashp8-ppc.pl rename to arch/powerpc/crypto/ghashp8-ppc.pl drivers/crypto/vmx/vmx.c rename to arch/powerpc/crypto/vmx.c

deleted files:
drivers/crypto/vmx/Makefile
drivers/crypto/vmx/Kconfig
drivers/crypto/vmx/ppc-xlate.pl

This patch has been tested has passed the selftest. The patch is also tested with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled.

---
 arch/powerpc/crypto/Kconfig                   |  20 ++
 arch/powerpc/crypto/Makefile                  |  20 +-
 .../crypto/vmx => arch/powerpc/crypto}/aes.c  |   0
 .../vmx => arch/powerpc/crypto}/aes_cbc.c     |   0
 .../vmx => arch/powerpc/crypto}/aes_ctr.c     |   0
 .../vmx => arch/powerpc/crypto}/aes_xts.c     |   0
 .../vmx => arch/powerpc/crypto}/aesp8-ppc.h   |   0
 .../vmx => arch/powerpc/crypto}/aesp8-ppc.pl  |   0
 .../vmx => arch/powerpc/crypto}/ghash.c       |   0
 .../powerpc/crypto}/ghashp8-ppc.pl            |   0
 .../crypto/vmx => arch/powerpc/crypto}/vmx.c  |   0
 drivers/crypto/Kconfig                        |  14 +-
 drivers/crypto/Makefile                       |   2 +-
 drivers/crypto/vmx/.gitignore                 |   3 -
 drivers/crypto/vmx/Kconfig                    |  14 --
 drivers/crypto/vmx/Makefile                   |  23 --
 drivers/crypto/vmx/ppc-xlate.pl               | 231 ------------------
 17 files changed, 46 insertions(+), 281 deletions(-)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes_cbc.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes_ctr.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes_xts.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aesp8-ppc.h (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aesp8-ppc.pl (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/ghash.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/ghashp8-ppc.pl (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/vmx.c (100%)
 delete mode 100644 drivers/crypto/vmx/.gitignore
 delete mode 100644 drivers/crypto/vmx/Kconfig
 delete mode 100644 drivers/crypto/vmx/Makefile
 delete mode 100644 drivers/crypto/vmx/ppc-xlate.pl
arch/powerpc/crypto/Kconfig +20 -0
index 6fc2248ca561..1e201b7ae2fc 100644
@@ -137,4 +137,24 @@ config CRYPTO_POLY1305_P10
 	  - Power10 or later
 	  - Little-endian
 
+config CRYPTO_DEV_VMX
+        bool "Support for VMX cryptographic acceleration instructions"
+        depends on PPC64 && VSX
+        help
+          Support for VMX cryptographic acceleration instructions.
+
+config CRYPTO_DEV_VMX_ENCRYPT
+	tristate "Encryption acceleration support on P8 CPU"
+	depends on CRYPTO_DEV_VMX
+	select CRYPTO_AES
+	select CRYPTO_CBC
+	select CRYPTO_CTR
+	select CRYPTO_GHASH
+	select CRYPTO_XTS
+	default m
+	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.
+
 endmenu
arch/powerpc/crypto/Makefile +18 -2
index ebdac1b9eb9a..fca0e9739869 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_CRYPTO_VPMSUM_TESTER) += crc-vpmsum_test.o
 obj-$(CONFIG_CRYPTO_AES_GCM_P10) += aes-gcm-p10-crypto.o
 obj-$(CONFIG_CRYPTO_CHACHA20_P10) += chacha-p10-crypto.o
 obj-$(CONFIG_CRYPTO_POLY1305_P10) += poly1305-p10-crypto.o
+obj-$(CONFIG_CRYPTO_DEV_VMX_ENCRYPT) += vmx-crypto.o
 
 aes-ppc-spe-y := aes-spe-core.o aes-spe-keys.o aes-tab-4k.o aes-spe-modes.o aes-spe-glue.o
 md5-ppc-y := md5-asm.o md5-glue.o
@@ -27,14 +28,29 @@ crct10dif-vpmsum-y := crct10dif-vpmsum_asm.o crct10dif-vpmsum_glue.o
 aes-gcm-p10-crypto-y := aes-gcm-p10-glue.o aes-gcm-p10.o ghashp10-ppc.o aesp10-ppc.o
 chacha-p10-crypto-y := chacha-p10-glue.o chacha-p10le-8x.o
 poly1305-p10-crypto-y := poly1305-p10-glue.o poly1305-p10le_64.o
+vmx-crypto-objs := vmx.o aesp8-ppc.o ghashp8-ppc.o aes.o aes_cbc.o aes_ctr.o aes_xts.o ghash.o
+
+ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
+override flavour := linux-ppc64le
+else
+ifdef CONFIG_PPC64_ELF_ABI_V2
+override flavour := linux-ppc64-elfv2
+else
+override flavour := linux-ppc64
+endif
+endif
 
 quiet_cmd_perl = PERL    $@
-      cmd_perl = $(PERL) $< $(if $(CONFIG_CPU_LITTLE_ENDIAN), linux-ppc64le, linux-ppc64) > $@
+      cmd_perl = $(PERL) $< $(flavour) > $@
 
-targets += aesp10-ppc.S ghashp10-ppc.S
+targets += aesp10-ppc.S ghashp10-ppc.S aesp8-ppc.S ghashp8-ppc.S
 
 $(obj)/aesp10-ppc.S $(obj)/ghashp10-ppc.S: $(obj)/%.S: $(src)/%.pl FORCE
 	$(call if_changed,perl)
 
+$(obj)/aesp8-ppc.S $(obj)/ghashp8-ppc.S: $(obj)/%.S: $(src)/%.pl FORCE
+	$(call if_changed,perl)
+
 OBJECT_FILES_NON_STANDARD_aesp10-ppc.o := y
 OBJECT_FILES_NON_STANDARD_ghashp10-ppc.o := y
+OBJECT_FILES_NON_STANDARD_aesp8-ppc.o := y
arch/powerpc/crypto/aes.c renamed from drivers/crypto/vmx/aes.c +0 -0
similarity index 100%
rename from drivers/crypto/vmx/aes.c
rename to arch/powerpc/crypto/aes.c
arch/powerpc/crypto/aes_cbc.c renamed from drivers/crypto/vmx/aes_cbc.c +0 -0
similarity index 100%
rename from drivers/crypto/vmx/aes_cbc.c
rename to arch/powerpc/crypto/aes_cbc.c
arch/powerpc/crypto/aes_ctr.c renamed from drivers/crypto/vmx/aes_ctr.c +0 -0
similarity index 100%
rename from drivers/crypto/vmx/aes_ctr.c
rename to arch/powerpc/crypto/aes_ctr.c
arch/powerpc/crypto/aes_xts.c renamed from drivers/crypto/vmx/aes_xts.c +0 -0
similarity index 100%
rename from drivers/crypto/vmx/aes_xts.c
rename to arch/powerpc/crypto/aes_xts.c
arch/powerpc/crypto/aesp8-ppc.h renamed from drivers/crypto/vmx/aesp8-ppc.h +0 -0
similarity index 100%
rename from drivers/crypto/vmx/aesp8-ppc.h
rename to arch/powerpc/crypto/aesp8-ppc.h
arch/powerpc/crypto/aesp8-ppc.pl renamed from drivers/crypto/vmx/aesp8-ppc.pl +0 -0
similarity index 100%
rename from drivers/crypto/vmx/aesp8-ppc.pl
rename to arch/powerpc/crypto/aesp8-ppc.pl
arch/powerpc/crypto/ghash.c renamed from drivers/crypto/vmx/ghash.c +0 -0
similarity index 100%
rename from drivers/crypto/vmx/ghash.c
rename to arch/powerpc/crypto/ghash.c
arch/powerpc/crypto/ghashp8-ppc.pl renamed from drivers/crypto/vmx/ghashp8-ppc.pl +0 -0
similarity index 100%
rename from drivers/crypto/vmx/ghashp8-ppc.pl
rename to arch/powerpc/crypto/ghashp8-ppc.pl
arch/powerpc/crypto/vmx.c renamed from drivers/crypto/vmx/vmx.c +0 -0
similarity index 100%
rename from drivers/crypto/vmx/vmx.c
rename to arch/powerpc/crypto/vmx.c
drivers/crypto/Kconfig +7 -7
index 79c3bb9c99c3..59644d72c735 100644
@@ -610,13 +610,13 @@ config CRYPTO_DEV_QCOM_RNG
 	  To compile this driver as a module, choose M here. The
 	  module will be called qcom-rng. If unsure, say N.
 
-config CRYPTO_DEV_VMX
-	bool "Support for VMX cryptographic acceleration instructions"
-	depends on PPC64 && VSX
-	help
-	  Support for VMX cryptographic acceleration instructions.
-
-source "drivers/crypto/vmx/Kconfig"
+#config CRYPTO_DEV_VMX
+#	bool "Support for VMX cryptographic acceleration instructions"
+#	depends on PPC64 && VSX
+#	help
+#	  Support for VMX cryptographic acceleration instructions.
+#
+#source "drivers/crypto/vmx/Kconfig"
 
 config CRYPTO_DEV_IMGTEC_HASH
 	tristate "Imagination Technologies hardware hash accelerator"
drivers/crypto/Makefile +1 -1
index d859d6a5f3a4..95331bc6456b 100644
@@ -42,7 +42,7 @@ obj-$(CONFIG_CRYPTO_DEV_SL3516) += gemini/
 obj-y += stm32/
 obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o
 obj-$(CONFIG_CRYPTO_DEV_VIRTIO) += virtio/
-obj-$(CONFIG_CRYPTO_DEV_VMX) += vmx/
+#obj-$(CONFIG_CRYPTO_DEV_VMX) += vmx/
 obj-$(CONFIG_CRYPTO_DEV_BCM_SPU) += bcm/
 obj-$(CONFIG_CRYPTO_DEV_SAFEXCEL) += inside-secure/
 obj-$(CONFIG_CRYPTO_DEV_ARTPEC6) += axis/
drivers/crypto/vmx/.gitignore deleted +0 -3
deleted file mode 100644
index 7aa71d83f739..000000000000
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-aesp8-ppc.S
-ghashp8-ppc.S
drivers/crypto/vmx/Kconfig deleted +0 -14
deleted file mode 100644
index b2c28b87f14b..000000000000
@@ -1,14 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-config CRYPTO_DEV_VMX_ENCRYPT
-	tristate "Encryption acceleration support on P8 CPU"
-	depends on CRYPTO_DEV_VMX
-	select CRYPTO_AES
-	select CRYPTO_CBC
-	select CRYPTO_CTR
-	select CRYPTO_GHASH
-	select CRYPTO_XTS
-	default m
-	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.
drivers/crypto/vmx/Makefile deleted +0 -23
deleted file mode 100644
index 7257b8c44626..000000000000
@@ -1,23 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-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 aes_xts.o ghash.o
-
-ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
-override flavour := linux-ppc64le
-else
-ifdef CONFIG_PPC64_ELF_ABI_V2
-override flavour := linux-ppc64-elfv2
-else
-override flavour := linux-ppc64
-endif
-endif
-
-quiet_cmd_perl = PERL    $@
-      cmd_perl = $(PERL) $< $(flavour) > $@
-
-targets += aesp8-ppc.S ghashp8-ppc.S
-
-$(obj)/aesp8-ppc.S $(obj)/ghashp8-ppc.S: $(obj)/%.S: $(src)/%.pl FORCE
-	$(call if_changed,perl)
-
-OBJECT_FILES_NON_STANDARD_aesp8-ppc.o := y
drivers/crypto/vmx/ppc-xlate.pl deleted +0 -231

231 lines not on this page · raw message

Signature · 1 line
2.31.1
maintainer
#1 lore raw
Quoted 46 lines · Danny Tsen

Relocate all crypto files in vmx driver to arch/powerpc/crypto directory and remove vmx directory.

drivers/crypto/vmx/aes.c rename to arch/powerpc/crypto/aes.c drivers/crypto/vmx/aes_cbc.c rename to arch/powerpc/crypto/aes_cbc.c drivers/crypto/vmx/aes_ctr.c rename to arch/powerpc/crypto/aes_ctr.c drivers/crypto/vmx/aes_xts.c rename to arch/powerpc/crypto/aes_xts.c drivers/crypto/vmx/aesp8-ppc.h rename to arch/powerpc/crypto/aesp8-ppc.h drivers/crypto/vmx/aesp8-ppc.pl rename to arch/powerpc/crypto/aesp8-ppc.pl drivers/crypto/vmx/ghash.c rename to arch/powerpc/crypto/ghash.c drivers/crypto/vmx/ghashp8-ppc.pl rename to arch/powerpc/crypto/ghashp8-ppc.pl drivers/crypto/vmx/vmx.c rename to arch/powerpc/crypto/vmx.c

deleted files:
drivers/crypto/vmx/Makefile
drivers/crypto/vmx/Kconfig
drivers/crypto/vmx/ppc-xlate.pl

This patch has been tested has passed the selftest. The patch is also tested with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled.

---
 arch/powerpc/crypto/Kconfig                   |  20 ++
 arch/powerpc/crypto/Makefile                  |  20 +-
 .../crypto/vmx => arch/powerpc/crypto}/aes.c  |   0
 .../vmx => arch/powerpc/crypto}/aes_cbc.c     |   0
 .../vmx => arch/powerpc/crypto}/aes_ctr.c     |   0
 .../vmx => arch/powerpc/crypto}/aes_xts.c     |   0
 .../vmx => arch/powerpc/crypto}/aesp8-ppc.h   |   0
 .../vmx => arch/powerpc/crypto}/aesp8-ppc.pl  |   0
 .../vmx => arch/powerpc/crypto}/ghash.c       |   0
 .../powerpc/crypto}/ghashp8-ppc.pl            |   0
 .../crypto/vmx => arch/powerpc/crypto}/vmx.c  |   0
 drivers/crypto/Kconfig                        |  14 +-
 drivers/crypto/Makefile                       |   2 +-
 drivers/crypto/vmx/.gitignore                 |   3 -
 drivers/crypto/vmx/Kconfig                    |  14 --
 drivers/crypto/vmx/Makefile                   |  23 --
 drivers/crypto/vmx/ppc-xlate.pl               | 231 ------------------
 17 files changed, 46 insertions(+), 281 deletions(-)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes_cbc.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes_ctr.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes_xts.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aesp8-ppc.h (100%)
Quoted 8 lines
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/aesp8-ppc.pl (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/ghash.c (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/ghashp8-ppc.pl (100%)
 rename {drivers/crypto/vmx => arch/powerpc/crypto}/vmx.c (100%)
 delete mode 100644 drivers/crypto/vmx/.gitignore
 delete mode 100644 drivers/crypto/vmx/Kconfig
 delete mode 100644 drivers/crypto/vmx/Makefile
 delete mode 100644 drivers/crypto/vmx/ppc-xlate.pl

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
author
#2 lore raw

Thanks Herbert.

-Danny

Quoted 56 lines · Herbert Xu
Quoted 41 lines · Danny Tsen

Relocate all crypto files in vmx driver to arch/powerpc/crypto directory and remove vmx directory.

drivers/crypto/vmx/aes.c rename to arch/powerpc/crypto/aes.c drivers/crypto/vmx/aes_cbc.c rename to arch/powerpc/crypto/aes_cbc.c drivers/crypto/vmx/aes_ctr.c rename to arch/powerpc/crypto/aes_ctr.c drivers/crypto/vmx/aes_xts.c rename to arch/powerpc/crypto/aes_xts.c drivers/crypto/vmx/aesp8-ppc.h rename to arch/powerpc/crypto/aesp8-ppc.h drivers/crypto/vmx/aesp8-ppc.pl rename to arch/powerpc/crypto/aesp8-ppc.pl drivers/crypto/vmx/ghash.c rename to arch/powerpc/crypto/ghash.c drivers/crypto/vmx/ghashp8-ppc.pl rename to arch/powerpc/crypto/ghashp8-ppc.pl drivers/crypto/vmx/vmx.c rename to arch/powerpc/crypto/vmx.c

deleted files:
drivers/crypto/vmx/Makefile
drivers/crypto/vmx/Kconfig
drivers/crypto/vmx/ppc-xlate.pl

This patch has been tested has passed the selftest. The patch is also tested with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled.

---
  arch/powerpc/crypto/Kconfig                   |  20 ++
  arch/powerpc/crypto/Makefile                  |  20 +-
  .../crypto/vmx => arch/powerpc/crypto}/aes.c  |   0
  .../vmx => arch/powerpc/crypto}/aes_cbc.c     |   0
  .../vmx => arch/powerpc/crypto}/aes_ctr.c     |   0
  .../vmx => arch/powerpc/crypto}/aes_xts.c     |   0
  .../vmx => arch/powerpc/crypto}/aesp8-ppc.h   |   0
  .../vmx => arch/powerpc/crypto}/aesp8-ppc.pl  |   0
  .../vmx => arch/powerpc/crypto}/ghash.c       |   0
  .../powerpc/crypto}/ghashp8-ppc.pl            |   0
  .../crypto/vmx => arch/powerpc/crypto}/vmx.c  |   0
  drivers/crypto/Kconfig                        |  14 +-
  drivers/crypto/Makefile                       |   2 +-
  drivers/crypto/vmx/.gitignore                 |   3 -
  drivers/crypto/vmx/Kconfig                    |  14 --
  drivers/crypto/vmx/Makefile                   |  23 --
  drivers/crypto/vmx/ppc-xlate.pl               | 231 ------------------
  17 files changed, 46 insertions(+), 281 deletions(-)
Quoted 13 lines

rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes.c (100%) rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes_cbc.c (100%) rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes_ctr.c (100%) rename {drivers/crypto/vmx => arch/powerpc/crypto}/aes_xts.c (100%) rename {drivers/crypto/vmx => arch/powerpc/crypto}/aesp8-ppc.h (100%) rename {drivers/crypto/vmx => arch/powerpc/crypto}/aesp8-ppc.pl (100%) rename {drivers/crypto/vmx => arch/powerpc/crypto}/ghash.c (100%) rename {drivers/crypto/vmx => arch/powerpc/crypto}/ghashp8-ppc.pl (100%) rename {drivers/crypto/vmx => arch/powerpc/crypto}/vmx.c (100%) delete mode 100644 drivers/crypto/vmx/.gitignore
delete mode 100644 drivers/crypto/vmx/Kconfig
delete mode 100644 drivers/crypto/vmx/Makefile
delete mode 100644 drivers/crypto/vmx/ppc-xlate.pl

Patch applied. Thanks.