Loading arch/powerpc/Kconfig +6 −0 Original line number Original line Diff line number Diff line Loading @@ -906,11 +906,17 @@ config DATA_SHIFT config ARCH_FORCE_MAX_ORDER config ARCH_FORCE_MAX_ORDER int "Order of maximal physically contiguous allocations" int "Order of maximal physically contiguous allocations" range 7 8 if PPC64 && PPC_64K_PAGES default "8" if PPC64 && PPC_64K_PAGES default "8" if PPC64 && PPC_64K_PAGES range 12 12 if PPC64 && !PPC_64K_PAGES default "12" if PPC64 && !PPC_64K_PAGES default "12" if PPC64 && !PPC_64K_PAGES range 8 10 if PPC32 && PPC_16K_PAGES default "8" if PPC32 && PPC_16K_PAGES default "8" if PPC32 && PPC_16K_PAGES range 6 10 if PPC32 && PPC_64K_PAGES default "6" if PPC32 && PPC_64K_PAGES default "6" if PPC32 && PPC_64K_PAGES range 4 10 if PPC32 && PPC_256K_PAGES default "4" if PPC32 && PPC_256K_PAGES default "4" if PPC32 && PPC_256K_PAGES range 10 10 default "10" default "10" help help The kernel page allocator limits the size of maximal physically The kernel page allocator limits the size of maximal physically Loading arch/powerpc/boot/Makefile +4 −2 Original line number Original line Diff line number Diff line Loading @@ -34,8 +34,6 @@ endif BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ $(call cc-option,-mno-prefixed) $(call cc-option,-mno-pcrel) \ $(call cc-option,-mno-mma) \ $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ $(LINUXINCLUDE) $(LINUXINCLUDE) Loading Loading @@ -71,6 +69,10 @@ BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc BOOTARFLAGS := -crD BOOTARFLAGS := -crD BOOTCFLAGS += $(call cc-option,-mno-prefixed) \ $(call cc-option,-mno-pcrel) \ $(call cc-option,-mno-mma) ifdef CONFIG_CC_IS_CLANG ifdef CONFIG_CC_IS_CLANG BOOTCFLAGS += $(CLANG_FLAGS) BOOTCFLAGS += $(CLANG_FLAGS) BOOTAFLAGS += $(CLANG_FLAGS) BOOTAFLAGS += $(CLANG_FLAGS) Loading arch/powerpc/crypto/Kconfig +1 −1 Original line number Original line Diff line number Diff line Loading @@ -96,7 +96,7 @@ config CRYPTO_AES_PPC_SPE config CRYPTO_AES_GCM_P10 config CRYPTO_AES_GCM_P10 tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)" tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)" depends on PPC64 && CPU_LITTLE_ENDIAN depends on PPC64 && CPU_LITTLE_ENDIAN && VSX select CRYPTO_LIB_AES select CRYPTO_LIB_AES select CRYPTO_ALGAPI select CRYPTO_ALGAPI select CRYPTO_AEAD select CRYPTO_AEAD Loading arch/powerpc/crypto/Makefile +5 −5 Original line number Original line Diff line number Diff line Loading @@ -22,15 +22,15 @@ sha1-ppc-spe-y := sha1-spe-asm.o sha1-spe-glue.o sha256-ppc-spe-y := sha256-spe-asm.o sha256-spe-glue.o sha256-ppc-spe-y := sha256-spe-asm.o sha256-spe-glue.o crc32c-vpmsum-y := crc32c-vpmsum_asm.o crc32c-vpmsum_glue.o crc32c-vpmsum-y := crc32c-vpmsum_asm.o crc32c-vpmsum_glue.o crct10dif-vpmsum-y := crct10dif-vpmsum_asm.o crct10dif-vpmsum_glue.o 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 ghashp8-ppc.o aesp8-ppc.o aes-gcm-p10-crypto-y := aes-gcm-p10-glue.o aes-gcm-p10.o ghashp10-ppc.o aesp10-ppc.o quiet_cmd_perl = PERL $@ quiet_cmd_perl = PERL $@ cmd_perl = $(PERL) $< $(if $(CONFIG_CPU_LITTLE_ENDIAN), linux-ppc64le, linux-ppc64) > $@ cmd_perl = $(PERL) $< $(if $(CONFIG_CPU_LITTLE_ENDIAN), linux-ppc64le, linux-ppc64) > $@ targets += aesp8-ppc.S ghashp8-ppc.S targets += aesp10-ppc.S ghashp10-ppc.S $(obj)/aesp8-ppc.S $(obj)/ghashp8-ppc.S: $(obj)/%.S: $(src)/%.pl FORCE $(obj)/aesp10-ppc.S $(obj)/ghashp10-ppc.S: $(obj)/%.S: $(src)/%.pl FORCE $(call if_changed,perl) $(call if_changed,perl) OBJECT_FILES_NON_STANDARD_aesp8-ppc.o := y OBJECT_FILES_NON_STANDARD_aesp10-ppc.o := y OBJECT_FILES_NON_STANDARD_ghashp8-ppc.o := y OBJECT_FILES_NON_STANDARD_ghashp10-ppc.o := y arch/powerpc/crypto/aes-gcm-p10-glue.c +9 −9 Original line number Original line Diff line number Diff line Loading @@ -30,15 +30,15 @@ MODULE_AUTHOR("Danny Tsen <dtsen@linux.ibm.com"); MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2"); MODULE_ALIAS_CRYPTO("aes"); MODULE_ALIAS_CRYPTO("aes"); asmlinkage int aes_p8_set_encrypt_key(const u8 *userKey, const int bits, asmlinkage int aes_p10_set_encrypt_key(const u8 *userKey, const int bits, void *key); void *key); asmlinkage void aes_p8_encrypt(const u8 *in, u8 *out, const void *key); asmlinkage void aes_p10_encrypt(const u8 *in, u8 *out, const void *key); asmlinkage void aes_p10_gcm_encrypt(u8 *in, u8 *out, size_t len, asmlinkage void aes_p10_gcm_encrypt(u8 *in, u8 *out, size_t len, void *rkey, u8 *iv, void *Xi); void *rkey, u8 *iv, void *Xi); asmlinkage void aes_p10_gcm_decrypt(u8 *in, u8 *out, size_t len, asmlinkage void aes_p10_gcm_decrypt(u8 *in, u8 *out, size_t len, void *rkey, u8 *iv, void *Xi); void *rkey, u8 *iv, void *Xi); asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]); asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]); asmlinkage void gcm_ghash_p8(unsigned char *Xi, unsigned char *Htable, asmlinkage void gcm_ghash_p10(unsigned char *Xi, unsigned char *Htable, unsigned char *aad, unsigned int alen); unsigned char *aad, unsigned int alen); struct aes_key { struct aes_key { Loading Loading @@ -93,7 +93,7 @@ static void set_aad(struct gcm_ctx *gctx, struct Hash_ctx *hash, gctx->aadLen = alen; gctx->aadLen = alen; i = alen & ~0xf; i = alen & ~0xf; if (i) { if (i) { gcm_ghash_p8(nXi, hash->Htable+32, aad, i); gcm_ghash_p10(nXi, hash->Htable+32, aad, i); aad += i; aad += i; alen -= i; alen -= i; } } Loading @@ -102,7 +102,7 @@ static void set_aad(struct gcm_ctx *gctx, struct Hash_ctx *hash, nXi[i] ^= aad[i]; nXi[i] ^= aad[i]; memset(gctx->aad_hash, 0, 16); memset(gctx->aad_hash, 0, 16); gcm_ghash_p8(gctx->aad_hash, hash->Htable+32, nXi, 16); gcm_ghash_p10(gctx->aad_hash, hash->Htable+32, nXi, 16); } else { } else { memcpy(gctx->aad_hash, nXi, 16); memcpy(gctx->aad_hash, nXi, 16); } } Loading @@ -115,7 +115,7 @@ static void gcmp10_init(struct gcm_ctx *gctx, u8 *iv, unsigned char *rdkey, { { __be32 counter = cpu_to_be32(1); __be32 counter = cpu_to_be32(1); aes_p8_encrypt(hash->H, hash->H, rdkey); aes_p10_encrypt(hash->H, hash->H, rdkey); set_subkey(hash->H); set_subkey(hash->H); gcm_init_htable(hash->Htable+32, hash->H); gcm_init_htable(hash->Htable+32, hash->H); Loading @@ -126,7 +126,7 @@ static void gcmp10_init(struct gcm_ctx *gctx, u8 *iv, unsigned char *rdkey, /* /* * Encrypt counter vector as iv tag and increment counter. * Encrypt counter vector as iv tag and increment counter. */ */ aes_p8_encrypt(iv, gctx->ivtag, rdkey); aes_p10_encrypt(iv, gctx->ivtag, rdkey); counter = cpu_to_be32(2); counter = cpu_to_be32(2); *((__be32 *)(iv+12)) = counter; *((__be32 *)(iv+12)) = counter; Loading Loading @@ -160,7 +160,7 @@ static void finish_tag(struct gcm_ctx *gctx, struct Hash_ctx *hash, int len) /* /* * hash (AAD len and len) * hash (AAD len and len) */ */ gcm_ghash_p8(hash->Htable, hash->Htable+32, aclen, 16); gcm_ghash_p10(hash->Htable, hash->Htable+32, aclen, 16); for (i = 0; i < 16; i++) for (i = 0; i < 16; i++) hash->Htable[i] ^= gctx->ivtag[i]; hash->Htable[i] ^= gctx->ivtag[i]; Loading Loading @@ -192,7 +192,7 @@ static int p10_aes_gcm_setkey(struct crypto_aead *aead, const u8 *key, int ret; int ret; vsx_begin(); vsx_begin(); ret = aes_p8_set_encrypt_key(key, keylen * 8, &ctx->enc_key); ret = aes_p10_set_encrypt_key(key, keylen * 8, &ctx->enc_key); vsx_end(); vsx_end(); return ret ? -EINVAL : 0; return ret ? -EINVAL : 0; Loading Loading
arch/powerpc/Kconfig +6 −0 Original line number Original line Diff line number Diff line Loading @@ -906,11 +906,17 @@ config DATA_SHIFT config ARCH_FORCE_MAX_ORDER config ARCH_FORCE_MAX_ORDER int "Order of maximal physically contiguous allocations" int "Order of maximal physically contiguous allocations" range 7 8 if PPC64 && PPC_64K_PAGES default "8" if PPC64 && PPC_64K_PAGES default "8" if PPC64 && PPC_64K_PAGES range 12 12 if PPC64 && !PPC_64K_PAGES default "12" if PPC64 && !PPC_64K_PAGES default "12" if PPC64 && !PPC_64K_PAGES range 8 10 if PPC32 && PPC_16K_PAGES default "8" if PPC32 && PPC_16K_PAGES default "8" if PPC32 && PPC_16K_PAGES range 6 10 if PPC32 && PPC_64K_PAGES default "6" if PPC32 && PPC_64K_PAGES default "6" if PPC32 && PPC_64K_PAGES range 4 10 if PPC32 && PPC_256K_PAGES default "4" if PPC32 && PPC_256K_PAGES default "4" if PPC32 && PPC_256K_PAGES range 10 10 default "10" default "10" help help The kernel page allocator limits the size of maximal physically The kernel page allocator limits the size of maximal physically Loading
arch/powerpc/boot/Makefile +4 −2 Original line number Original line Diff line number Diff line Loading @@ -34,8 +34,6 @@ endif BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ $(call cc-option,-mno-prefixed) $(call cc-option,-mno-pcrel) \ $(call cc-option,-mno-mma) \ $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ $(LINUXINCLUDE) $(LINUXINCLUDE) Loading Loading @@ -71,6 +69,10 @@ BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc BOOTARFLAGS := -crD BOOTARFLAGS := -crD BOOTCFLAGS += $(call cc-option,-mno-prefixed) \ $(call cc-option,-mno-pcrel) \ $(call cc-option,-mno-mma) ifdef CONFIG_CC_IS_CLANG ifdef CONFIG_CC_IS_CLANG BOOTCFLAGS += $(CLANG_FLAGS) BOOTCFLAGS += $(CLANG_FLAGS) BOOTAFLAGS += $(CLANG_FLAGS) BOOTAFLAGS += $(CLANG_FLAGS) Loading
arch/powerpc/crypto/Kconfig +1 −1 Original line number Original line Diff line number Diff line Loading @@ -96,7 +96,7 @@ config CRYPTO_AES_PPC_SPE config CRYPTO_AES_GCM_P10 config CRYPTO_AES_GCM_P10 tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)" tristate "Stitched AES/GCM acceleration support on P10 or later CPU (PPC)" depends on PPC64 && CPU_LITTLE_ENDIAN depends on PPC64 && CPU_LITTLE_ENDIAN && VSX select CRYPTO_LIB_AES select CRYPTO_LIB_AES select CRYPTO_ALGAPI select CRYPTO_ALGAPI select CRYPTO_AEAD select CRYPTO_AEAD Loading
arch/powerpc/crypto/Makefile +5 −5 Original line number Original line Diff line number Diff line Loading @@ -22,15 +22,15 @@ sha1-ppc-spe-y := sha1-spe-asm.o sha1-spe-glue.o sha256-ppc-spe-y := sha256-spe-asm.o sha256-spe-glue.o sha256-ppc-spe-y := sha256-spe-asm.o sha256-spe-glue.o crc32c-vpmsum-y := crc32c-vpmsum_asm.o crc32c-vpmsum_glue.o crc32c-vpmsum-y := crc32c-vpmsum_asm.o crc32c-vpmsum_glue.o crct10dif-vpmsum-y := crct10dif-vpmsum_asm.o crct10dif-vpmsum_glue.o 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 ghashp8-ppc.o aesp8-ppc.o aes-gcm-p10-crypto-y := aes-gcm-p10-glue.o aes-gcm-p10.o ghashp10-ppc.o aesp10-ppc.o quiet_cmd_perl = PERL $@ quiet_cmd_perl = PERL $@ cmd_perl = $(PERL) $< $(if $(CONFIG_CPU_LITTLE_ENDIAN), linux-ppc64le, linux-ppc64) > $@ cmd_perl = $(PERL) $< $(if $(CONFIG_CPU_LITTLE_ENDIAN), linux-ppc64le, linux-ppc64) > $@ targets += aesp8-ppc.S ghashp8-ppc.S targets += aesp10-ppc.S ghashp10-ppc.S $(obj)/aesp8-ppc.S $(obj)/ghashp8-ppc.S: $(obj)/%.S: $(src)/%.pl FORCE $(obj)/aesp10-ppc.S $(obj)/ghashp10-ppc.S: $(obj)/%.S: $(src)/%.pl FORCE $(call if_changed,perl) $(call if_changed,perl) OBJECT_FILES_NON_STANDARD_aesp8-ppc.o := y OBJECT_FILES_NON_STANDARD_aesp10-ppc.o := y OBJECT_FILES_NON_STANDARD_ghashp8-ppc.o := y OBJECT_FILES_NON_STANDARD_ghashp10-ppc.o := y
arch/powerpc/crypto/aes-gcm-p10-glue.c +9 −9 Original line number Original line Diff line number Diff line Loading @@ -30,15 +30,15 @@ MODULE_AUTHOR("Danny Tsen <dtsen@linux.ibm.com"); MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2"); MODULE_ALIAS_CRYPTO("aes"); MODULE_ALIAS_CRYPTO("aes"); asmlinkage int aes_p8_set_encrypt_key(const u8 *userKey, const int bits, asmlinkage int aes_p10_set_encrypt_key(const u8 *userKey, const int bits, void *key); void *key); asmlinkage void aes_p8_encrypt(const u8 *in, u8 *out, const void *key); asmlinkage void aes_p10_encrypt(const u8 *in, u8 *out, const void *key); asmlinkage void aes_p10_gcm_encrypt(u8 *in, u8 *out, size_t len, asmlinkage void aes_p10_gcm_encrypt(u8 *in, u8 *out, size_t len, void *rkey, u8 *iv, void *Xi); void *rkey, u8 *iv, void *Xi); asmlinkage void aes_p10_gcm_decrypt(u8 *in, u8 *out, size_t len, asmlinkage void aes_p10_gcm_decrypt(u8 *in, u8 *out, size_t len, void *rkey, u8 *iv, void *Xi); void *rkey, u8 *iv, void *Xi); asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]); asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]); asmlinkage void gcm_ghash_p8(unsigned char *Xi, unsigned char *Htable, asmlinkage void gcm_ghash_p10(unsigned char *Xi, unsigned char *Htable, unsigned char *aad, unsigned int alen); unsigned char *aad, unsigned int alen); struct aes_key { struct aes_key { Loading Loading @@ -93,7 +93,7 @@ static void set_aad(struct gcm_ctx *gctx, struct Hash_ctx *hash, gctx->aadLen = alen; gctx->aadLen = alen; i = alen & ~0xf; i = alen & ~0xf; if (i) { if (i) { gcm_ghash_p8(nXi, hash->Htable+32, aad, i); gcm_ghash_p10(nXi, hash->Htable+32, aad, i); aad += i; aad += i; alen -= i; alen -= i; } } Loading @@ -102,7 +102,7 @@ static void set_aad(struct gcm_ctx *gctx, struct Hash_ctx *hash, nXi[i] ^= aad[i]; nXi[i] ^= aad[i]; memset(gctx->aad_hash, 0, 16); memset(gctx->aad_hash, 0, 16); gcm_ghash_p8(gctx->aad_hash, hash->Htable+32, nXi, 16); gcm_ghash_p10(gctx->aad_hash, hash->Htable+32, nXi, 16); } else { } else { memcpy(gctx->aad_hash, nXi, 16); memcpy(gctx->aad_hash, nXi, 16); } } Loading @@ -115,7 +115,7 @@ static void gcmp10_init(struct gcm_ctx *gctx, u8 *iv, unsigned char *rdkey, { { __be32 counter = cpu_to_be32(1); __be32 counter = cpu_to_be32(1); aes_p8_encrypt(hash->H, hash->H, rdkey); aes_p10_encrypt(hash->H, hash->H, rdkey); set_subkey(hash->H); set_subkey(hash->H); gcm_init_htable(hash->Htable+32, hash->H); gcm_init_htable(hash->Htable+32, hash->H); Loading @@ -126,7 +126,7 @@ static void gcmp10_init(struct gcm_ctx *gctx, u8 *iv, unsigned char *rdkey, /* /* * Encrypt counter vector as iv tag and increment counter. * Encrypt counter vector as iv tag and increment counter. */ */ aes_p8_encrypt(iv, gctx->ivtag, rdkey); aes_p10_encrypt(iv, gctx->ivtag, rdkey); counter = cpu_to_be32(2); counter = cpu_to_be32(2); *((__be32 *)(iv+12)) = counter; *((__be32 *)(iv+12)) = counter; Loading Loading @@ -160,7 +160,7 @@ static void finish_tag(struct gcm_ctx *gctx, struct Hash_ctx *hash, int len) /* /* * hash (AAD len and len) * hash (AAD len and len) */ */ gcm_ghash_p8(hash->Htable, hash->Htable+32, aclen, 16); gcm_ghash_p10(hash->Htable, hash->Htable+32, aclen, 16); for (i = 0; i < 16; i++) for (i = 0; i < 16; i++) hash->Htable[i] ^= gctx->ivtag[i]; hash->Htable[i] ^= gctx->ivtag[i]; Loading Loading @@ -192,7 +192,7 @@ static int p10_aes_gcm_setkey(struct crypto_aead *aead, const u8 *key, int ret; int ret; vsx_begin(); vsx_begin(); ret = aes_p8_set_encrypt_key(key, keylen * 8, &ctx->enc_key); ret = aes_p10_set_encrypt_key(key, keylen * 8, &ctx->enc_key); vsx_end(); vsx_end(); return ret ? -EINVAL : 0; return ret ? -EINVAL : 0; Loading