[edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction support for IA32

Christopher Zurcher posted 3 patches 6 days, 6 hours ago
Failed in applying to current master (apply log)
CryptoPkg/CryptoPkg.ci.yaml                                   |    4 +
CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm   | 3212 +++++++++++++++++++
CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm   |  651 ++++
CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm |  700 ++++
CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-586.nasm    | 1394 ++++++++
CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm  | 3364 ++++++++++++++++++++
CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm  |  579 ++++
CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm        |  433 +++
CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S   | 3247 +++++++++++++++++++
CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S   |  670 ++++
CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S |  703 ++++
CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S    | 1389 ++++++++
CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S  | 3356 +++++++++++++++++++
CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S  |  574 ++++
CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S        |  449 +++
CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf               |  699 ++++
CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf            |  699 ++++
CryptoPkg/Library/OpensslLib/OpensslLibX64.inf                |   53 +
CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf             |   53 +
CryptoPkg/Library/OpensslLib/UefiAsm.conf                     |   18 +
CryptoPkg/Library/OpensslLib/process_files.pl                 |   12 +
21 files changed, 22259 insertions(+)
create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm
create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm
create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm
create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-586.nasm
create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm
create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm
create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm
create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S
create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S
create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S
create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S
create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S
create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S
create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S
create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf
create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf
[edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction support for IA32
Posted by Christopher Zurcher 6 days, 6 hours ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3654
PR: https://github.com/tianocore/edk2/pull/3352

This patch adds support for building the native instruction algorithms for
the IA32 architecture in OpensslLib. The base variant has been tested
with VS2019 and CLANGPDB toolchains, and a GCC variant is also provided.

The implementation here follows the previous implementation of X64
native instructions as committed in 878a92a887.

Cc: Yi Li <yi1.li@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>

Christopher Zurcher (3):
  CryptoPkg/OpensslLib: Add native instruction support for IA32
  CryptoPkg/OpensslLib: Commit the auto-generated assembly files for
    IA32
  CryptoPkg/OpensslLib: Update generated files for native X64

 CryptoPkg/CryptoPkg.ci.yaml                                   |    4 +
 CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm   | 3212 +++++++++++++++++++
 CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm   |  651 ++++
 CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm |  700 ++++
 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-586.nasm    | 1394 ++++++++
 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm  | 3364 ++++++++++++++++++++
 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm  |  579 ++++
 CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm        |  433 +++
 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S   | 3247 +++++++++++++++++++
 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S   |  670 ++++
 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S |  703 ++++
 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S    | 1389 ++++++++
 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S  | 3356 +++++++++++++++++++
 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S  |  574 ++++
 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S        |  449 +++
 CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf               |  699 ++++
 CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf            |  699 ++++
 CryptoPkg/Library/OpensslLib/OpensslLibX64.inf                |   53 +
 CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf             |   53 +
 CryptoPkg/Library/OpensslLib/UefiAsm.conf                     |   18 +
 CryptoPkg/Library/OpensslLib/process_files.pl                 |   12 +
 21 files changed, 22259 insertions(+)
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-586.nasm
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S
 create mode 100644 CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S
 create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf
 create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf

-- 
2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94140): https://edk2.groups.io/g/devel/message/94140
Mute This Topic: https://groups.io/mt/93840046/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction support for IA32
Posted by Yao, Jiewen 6 days, 2 hours ago
Thanks.
Would you please add more detailed description on what test you have done?

e.g. Real platform? Unit Test? Etc.

> -----Original Message-----
> From: Christopher Zurcher <zurcher@gmail.com>
> Sent: Thursday, September 22, 2022 4:26 AM
> To: devel@edk2.groups.io
> Cc: Li, Yi1 <yi1.li@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Wang,
> Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>; Jiang,
> Guomin <guomin.jiang@intel.com>
> Subject: [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction
> support for IA32
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3654
> PR: https://github.com/tianocore/edk2/pull/3352
> 
> This patch adds support for building the native instruction algorithms for
> the IA32 architecture in OpensslLib. The base variant has been tested
> with VS2019 and CLANGPDB toolchains, and a GCC variant is also provided.
> 
> The implementation here follows the previous implementation of X64
> native instructions as committed in 878a92a887.
> 
> Cc: Yi Li <yi1.li@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
> Cc: Guomin Jiang <guomin.jiang@intel.com>
> 
> Christopher Zurcher (3):
>   CryptoPkg/OpensslLib: Add native instruction support for IA32
>   CryptoPkg/OpensslLib: Commit the auto-generated assembly files for
>     IA32
>   CryptoPkg/OpensslLib: Update generated files for native X64
> 
>  CryptoPkg/CryptoPkg.ci.yaml                                   |    4 +
>  CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm   | 3212
> +++++++++++++++++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm   |  651
> ++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm |  700
> ++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-586.nasm    | 1394
> ++++++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm  | 3364
> ++++++++++++++++++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm  |  579
> ++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm        |  433 +++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S   | 3247
> +++++++++++++++++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S   |  670
> ++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S |  703
> ++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S    | 1389
> ++++++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S  | 3356
> +++++++++++++++++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S  |  574
> ++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S        |  449 +++
>  CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf               |  699 ++++
>  CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf            |  699 ++++
>  CryptoPkg/Library/OpensslLib/OpensslLibX64.inf                |   53 +
>  CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf             |   53 +
>  CryptoPkg/Library/OpensslLib/UefiAsm.conf                     |   18 +
>  CryptoPkg/Library/OpensslLib/process_files.pl                 |   12 +
>  21 files changed, 22259 insertions(+)
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm
>  create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-
> 586.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S
>  create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf
>  create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf
> 
> --
> 2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94096): https://edk2.groups.io/g/devel/message/94096
Mute This Topic: https://groups.io/mt/93840046/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction support for IA32
Posted by Christopher Zurcher 6 days, 1 hour ago
I have verified performance gains and functional integrity in SHA256, SHA384, and SHA512 hashing as well as AES encryption on Intel hardware as well as QEMU. The assembly implementations included with this patch are limited to SHA and AES to reduce size impact, and to match the currently-available accelerations in the X64 equivalent library. These flows have also been validated on in-market hardware. Previous benchmarking of this code demonstrated a 12x speed improvement for SHA256 compared to the base algorithm.

Thanks,
Christopher Zurcher

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao, Jiewen
Sent: Wednesday, September 21, 2022 17:54
To: Christopher Zurcher <zurcher@gmail.com>; devel@edk2.groups.io
Cc: Li, Yi1 <yi1.li@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction support for IA32

Thanks.
Would you please add more detailed description on what test you have done?

e.g. Real platform? Unit Test? Etc.

> -----Original Message-----
> From: Christopher Zurcher <zurcher@gmail.com>
> Sent: Thursday, September 22, 2022 4:26 AM
> To: devel@edk2.groups.io
> Cc: Li, Yi1 <yi1.li@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; 
> Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1 
> <xiaoyu1.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
> Subject: [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction 
> support for IA32
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3654
> PR: https://github.com/tianocore/edk2/pull/3352
> 
> This patch adds support for building the native instruction algorithms 
> for the IA32 architecture in OpensslLib. The base variant has been 
> tested with VS2019 and CLANGPDB toolchains, and a GCC variant is also provided.
> 
> The implementation here follows the previous implementation of X64 
> native instructions as committed in 878a92a887.
> 
> Cc: Yi Li <yi1.li@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
> Cc: Guomin Jiang <guomin.jiang@intel.com>
> 
> Christopher Zurcher (3):
>   CryptoPkg/OpensslLib: Add native instruction support for IA32
>   CryptoPkg/OpensslLib: Commit the auto-generated assembly files for
>     IA32
>   CryptoPkg/OpensslLib: Update generated files for native X64
> 
>  CryptoPkg/CryptoPkg.ci.yaml                                   |    4 +
>  CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm   | 3212
> +++++++++++++++++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm   |  651
> ++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm |  700
> ++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-586.nasm    | 1394
> ++++++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm  | 3364
> ++++++++++++++++++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm  |  579
> ++++
>  CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm        |  433 +++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S   | 3247
> +++++++++++++++++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S   |  670
> ++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S |  703
> ++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S    | 1389
> ++++++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S  | 3356
> +++++++++++++++++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S  |  574
> ++++
>  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S        |  449 +++
>  CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf               |  699 ++++
>  CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf            |  699 ++++
>  CryptoPkg/Library/OpensslLib/OpensslLibX64.inf                |   53 +
>  CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf             |   53 +
>  CryptoPkg/Library/OpensslLib/UefiAsm.conf                     |   18 +
>  CryptoPkg/Library/OpensslLib/process_files.pl                 |   12 +
>  21 files changed, 22259 insertions(+)  create mode 100644 
> CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm
>  create mode 100644 CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-
> 586.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S
>  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S
>  create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf
>  create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf
> 
> --
> 2.29.2.windows.2








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94097): https://edk2.groups.io/g/devel/message/94097
Mute This Topic: https://groups.io/mt/93840046/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction support for IA32
Posted by Yao, Jiewen 4 days, 16 hours ago
Thank you very much!

Reviewed-by: Jiewen Yao <jiewe.yao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> Christopher Zurcher
> Sent: Thursday, September 22, 2022 9:45 AM
> To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@intel.com>;
> Christopher Zurcher <zurcher@gmail.com>
> Cc: Li, Yi1 <yi1.li@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu,
> Xiaoyu1 <xiaoyu1.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
> Subject: Re: [edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native
> instruction support for IA32
> 
> I have verified performance gains and functional integrity in SHA256,
> SHA384, and SHA512 hashing as well as AES encryption on Intel hardware
> as well as QEMU. The assembly implementations included with this patch
> are limited to SHA and AES to reduce size impact, and to match the
> currently-available accelerations in the X64 equivalent library. These flows
> have also been validated on in-market hardware. Previous benchmarking of
> this code demonstrated a 12x speed improvement for SHA256 compared to
> the base algorithm.
> 
> Thanks,
> Christopher Zurcher
> 
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao,
> Jiewen
> Sent: Wednesday, September 21, 2022 17:54
> To: Christopher Zurcher <zurcher@gmail.com>; devel@edk2.groups.io
> Cc: Li, Yi1 <yi1.li@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Lu,
> Xiaoyu1 <xiaoyu1.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
> Subject: Re: [edk2-devel] [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native
> instruction support for IA32
> 
> Thanks.
> Would you please add more detailed description on what test you have
> done?
> 
> e.g. Real platform? Unit Test? Etc.
> 
> > -----Original Message-----
> > From: Christopher Zurcher <zurcher@gmail.com>
> > Sent: Thursday, September 22, 2022 4:26 AM
> > To: devel@edk2.groups.io
> > Cc: Li, Yi1 <yi1.li@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> > Wang, Jian J <jian.j.wang@intel.com>; Lu, Xiaoyu1
> > <xiaoyu1.lu@intel.com>; Jiang, Guomin <guomin.jiang@intel.com>
> > Subject: [PATCH v1 0/3] CryptoPkg/OpensslLib: Add native instruction
> > support for IA32
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3654
> > PR: https://github.com/tianocore/edk2/pull/3352
> >
> > This patch adds support for building the native instruction algorithms
> > for the IA32 architecture in OpensslLib. The base variant has been
> > tested with VS2019 and CLANGPDB toolchains, and a GCC variant is also
> provided.
> >
> > The implementation here follows the previous implementation of X64
> > native instructions as committed in 878a92a887.
> >
> > Cc: Yi Li <yi1.li@intel.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Xiaoyu Lu <xiaoyu1.lu@intel.com>
> > Cc: Guomin Jiang <guomin.jiang@intel.com>
> >
> > Christopher Zurcher (3):
> >   CryptoPkg/OpensslLib: Add native instruction support for IA32
> >   CryptoPkg/OpensslLib: Commit the auto-generated assembly files for
> >     IA32
> >   CryptoPkg/OpensslLib: Update generated files for native X64
> >
> >  CryptoPkg/CryptoPkg.ci.yaml                                   |    4 +
> >  CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm   | 3212
> > +++++++++++++++++++
> >  CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm   |  651
> > ++++
> >  CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm |
> 700
> > ++++
> >  CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-586.nasm    | 1394
> > ++++++++
> >  CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm  |
> 3364
> > ++++++++++++++++++++
> >  CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm  |
> 579
> > ++++
> >  CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm        |  433
> +++
> >  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S   | 3247
> > +++++++++++++++++++
> >  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S   |  670
> > ++++
> >  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S |
> 703
> > ++++
> >  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S    | 1389
> > ++++++++
> >  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S  |
> 3356
> > +++++++++++++++++++
> >  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S  |  574
> > ++++
> >  CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S        |  449
> +++
> >  CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf               |  699 ++++
> >  CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf            |  699 ++++
> >  CryptoPkg/Library/OpensslLib/OpensslLibX64.inf                |   53 +
> >  CryptoPkg/Library/OpensslLib/OpensslLibX64Gcc.inf             |   53 +
> >  CryptoPkg/Library/OpensslLib/UefiAsm.conf                     |   18 +
> >  CryptoPkg/Library/OpensslLib/process_files.pl                 |   12 +
> >  21 files changed, 22259 insertions(+)  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32/crypto/aes/aesni-x86.nasm
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32/crypto/aes/vpaes-x86.nasm
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32/crypto/modes/ghash-x86.nasm
> >  create mode 100644
> CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha1-
> > 586.nasm
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha256-586.nasm
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32/crypto/sha/sha512-586.nasm
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32/crypto/x86cpuid.nasm
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/aesni-x86.S
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/aes/vpaes-x86.S
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/modes/ghash-x86.S
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha1-586.S
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha256-586.S
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/sha/sha512-586.S
> >  create mode 100644
> > CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S
> >  create mode 100644 CryptoPkg/Library/OpensslLib/OpensslLibIa32.inf
> >  create mode 100644
> CryptoPkg/Library/OpensslLib/OpensslLibIa32Gcc.inf
> >
> > --
> > 2.29.2.windows.2
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94213): https://edk2.groups.io/g/devel/message/94213
Mute This Topic: https://groups.io/mt/93840046/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-