Skip to content

Commit 1093033

Browse files
Danny Tsenherbertx
authored andcommitted
crypto: vmx - Move 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. Signed-off-by: Danny Tsen <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent e01966e commit 1093033

File tree

17 files changed

+46
-281
lines changed

17 files changed

+46
-281
lines changed

arch/powerpc/crypto/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,24 @@ config CRYPTO_POLY1305_P10
137137
- Power10 or later
138138
- Little-endian
139139

140+
config CRYPTO_DEV_VMX
141+
bool "Support for VMX cryptographic acceleration instructions"
142+
depends on PPC64 && VSX
143+
help
144+
Support for VMX cryptographic acceleration instructions.
145+
146+
config CRYPTO_DEV_VMX_ENCRYPT
147+
tristate "Encryption acceleration support on P8 CPU"
148+
depends on CRYPTO_DEV_VMX
149+
select CRYPTO_AES
150+
select CRYPTO_CBC
151+
select CRYPTO_CTR
152+
select CRYPTO_GHASH
153+
select CRYPTO_XTS
154+
default m
155+
help
156+
Support for VMX cryptographic acceleration instructions on Power8 CPU.
157+
This module supports acceleration for AES and GHASH in hardware. If you
158+
choose 'M' here, this module will be called vmx-crypto.
159+
140160
endmenu

arch/powerpc/crypto/Makefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ obj-$(CONFIG_CRYPTO_VPMSUM_TESTER) += crc-vpmsum_test.o
1616
obj-$(CONFIG_CRYPTO_AES_GCM_P10) += aes-gcm-p10-crypto.o
1717
obj-$(CONFIG_CRYPTO_CHACHA20_P10) += chacha-p10-crypto.o
1818
obj-$(CONFIG_CRYPTO_POLY1305_P10) += poly1305-p10-crypto.o
19+
obj-$(CONFIG_CRYPTO_DEV_VMX_ENCRYPT) += vmx-crypto.o
1920

2021
aes-ppc-spe-y := aes-spe-core.o aes-spe-keys.o aes-tab-4k.o aes-spe-modes.o aes-spe-glue.o
2122
md5-ppc-y := md5-asm.o md5-glue.o
@@ -27,14 +28,29 @@ crct10dif-vpmsum-y := crct10dif-vpmsum_asm.o crct10dif-vpmsum_glue.o
2728
aes-gcm-p10-crypto-y := aes-gcm-p10-glue.o aes-gcm-p10.o ghashp10-ppc.o aesp10-ppc.o
2829
chacha-p10-crypto-y := chacha-p10-glue.o chacha-p10le-8x.o
2930
poly1305-p10-crypto-y := poly1305-p10-glue.o poly1305-p10le_64.o
31+
vmx-crypto-objs := vmx.o aesp8-ppc.o ghashp8-ppc.o aes.o aes_cbc.o aes_ctr.o aes_xts.o ghash.o
32+
33+
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
34+
override flavour := linux-ppc64le
35+
else
36+
ifdef CONFIG_PPC64_ELF_ABI_V2
37+
override flavour := linux-ppc64-elfv2
38+
else
39+
override flavour := linux-ppc64
40+
endif
41+
endif
3042

3143
quiet_cmd_perl = PERL $@
32-
cmd_perl = $(PERL) $< $(if $(CONFIG_CPU_LITTLE_ENDIAN), linux-ppc64le, linux-ppc64) > $@
44+
cmd_perl = $(PERL) $< $(flavour) > $@
3345

34-
targets += aesp10-ppc.S ghashp10-ppc.S
46+
targets += aesp10-ppc.S ghashp10-ppc.S aesp8-ppc.S ghashp8-ppc.S
3547

3648
$(obj)/aesp10-ppc.S $(obj)/ghashp10-ppc.S: $(obj)/%.S: $(src)/%.pl FORCE
3749
$(call if_changed,perl)
3850

51+
$(obj)/aesp8-ppc.S $(obj)/ghashp8-ppc.S: $(obj)/%.S: $(src)/%.pl FORCE
52+
$(call if_changed,perl)
53+
3954
OBJECT_FILES_NON_STANDARD_aesp10-ppc.o := y
4055
OBJECT_FILES_NON_STANDARD_ghashp10-ppc.o := y
56+
OBJECT_FILES_NON_STANDARD_aesp8-ppc.o := y
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

drivers/crypto/Kconfig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -611,13 +611,13 @@ config CRYPTO_DEV_QCOM_RNG
611611
To compile this driver as a module, choose M here. The
612612
module will be called qcom-rng. If unsure, say N.
613613

614-
config CRYPTO_DEV_VMX
615-
bool "Support for VMX cryptographic acceleration instructions"
616-
depends on PPC64 && VSX
617-
help
618-
Support for VMX cryptographic acceleration instructions.
619-
620-
source "drivers/crypto/vmx/Kconfig"
614+
#config CRYPTO_DEV_VMX
615+
# bool "Support for VMX cryptographic acceleration instructions"
616+
# depends on PPC64 && VSX
617+
# help
618+
# Support for VMX cryptographic acceleration instructions.
619+
#
620+
#source "drivers/crypto/vmx/Kconfig"
621621

622622
config CRYPTO_DEV_IMGTEC_HASH
623623
tristate "Imagination Technologies hardware hash accelerator"

drivers/crypto/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ obj-$(CONFIG_CRYPTO_DEV_SL3516) += gemini/
4242
obj-y += stm32/
4343
obj-$(CONFIG_CRYPTO_DEV_TALITOS) += talitos.o
4444
obj-$(CONFIG_CRYPTO_DEV_VIRTIO) += virtio/
45-
obj-$(CONFIG_CRYPTO_DEV_VMX) += vmx/
45+
#obj-$(CONFIG_CRYPTO_DEV_VMX) += vmx/
4646
obj-$(CONFIG_CRYPTO_DEV_BCM_SPU) += bcm/
4747
obj-$(CONFIG_CRYPTO_DEV_SAFEXCEL) += inside-secure/
4848
obj-$(CONFIG_CRYPTO_DEV_ARTPEC6) += axis/

drivers/crypto/vmx/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

drivers/crypto/vmx/Kconfig

Lines changed: 0 additions & 14 deletions
This file was deleted.

drivers/crypto/vmx/Makefile

Lines changed: 0 additions & 23 deletions
This file was deleted.

drivers/crypto/vmx/ppc-xlate.pl

Lines changed: 0 additions & 231 deletions
This file was deleted.

0 commit comments

Comments
 (0)