From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9C71FD8027A for ; Thu, 2 Nov 2023 13:54:36 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=AHTkGtsl1qj5J8tSDNNI+wSCsaULle10rykZCFjvwr0=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698933275; v=1; b=GGMBwRCwd2b4A1dam+smH1Y4Itt9PpKmB8DZnK+l6CuawM/1pJfhirkxKIidKmqAHzakO/68 56wzozyLGj0Dzs1GIlFPdwUfnZLb4+2rTl0UZUzRPlMLGptSOvAPXR94tW9CQ9k/XQdoBP67n3/ PUzl64U3eFrAqsvvTYjec+oM= X-Received: by 127.0.0.2 with SMTP id viafYY7687511xspSQZzBBHA; Thu, 02 Nov 2023 06:54:35 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.31440.1698933274013402662 for ; Thu, 02 Nov 2023 06:54:34 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A04DE2F4; Thu, 2 Nov 2023 06:55:15 -0700 (PDT) X-Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0D1ED3F738; Thu, 2 Nov 2023 06:54:31 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Jiewen Yao , Yi Li , Xiaoyu Lu , Guomin Jiang , Leif Lindholm , Ard Biesheuvel , Sami Mujawar , Gerd Hoffmann Subject: [edk2-devel] [PATCH v1 0/7] CryptoPkg: Enable Openssl native instruction support for AARCH64 Date: Thu, 2 Nov 2023 14:54:10 +0100 Message-Id: <20231102135417.336334-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: OYcG0YK2rrCMX0abveyHwkEOx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=GGMBwRCw; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) Various OpensslLib implementations are available in edk2. The OpensslLibAccel.inf and OpensslLibFullAccel.inf ones use architecture specific instructions, e.g. AESE, PMULL, SHA256H, ..., allowing to improve speed. Enable support for Aarch64's native instructions: - Add ArmReadCntPctReg() and ArmReadIdAA64Isar0Reg() to Aarch64's BaseLib. - Generate Aarch64's specific Openssl functions. - Add a OpensslStub/AArch64Cap.c file to allow Openssl to probe Aarch64 native instruction support. This patch-set only enable support for GCC for now (MSFT support not added). Pierre Gondois (7): MdePkg/BaseLib: AARCH64: Add ArmReadCntPctReg() MdePkg/BaseLib: AARCH64: Add ArmReadIdAA64Isar0Reg() MdePkg/BaseRngLib: Prefer ArmReadIdAA64Isar0Reg() over ArmReadIdIsar0() CryptoPkg/OpensslLib: Add native instruction support for AARCH64 CryptoPkg/OpensslLib: Generate files for AARCH64 native support CryptoPkg/OpensslLib: Add AArch64Cap for arch specific hooks CryptoPkg: Enable Openssl Accel builds for AARCH64 CryptoPkg/CryptoPkg.dsc | 23 +- .../AARCH64-GCC/crypto/aes/aesv8-armx.S | 3180 ++++++++ .../AARCH64-GCC/crypto/aes/vpaes-armv8.S | 1196 +++ .../AARCH64-GCC/crypto/arm64cpuid.S | 129 + .../AARCH64-GCC/crypto/bn/armv8-mont.S | 2124 ++++++ .../crypto/ec/ecp_nistz256-armv8.S | 4242 +++++++++++ .../crypto/modes/aes-gcm-armv8_64.S | 6389 +++++++++++++++++ .../AARCH64-GCC/crypto/modes/ghashv8-armx.S | 552 ++ .../AARCH64-GCC/crypto/sha/keccak1600-armv8.S | 1009 +++ .../AARCH64-GCC/crypto/sha/sha1-armv8.S | 1211 ++++ .../AARCH64-GCC/crypto/sha/sha256-armv8.S | 2051 ++++++ .../AARCH64-GCC/crypto/sha/sha512-armv8.S | 1606 +++++ .../Library/OpensslLib/OpensslLibAccel.inf | 642 +- .../OpensslLib/OpensslLibFullAccel.inf | 691 +- .../OpensslLib/OpensslStub/AArch64Cap.c | 107 + CryptoPkg/Library/OpensslLib/UefiAsm.conf | 6 + CryptoPkg/Library/OpensslLib/configure.py | 5 +- CryptoPkg/Readme.md | 14 +- MdePkg/Include/Library/BaseLib.h | 86 + .../BaseLib/AArch64/ArmReadCntPctReg.S | 30 + .../BaseLib/AArch64/ArmReadCntPctReg.asm | 30 + .../AArch64/ArmReadIdAA64Isar0Reg.S} | 10 +- .../AArch64/ArmReadIdAA64Isar0Reg.asm} | 10 +- MdePkg/Library/BaseLib/BaseLib.inf | 6 +- MdePkg/Library/BaseRngLib/AArch64/ArmRng.h | 12 - MdePkg/Library/BaseRngLib/AArch64/Rndr.c | 14 +- MdePkg/Library/BaseRngLib/BaseRngLib.inf | 2 - 27 files changed, 25320 insertions(+), 57 deletions(-) create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/aes/aesv8-armx.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/aes/vpaes-armv8.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/arm64cpuid.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/bn/armv8-mont.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/ec/ecp_nistz256-armv8.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/modes/aes-gcm-armv8_64.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/modes/ghashv8-armx.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/sha/keccak1600-armv8.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/sha/sha1-armv8.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/sha/sha256-armv8.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslGen/AARCH64-GCC/c= rypto/sha/sha512-armv8.S create mode 100644 CryptoPkg/Library/OpensslLib/OpensslStub/AArch64Cap.c create mode 100644 MdePkg/Library/BaseLib/AArch64/ArmReadCntPctReg.S create mode 100644 MdePkg/Library/BaseLib/AArch64/ArmReadCntPctReg.asm rename MdePkg/Library/{BaseRngLib/AArch64/ArmReadIdIsar0.S =3D> BaseLib/= AArch64/ArmReadIdAA64Isar0Reg.S} (70%) rename MdePkg/Library/{BaseRngLib/AArch64/ArmReadIdIsar0.asm =3D> BaseLi= b/AArch64/ArmReadIdAA64Isar0Reg.asm} (72%) --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110547): https://edk2.groups.io/g/devel/message/110547 Mute This Topic: https://groups.io/mt/102342394/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-