Enable hardware acceleration for the gcry_sha256 module when building for the x86_64 EFI target.
Signed-off-by: Gary Lin <g...@suse.com> --- conf/Makefile.extra-dist | 1 + .../15_build_sha256_x86_64_efi_opt_code.patch | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 grub-core/lib/libgcrypt-patches/15_build_sha256_x86_64_efi_opt_code.patch diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist index 2c78a9712..e8539f77b 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist @@ -49,6 +49,7 @@ EXTRA_DIST += grub-core/lib/libgcrypt-patches/11-kdf-remove-unsupported-kdfs.pat EXTRA_DIST += grub-core/lib/libgcrypt-patches/12-kdf-use-grub_divmod64.patch EXTRA_DIST += grub-core/lib/libgcrypt-patches/13_add_hwfeatures.patch EXTRA_DIST += grub-core/lib/libgcrypt-patches/14_fix_build_shaext.patch +EXTRA_DIST += grub-core/lib/libgcrypt-patches/15_build_sha256_x86_64_efi_opt_code.patch EXTRA_DIST += grub-core/lib/libtasn1-patches/0001-libtasn1-disable-code-not-needed-in-grub.patch EXTRA_DIST += grub-core/lib/libtasn1-patches/0002-libtasn1-replace-strcat-with-strcpy-in-_asn1_str_cat.patch diff --git a/grub-core/lib/libgcrypt-patches/15_build_sha256_x86_64_efi_opt_code.patch b/grub-core/lib/libgcrypt-patches/15_build_sha256_x86_64_efi_opt_code.patch new file mode 100644 index 000000000..8cab9b866 --- /dev/null +++ b/grub-core/lib/libgcrypt-patches/15_build_sha256_x86_64_efi_opt_code.patch @@ -0,0 +1,43 @@ +From 3443b213bb87112144d753678d0f1bbbc72b2b7a Mon Sep 17 00:00:00 2001 +From: Gary Lin <g...@suse.com> +Date: Fri, 18 Jul 2025 15:23:25 +0800 +Subject: [PATCH 3/4] libgcrypt: Add hardware acceleration for gcry_sha256 + +Enable hardware acceleration for the gcry_sha256 module when building +for the x86_64 EFI target. + +Signed-off-by: Gary Lin <g...@suse.com> +--- + grub-core/Makefile.gcry.def | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/grub-core/Makefile.gcry.def b/grub-core/Makefile.gcry.def +index c8caf17dc..ac1d9a088 100644 +--- a/grub-core/Makefile.gcry.def ++++ b/grub-core/Makefile.gcry.def +@@ -17,6 +17,7 @@ module = { + module = { + name = gcry_blake2; + common = lib/libgcrypt-grub/cipher/blake2.c; ++ + cflags = '$(CFLAGS_GCRY)'; + cppflags = '$(CPPFLAGS_GCRY)'; + }; +@@ -172,8 +173,13 @@ module = { + module = { + name = gcry_sha256; + common = lib/libgcrypt-grub/cipher/sha256.c; ++ x86_64_efi = lib/libgcrypt-grub/cipher/sha256-ssse3-amd64.S; ++ x86_64_efi = lib/libgcrypt-grub/cipher/sha256-avx-amd64.S; ++ x86_64_efi = lib/libgcrypt-grub/cipher/sha256-avx2-bmi2-amd64.S; ++ x86_64_efi = lib/libgcrypt-grub/cipher/sha256-intel-shaext.c; ++ + cflags = '$(CFLAGS_GCRY) -Wno-cast-align'; +- cppflags = '$(CPPFLAGS_GCRY)'; ++ cppflags = '$(CPPFLAGS_GCRY) -DUSE_SHA256 $(CPPFLAGS_GCRY_ASM)'; + }; + + module = { +-- +2.51.0 + -- 2.51.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel