From patchwork Wed Oct 16 14:22:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fathi Boudra X-Patchwork-Id: 21073 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B546B202E6 for ; Wed, 16 Oct 2013 14:22:29 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id bj1sf1573379pad.11 for ; Wed, 16 Oct 2013 07:22:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=9ImxBhOCEQ7gjQm0sStWNU+DSoUxITrvi/NoFhQqVIs=; b=UQ6ipsNWz5aiugACydDtigrrFa8AOgIuV2JsqeIH8hbLsh/wVbTXkrnpMKGDX3I0FF 2eJDqFjA1iAubF5a/wM214Qj4uWN4w40EOZBIT9pc69i2iiI5/LeJxAwJ51p9Iqyit/I eQ6wyq5oH/RAuW0LV++6U9vvCVikvxHyOs+IcfQf52vOC7CkY80wHQTqqyJZgx2tiQQ4 ClXFpnrBDa3m1zHgtZ1w0Dl5oAxVZ+vEY9XddvNbtDFN13R0Z3/Fk2ox3tnmZ8Wd1AQP 5fbZxeoD6x7c6QBivziaHut4qD4PfUO+H7F8pt3nJItt5P1JjyqRggBY553B9fB/xUw7 GiJw== X-Received: by 10.67.3.34 with SMTP id bt2mr1224394pad.41.1381933348651; Wed, 16 Oct 2013 07:22:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.59.82 with SMTP id x18ls538208qeq.88.gmail; Wed, 16 Oct 2013 07:22:28 -0700 (PDT) X-Received: by 10.58.210.66 with SMTP id ms2mr2611704vec.10.1381933348498; Wed, 16 Oct 2013 07:22:28 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id gw7si5304424veb.0.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Oct 2013 07:22:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id c14so421075vea.33 for ; Wed, 16 Oct 2013 07:22:28 -0700 (PDT) X-Gm-Message-State: ALoCoQn48TsD8/rD9760azDzBYPA2ZWuBC6TKpKryQWVhNXaxlQ/YdVjXVjmIqgD0zZr3NlHEe2l X-Received: by 10.220.186.202 with SMTP id ct10mr2621421vcb.14.1381933348330; Wed, 16 Oct 2013 07:22:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp42867vcz; Wed, 16 Oct 2013 07:22:27 -0700 (PDT) X-Received: by 10.152.22.131 with SMTP id d3mr2057176laf.35.1381933346851; Wed, 16 Oct 2013 07:22:26 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by mx.google.com with ESMTPS id l3si33660596lam.5.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Oct 2013 07:22:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.51 is neither permitted nor denied by best guess record for domain of fathi.boudra@linaro.org) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id hp15so616808lab.24 for ; Wed, 16 Oct 2013 07:22:26 -0700 (PDT) X-Received: by 10.152.8.51 with SMTP id o19mr1654818laa.42.1381933345915; Wed, 16 Oct 2013 07:22:25 -0700 (PDT) Received: from localhost.localdomain (a91-152-78-194.elisa-laajakaista.fi. [91.152.78.194]) by mx.google.com with ESMTPSA id u20sm51356764lbh.7.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Oct 2013 07:22:25 -0700 (PDT) From: Fathi Boudra To: openembedded-core@lists.openembedded.org Cc: Koen Kooi , Fathi Boudra Subject: [PATCH 1/1] openssl: use linux-generic64 target for Aarch64 (LE and BE) Date: Wed, 16 Oct 2013 17:22:15 +0300 Message-Id: <1381933335-11489-1-git-send-email-fathi.boudra@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: fathi.boudra@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Update configure-targets.patch: - drop linux-aarch64 configuration Update do_configure(): - add linux-aarch64 case and use linux-generic64 target Backport initial-aarch64-bits.patch: - first order optimizations for Aarch64 Signed-off-by: Fathi Boudra --- .../openssl/openssl-1.0.1e/configure-targets.patch | 13 +-- .../openssl-1.0.1e/initial-aarch64-bits.patch | 111 +++++++++++++++++++++ meta/recipes-connectivity/openssl/openssl.inc | 3 + .../recipes-connectivity/openssl/openssl_1.0.1e.bb | 1 + 4 files changed, 120 insertions(+), 8 deletions(-) create mode 100644 meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch diff --git a/meta/recipes-connectivity/openssl/openssl-1.0.1e/configure-targets.patch b/meta/recipes-connectivity/openssl/openssl-1.0.1e/configure-targets.patch index 8c638b4..c1f3d08 100644 --- a/meta/recipes-connectivity/openssl/openssl-1.0.1e/configure-targets.patch +++ b/meta/recipes-connectivity/openssl/openssl-1.0.1e/configure-targets.patch @@ -4,14 +4,12 @@ The number of colons are important :) --- - Configure | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) + Configure | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) -Index: openssl-1.0.1e/Configure -=================================================================== ---- openssl-1.0.1e.orig/Configure -+++ openssl-1.0.1e/Configure -@@ -403,6 +403,23 @@ my %table=( +--- a/Configure ++++ b/Configure +@@ -403,6 +403,22 @@ my %table=( "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", @@ -22,7 +20,6 @@ Index: openssl-1.0.1e/Configure +"linux-gnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-uclibceabi-arm","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-uclibceabi-armeb","$ENV{'CC'}:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -+"linux-aarch64","$ENV{'CC'}:-DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -Wall -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +"linux-avr32","$ENV{'CC'}:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).", + diff --git a/meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch b/meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch new file mode 100644 index 0000000..703b8c1 --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch @@ -0,0 +1,111 @@ +From: Andy Polyakov +Date: Sun, 13 Oct 2013 17:15:15 +0000 (+0200) +Subject: Initial aarch64 bits. +X-Git-Url: http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=039081b80977e2a5de84e1f88f8b4d025b559956 + +Initial aarch64 bits. +--- + crypto/bn/bn_lcl.h | 9 +++++++++ + crypto/md32_common.h | 18 ++++++++++++++++++ + crypto/modes/modes_lcl.h | 8 ++++++++ + crypto/sha/sha512.c | 13 +++++++++++++ + 4 files changed, 48 insertions(+) + +--- a/crypto/bn/bn_lcl.h ++++ b/crypto/bn/bn_lcl.h +@@ -300,6 +300,15 @@ extern "C" { + : "r"(a), "r"(b)); + # endif + # endif ++# elif defined(__aarch64__) && defined(SIXTY_FOUR_BIT_LONG) ++# if defined(__GNUC__) && __GNUC__>=2 ++# define BN_UMULT_HIGH(a,b) ({ \ ++ register BN_ULONG ret; \ ++ asm ("umulh %0,%1,%2" \ ++ : "=r"(ret) \ ++ : "r"(a), "r"(b)); \ ++ ret; }) ++# endif + # endif /* cpu */ + #endif /* OPENSSL_NO_ASM */ + +--- a/crypto/md32_common.h ++++ b/crypto/md32_common.h +@@ -213,6 +213,24 @@ + asm ("bswapl %0":"=r"(r):"0"(r)); \ + *((unsigned int *)(c))=r; (c)+=4; r; }) + # endif ++# elif defined(__aarch64__) ++# if defined(__BYTE_ORDER__) ++# if defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__ ++# define HOST_c2l(c,l) ({ unsigned int r; \ ++ asm ("rev %w0,%w1" \ ++ :"=r"(r) \ ++ :"r"(*((const unsigned int *)(c))));\ ++ (c)+=4; (l)=r; }) ++# define HOST_l2c(l,c) ({ unsigned int r; \ ++ asm ("rev %w0,%w1" \ ++ :"=r"(r) \ ++ :"r"((unsigned int)(l)));\ ++ *((unsigned int *)(c))=r; (c)+=4; r; }) ++# elif defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ ++# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, (l)) ++# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l)) ++# endif ++# endif + # endif + # endif + #endif +--- a/crypto/modes/modes_lcl.h ++++ b/crypto/modes/modes_lcl.h +@@ -29,6 +29,7 @@ typedef unsigned char u8; + #if defined(__i386) || defined(__i386__) || \ + defined(__x86_64) || defined(__x86_64__) || \ + defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \ ++ defined(__aarch64__) || \ + defined(__s390__) || defined(__s390x__) || \ + ( (defined(__arm__) || defined(__arm)) && \ + (defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ +@@ -53,6 +54,13 @@ typedef unsigned char u8; + # define BSWAP4(x) ({ u32 ret=(x); \ + asm ("bswapl %0" \ + : "+r"(ret)); ret; }) ++# elif defined(__aarch64__) ++# define BSWAP8(x) ({ u64 ret; \ ++ asm ("rev %0,%1" \ ++ : "=r"(ret) : "r"(x)); ret; }) ++# define BSWAP4(x) ({ u32 ret; \ ++ asm ("rev %w0,%w1" \ ++ : "=r"(ret) : "r"(x)); ret; }) + # elif (defined(__arm__) || defined(__arm)) && !defined(STRICT_ALIGNMENT) + # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ + asm ("rev %0,%0; rev %1,%1" \ +--- a/crypto/sha/sha512.c ++++ b/crypto/sha/sha512.c +@@ -55,6 +55,7 @@ const char SHA512_version[]="SHA-512" OP + #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ + defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || \ + defined(__s390__) || defined(__s390x__) || \ ++ defined(__aarch64__) || \ + defined(SHA512_ASM) + #define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA + #endif +@@ -340,6 +341,18 @@ static const SHA_LONG64 K512[80] = { + asm ("rotrdi %0,%1,%2" \ + : "=r"(ret) \ + : "r"(a),"K"(n)); ret; }) ++# elif defined(__aarch64__) ++# define ROTR(a,n) ({ SHA_LONG64 ret; \ ++ asm ("ror %0,%1,%2" \ ++ : "=r"(ret) \ ++ : "r"(a),"I"(n)); ret; }) ++# if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ ++ __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__ ++# define PULL64(x) ({ SHA_LONG64 ret; \ ++ asm ("rev %0,%1" \ ++ : "=r"(ret) \ ++ : "r"(*((const SHA_LONG64 *)(&(x))))); ret; }) ++# endif + # endif + # elif defined(_MSC_VER) + # if defined(_WIN64) /* applies to both IA-64 and AMD64 */ diff --git a/meta/recipes-connectivity/openssl/openssl.inc b/meta/recipes-connectivity/openssl/openssl.inc index 78ff7ae..73a890c 100644 --- a/meta/recipes-connectivity/openssl/openssl.inc +++ b/meta/recipes-connectivity/openssl/openssl.inc @@ -66,6 +66,9 @@ do_configure () { linux-armeb) target=linux-elf-armeb ;; + linux-aarch64) + target=linux-generic64 + ;; linux-sh3) target=debian-sh3 ;; diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb b/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb index ac27dba..a574e81 100644 --- a/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb +++ b/meta/recipes-connectivity/openssl/openssl_1.0.1e.bb @@ -33,6 +33,7 @@ SRC_URI += "file://configure-targets.patch \ file://fix-cipher-des-ede3-cfb1.patch \ file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \ file://openssl-avoid-NULL-pointer-dereference-in-dh_pub_encode.patch \ + file://initial-aarch64-bits.patch \ file://find.pl \ "