[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 5/6] keccak: Disable acceleration with SSE asm
From: |
Vladimir Serbinenko |
Subject: |
[PATCH v6 5/6] keccak: Disable acceleration with SSE asm |
Date: |
Wed, 11 Sep 2024 12:34:20 +0300 |
Libgcrypt code assumes that on x64 all SSE registers are fair game.
While it's true that CPUs in question support it, we disable it in
our compilation options. Disable the offending optimization.
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
.../lib/libgcrypt-patches/02_keccak_sse.patch | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 grub-core/lib/libgcrypt-patches/02_keccak_sse.patch
diff --git a/grub-core/lib/libgcrypt-patches/02_keccak_sse.patch
b/grub-core/lib/libgcrypt-patches/02_keccak_sse.patch
new file mode 100644
index 000000000..9605bda48
--- /dev/null
+++ b/grub-core/lib/libgcrypt-patches/02_keccak_sse.patch
@@ -0,0 +1,23 @@
+commit b0cf06271da5fe20360953a53a47c69da89669cd
+Author: Vladimir Serbinenko <phcoder@gmail.com>
+Date: Sun Apr 7 06:33:11 2024 +0300
+
+ keccak: Disable acceleration with SSE asm
+
+ Libgcrypt code assumes that on x64 all SSE registers are fair game.
+ While it's true that CPUs in question support it, we disable it in
+ our compilation options. Disable the offending optimization.
+
+diff --git a/grub-core/lib/libgcrypt/cipher/keccak.c
b/grub-core/lib/libgcrypt/cipher/keccak.c
+index 11e64b3e7..8b570263b 100644
+--- a/grub-core/lib/libgcrypt-grub/cipher/keccak.c
++++ b/grub-core/lib/libgcrypt-grub/cipher/keccak.c
+@@ -275,7 +275,7 @@ keccak_absorb_lane32bi(u32 *lane, u32 x0, u32 x1)
+ /* Construct generic 64-bit implementation. */
+ #ifdef USE_64BIT
+
+-#if __GNUC__ >= 4 && defined(__x86_64__)
++#if __GNUC__ >= 4 && defined(__x86_64__) && 0
+
+ static inline void absorb_lanes64_8(u64 *dst, const byte *in)
+ {
--
2.39.2
- [PATCH v6 1/6] Import libgcrypt 1.11.0, Vladimir Serbinenko, 2024/09/11
- [PATCH v6 2/6] Import b64dec from gpg-error, Vladimir Serbinenko, 2024/09/11
- [PATCH v6 4/6] Add DSA and RSA SEXP tests, Vladimir Serbinenko, 2024/09/11
- [PATCH v6 5/6] keccak: Disable acceleration with SSE asm,
Vladimir Serbinenko <=
- [PATCH v6 3/6] Adjust import script, definitions and API users for libgcrypt 1.11, Vladimir Serbinenko, 2024/09/11
- [PATCH v6 6/6] Implement __aeabi_uldivmod, Vladimir Serbinenko, 2024/09/11