From 908cd0e7dc0840e055292d3e736b2fec316786db Mon Sep 17 00:00:00 2001 From: Peter Michael Green Date: Tue, 19 Jan 2021 16:01:40 +0000 Subject: [PATCH] Mark asm as armv6 to avoid setting off armv7 contamination checker. Gbp-Pq: Name armv6.patch --- linux-arm/crypto/chacha/chacha-armv4.S | 4 ++-- linux-arm/crypto/fipsmodule/aes-armv4.S | 2 +- linux-arm/crypto/fipsmodule/aesv8-armx32.S | 2 +- linux-arm/crypto/fipsmodule/armv4-mont.S | 4 ++-- linux-arm/crypto/fipsmodule/bsaes-armv7.S | 2 +- linux-arm/crypto/fipsmodule/ghash-armv4.S | 4 ++-- linux-arm/crypto/fipsmodule/sha1-armv4-large.S | 2 +- linux-arm/crypto/fipsmodule/sha256-armv4.S | 4 ++-- linux-arm/crypto/fipsmodule/sha512-armv4.S | 4 ++-- linux-arm/crypto/test/trampoline-armv4.S | 2 +- src/crypto/chacha/asm/chacha-armv4.pl | 4 ++-- src/crypto/fipsmodule/aes/asm/aes-armv4.pl | 2 +- src/crypto/fipsmodule/aes/asm/aesv8-armx.pl | 2 +- src/crypto/fipsmodule/aes/asm/bsaes-armv7.pl | 2 +- src/crypto/fipsmodule/aes/internal.h | 2 +- src/crypto/fipsmodule/bn/asm/armv4-mont.pl | 4 ++-- src/crypto/fipsmodule/modes/asm/ghash-armv4.pl | 4 ++-- src/crypto/fipsmodule/modes/internal.h | 2 +- src/crypto/fipsmodule/sha/asm/sha1-armv4-large.pl | 2 +- src/crypto/fipsmodule/sha/asm/sha256-armv4.pl | 4 ++-- src/crypto/fipsmodule/sha/asm/sha512-armv4.pl | 4 ++-- src/crypto/test/asm/trampoline-armv4.pl | 2 +- src/include/openssl/arm_arch.h | 2 +- 23 files changed, 33 insertions(+), 33 deletions(-) diff --git a/linux-arm/crypto/chacha/chacha-armv4.S b/linux-arm/crypto/chacha/chacha-armv4.S index 4c17124..c0d75fb 100644 --- a/linux-arm/crypto/chacha/chacha-armv4.S +++ b/linux-arm/crypto/chacha/chacha-armv4.S @@ -16,7 +16,7 @@ @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) || defined(__clang__) @@ -808,7 +808,7 @@ ChaCha20_ctr32: ldmia sp!,{r4,r5,r6,r7,r8,r9,r10,r11,pc} .size ChaCha20_ctr32,.-ChaCha20_ctr32 #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .type ChaCha20_neon,%function diff --git a/linux-arm/crypto/fipsmodule/aes-armv4.S b/linux-arm/crypto/fipsmodule/aes-armv4.S index 0a01694..f1822b3 100644 --- a/linux-arm/crypto/fipsmodule/aes-armv4.S +++ b/linux-arm/crypto/fipsmodule/aes-armv4.S @@ -61,7 +61,7 @@ @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. (ARMv8 AES @ instructions are in aesv8-armx.pl.) -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) && !defined(__APPLE__) diff --git a/linux-arm/crypto/fipsmodule/aesv8-armx32.S b/linux-arm/crypto/fipsmodule/aesv8-armx32.S index 42625fe..483514b 100644 --- a/linux-arm/crypto/fipsmodule/aesv8-armx32.S +++ b/linux-arm/crypto/fipsmodule/aesv8-armx32.S @@ -16,7 +16,7 @@ #if __ARM_MAX_ARCH__>=7 .text -.arch armv7-a @ don't confuse not-so-latest binutils with argv8 :-) +.arch armv6 @ don't confuse not-so-latest binutils with argv8 :-) .fpu neon .code 32 #undef __thumb2__ diff --git a/linux-arm/crypto/fipsmodule/armv4-mont.S b/linux-arm/crypto/fipsmodule/armv4-mont.S index 702830a..63b609e 100644 --- a/linux-arm/crypto/fipsmodule/armv4-mont.S +++ b/linux-arm/crypto/fipsmodule/armv4-mont.S @@ -16,7 +16,7 @@ @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) @@ -210,7 +210,7 @@ bn_mul_mont: #endif .size bn_mul_mont,.-bn_mul_mont #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .type bn_mul8x_mont_neon,%function diff --git a/linux-arm/crypto/fipsmodule/bsaes-armv7.S b/linux-arm/crypto/fipsmodule/bsaes-armv7.S index 0ad56bc..33736c9 100644 --- a/linux-arm/crypto/fipsmodule/bsaes-armv7.S +++ b/linux-arm/crypto/fipsmodule/bsaes-armv7.S @@ -84,7 +84,7 @@ #endif #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .text diff --git a/linux-arm/crypto/fipsmodule/ghash-armv4.S b/linux-arm/crypto/fipsmodule/ghash-armv4.S index 16a5283..7cf70fe 100644 --- a/linux-arm/crypto/fipsmodule/ghash-armv4.S +++ b/linux-arm/crypto/fipsmodule/ghash-armv4.S @@ -17,7 +17,7 @@ @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. (ARMv8 PMULL @ instructions are in aesv8-armx.pl.) -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) || defined(__clang__) @@ -367,7 +367,7 @@ gcm_gmult_4bit: #endif .size gcm_gmult_4bit,.-gcm_gmult_4bit #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .globl gcm_init_neon diff --git a/linux-arm/crypto/fipsmodule/sha1-armv4-large.S b/linux-arm/crypto/fipsmodule/sha1-armv4-large.S index 3e44698..718460a 100644 --- a/linux-arm/crypto/fipsmodule/sha1-armv4-large.S +++ b/linux-arm/crypto/fipsmodule/sha1-armv4-large.S @@ -506,7 +506,7 @@ sha1_block_data_order: .align 2 .align 5 #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .type sha1_block_data_order_neon,%function diff --git a/linux-arm/crypto/fipsmodule/sha256-armv4.S b/linux-arm/crypto/fipsmodule/sha256-armv4.S index 4f5739a..7474169 100644 --- a/linux-arm/crypto/fipsmodule/sha256-armv4.S +++ b/linux-arm/crypto/fipsmodule/sha256-armv4.S @@ -67,7 +67,7 @@ @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors. It does have ARMv8-only code, but those @ instructions are manually-encoded. (See unsha256.) -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) @@ -1892,7 +1892,7 @@ sha256_block_data_order: #endif .size sha256_block_data_order,.-sha256_block_data_order #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .globl sha256_block_data_order_neon diff --git a/linux-arm/crypto/fipsmodule/sha512-armv4.S b/linux-arm/crypto/fipsmodule/sha512-armv4.S index 3d1d781..6d56c47 100644 --- a/linux-arm/crypto/fipsmodule/sha512-armv4.S +++ b/linux-arm/crypto/fipsmodule/sha512-armv4.S @@ -79,7 +79,7 @@ @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. -.arch armv7-a +.arch armv6 #ifdef __ARMEL__ # define LO 0 @@ -550,7 +550,7 @@ sha512_block_data_order: #endif .size sha512_block_data_order,.-sha512_block_data_order #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .globl sha512_block_data_order_neon diff --git a/linux-arm/crypto/test/trampoline-armv4.S b/linux-arm/crypto/test/trampoline-armv4.S index 83e8aee..fd2bf94 100644 --- a/linux-arm/crypto/test/trampoline-armv4.S +++ b/linux-arm/crypto/test/trampoline-armv4.S @@ -14,7 +14,7 @@ #endif .syntax unified -.arch armv7-a +.arch armv6 .fpu vfp .text diff --git a/src/crypto/chacha/asm/chacha-armv4.pl b/src/crypto/chacha/asm/chacha-armv4.pl index 2a9a7d7..1c905c9 100755 --- a/src/crypto/chacha/asm/chacha-armv4.pl +++ b/src/crypto/chacha/asm/chacha-armv4.pl @@ -173,7 +173,7 @@ $code.=<<___; @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) || defined(__clang__) @@ -665,7 +665,7 @@ my ($a,$b,$c,$d,$t)=@_; $code.=<<___; #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .type ChaCha20_neon,%function diff --git a/src/crypto/fipsmodule/aes/asm/aes-armv4.pl b/src/crypto/fipsmodule/aes/asm/aes-armv4.pl index f4ae922..586812f 100644 --- a/src/crypto/fipsmodule/aes/asm/aes-armv4.pl +++ b/src/crypto/fipsmodule/aes/asm/aes-armv4.pl @@ -79,7 +79,7 @@ $code=<<___; @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. (ARMv8 AES @ instructions are in aesv8-armx.pl.) -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) && !defined(__APPLE__) diff --git a/src/crypto/fipsmodule/aes/asm/aesv8-armx.pl b/src/crypto/fipsmodule/aes/asm/aesv8-armx.pl index 13f86a0..43237f2 100644 --- a/src/crypto/fipsmodule/aes/asm/aesv8-armx.pl +++ b/src/crypto/fipsmodule/aes/asm/aesv8-armx.pl @@ -60,7 +60,7 @@ $code=<<___; ___ $code.=".arch armv8-a+crypto\n" if ($flavour =~ /64/); $code.=<<___ if ($flavour !~ /64/); -.arch armv7-a // don't confuse not-so-latest binutils with argv8 :-) +.arch armv6 // don't confuse not-so-latest binutils with argv8 :-) .fpu neon .code 32 #undef __thumb2__ diff --git a/src/crypto/fipsmodule/aes/asm/bsaes-armv7.pl b/src/crypto/fipsmodule/aes/asm/bsaes-armv7.pl index d4db3b4..8735793 100644 --- a/src/crypto/fipsmodule/aes/asm/bsaes-armv7.pl +++ b/src/crypto/fipsmodule/aes/asm/bsaes-armv7.pl @@ -725,7 +725,7 @@ $code.=<<___; #endif #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .text diff --git a/src/crypto/fipsmodule/aes/internal.h b/src/crypto/fipsmodule/aes/internal.h index 0cebb04..32578c8 100644 --- a/src/crypto/fipsmodule/aes/internal.h +++ b/src/crypto/fipsmodule/aes/internal.h @@ -42,7 +42,7 @@ OPENSSL_INLINE int vpaes_capable(void) { return (OPENSSL_ia32cap_get()[1] & (1 << (41 - 32))) != 0; } -#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) +#elif false #define HWAES OPENSSL_INLINE int hwaes_capable(void) { return CRYPTO_is_ARMv8_AES_capable(); } diff --git a/src/crypto/fipsmodule/bn/asm/armv4-mont.pl b/src/crypto/fipsmodule/bn/asm/armv4-mont.pl index 2ee389e..cedcf09 100644 --- a/src/crypto/fipsmodule/bn/asm/armv4-mont.pl +++ b/src/crypto/fipsmodule/bn/asm/armv4-mont.pl @@ -99,7 +99,7 @@ $code=<<___; @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) @@ -306,7 +306,7 @@ my ($tinptr,$toutptr,$inner,$outer,$bnptr)=map("r$_",(6..11)); $code.=<<___; #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .type bn_mul8x_mont_neon,%function diff --git a/src/crypto/fipsmodule/modes/asm/ghash-armv4.pl b/src/crypto/fipsmodule/modes/asm/ghash-armv4.pl index 778b543..9b6416a 100644 --- a/src/crypto/fipsmodule/modes/asm/ghash-armv4.pl +++ b/src/crypto/fipsmodule/modes/asm/ghash-armv4.pl @@ -145,7 +145,7 @@ $code=<<___; @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. (ARMv8 PMULL @ instructions are in aesv8-armx.pl.) -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) || defined(__clang__) @@ -429,7 +429,7 @@ ___ $code.=<<___; #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .global gcm_init_neon diff --git a/src/crypto/fipsmodule/modes/internal.h b/src/crypto/fipsmodule/modes/internal.h index dec1e56..c5c7908 100644 --- a/src/crypto/fipsmodule/modes/internal.h +++ b/src/crypto/fipsmodule/modes/internal.h @@ -314,7 +314,7 @@ void gcm_ghash_4bit_mmx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in size_t len); #endif // OPENSSL_X86 -#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) +#elif false #define GHASH_ASM_ARM #define GCM_FUNCREF_4BIT diff --git a/src/crypto/fipsmodule/sha/asm/sha1-armv4-large.pl b/src/crypto/fipsmodule/sha/asm/sha1-armv4-large.pl index 27187dd..53afd58 100644 --- a/src/crypto/fipsmodule/sha/asm/sha1-armv4-large.pl +++ b/src/crypto/fipsmodule/sha/asm/sha1-armv4-large.pl @@ -525,7 +525,7 @@ sub Xloop() $code.=<<___; #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .type sha1_block_data_order_neon,%function diff --git a/src/crypto/fipsmodule/sha/asm/sha256-armv4.pl b/src/crypto/fipsmodule/sha/asm/sha256-armv4.pl index e5ecdfd..43c8d76 100644 --- a/src/crypto/fipsmodule/sha/asm/sha256-armv4.pl +++ b/src/crypto/fipsmodule/sha/asm/sha256-armv4.pl @@ -184,7 +184,7 @@ $code=<<___; @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors. It does have ARMv8-only code, but those @ instructions are manually-encoded. (See unsha256.) -.arch armv7-a +.arch armv6 .text #if defined(__thumb2__) @@ -475,7 +475,7 @@ sub body_00_15 () { $code.=<<___; #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .global sha256_block_data_order_neon diff --git a/src/crypto/fipsmodule/sha/asm/sha512-armv4.pl b/src/crypto/fipsmodule/sha/asm/sha512-armv4.pl index cc247a4..ceac69b 100644 --- a/src/crypto/fipsmodule/sha/asm/sha512-armv4.pl +++ b/src/crypto/fipsmodule/sha/asm/sha512-armv4.pl @@ -210,7 +210,7 @@ $code=<<___; @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. -.arch armv7-a +.arch armv6 #ifdef __ARMEL__ # define LO 0 @@ -606,7 +606,7 @@ ___ $code.=<<___; #if __ARM_MAX_ARCH__>=7 -.arch armv7-a +.arch armv6 .fpu neon .global sha512_block_data_order_neon diff --git a/src/crypto/test/asm/trampoline-armv4.pl b/src/crypto/test/asm/trampoline-armv4.pl index 30f510e..25d7422 100755 --- a/src/crypto/test/asm/trampoline-armv4.pl +++ b/src/crypto/test/asm/trampoline-armv4.pl @@ -49,7 +49,7 @@ my ($func, $state, $argv, $argc) = ("r0", "r1", "r2", "r3"); my $code = <<____; .syntax unified -.arch armv7-a +.arch armv6 .fpu vfp .text diff --git a/src/include/openssl/arm_arch.h b/src/include/openssl/arm_arch.h index faa2655..d37e7bf 100644 --- a/src/include/openssl/arm_arch.h +++ b/src/include/openssl/arm_arch.h @@ -100,7 +100,7 @@ // Even when building for 32-bit ARM, support for aarch64 crypto instructions // will be included. -#define __ARM_MAX_ARCH__ 8 +#define __ARM_MAX_ARCH__ 6 // ARMV7_NEON is true when a NEON unit is present in the current CPU. #define ARMV7_NEON (1 << 0) -- 2.30.2