All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH v5 5/5] keccak: Disable acceleration with SSE asm
Date: Tue,  3 Sep 2024 20:29:34 +0300	[thread overview]
Message-ID: <20240903172934.26772-5-phcoder@gmail.com> (raw)
In-Reply-To: <20240903172934.26772-1-phcoder@gmail.com>

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..c153518da
--- /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
+@@ -251,7 +251,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


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

  parent reply	other threads:[~2024-09-03 17:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 17:29 [PATCH v5 1/5] Import libgcrypt 1.10.3 Vladimir Serbinenko
2024-09-03 17:29 ` [PATCH v5 2/5] Import b64dec from gpg-error Vladimir Serbinenko
2024-09-03 17:29 ` [PATCH v5 3/5] Adjust import script, definitions and API users for libgcrypt 1.10 Vladimir Serbinenko
2024-09-03 17:29 ` [PATCH v5 4/5] Add DSA and RSA SEXP tests Vladimir Serbinenko
2024-09-03 17:29 ` Vladimir Serbinenko [this message]
2024-09-05 12:53 ` [PATCH v5 1/5] Import libgcrypt 1.10.3 Daniel Kiper
2024-09-08 15:46   ` Vladimir 'phcoder' Serbinenko
  -- strict thread matches above, loose matches on Subject: below --
2024-09-08 15:43 [PATCH v5 1/5] Import libgcrypt 1.11.0 Vladimir Serbinenko
2024-09-08 15:43 ` [PATCH v5 5/5] keccak: Disable acceleration with SSE asm Vladimir Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240903172934.26772-5-phcoder@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.