Skip to content

Commit

Permalink
[NFCI] Move Keccak rhotates tables to rodata
Browse files Browse the repository at this point in the history
rhotates tables are placed to .text section which confuses tools such as
BOLT. Move them to rodata to unbreak and avoid polluting icache/iTLB
with data.

1. Update patch file using the steps in scripts/copy_from_xkcp/README
2. Apply the updated patch with scripts/copy_from_xkcp/package.sh

Sync with XKCP upstream: XKCP/XKCP#137
Similar fix in OpenSSL: openssl/openssl#21440
Redo of #1508

Signed-off-by: Amir Ayupov <aaupov@fb.com>
  • Loading branch information
aaupov authored and dstebila committed Apr 2, 2024
1 parent 36be574 commit 3dd478e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
pop %rcx
pop %rdx
pop %rsi
@@ -1010,9 +1038,9 @@
@@ -1010,10 +1038,13 @@
cmp %rsi, %rcx
jae KeccakP1600_12rounds_FastLoop_Absorb_Not17Lanes
jmp KeccakP1600_12rounds_FastLoop_Absorb_Exit
Expand All @@ -384,6 +384,9 @@
-.endif
+#endif

+#ifndef old_gas_syntax
+.section .rodata
+#endif
.equ ALLON, 0xFFFFFFFFFFFFFFFF


Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,9 @@ KeccakP1600_12rounds_FastLoop_Absorb_LanesAddLoop:
.size KeccakP1600_12rounds_FastLoop_Absorb,.-KeccakP1600_12rounds_FastLoop_Absorb
#endif

#ifndef old_gas_syntax
.section .rodata
#endif
.equ ALLON, 0xFFFFFFFFFFFFFFFF

.balign 64
Expand Down

0 comments on commit 3dd478e

Please sign in to comment.