Skip to content

Commit f044a84

Browse files
dvyukovherbertx
authored andcommitted
crypto: don't optimize keccakf()
keccakf() is the only function in kernel that uses __optimize() macro. __optimize() breaks frame pointer unwinder as optimized code uses RBP, and amusingly this always lead to degraded performance as gcc does not inline across different optimizations levels, so keccakf() wasn't inlined into its callers and keccakf_round() wasn't inlined into keccakf(). Drop __optimize() to resolve both problems. Signed-off-by: Dmitry Vyukov <[email protected]> Fixes: 83dee2c ("crypto: sha3-generic - rewrite KECCAK transform to help the compiler optimize") Reported-by: [email protected] Reported-by: [email protected] Cc: [email protected] Cc: "David S. Miller" <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Ard Biesheuvel <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 6e88f01 commit f044a84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/sha3_generic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static SHA3_INLINE void keccakf_round(u64 st[25])
152152
st[24] ^= bc[ 4];
153153
}
154154

155-
static void __optimize("O3") keccakf(u64 st[25])
155+
static void keccakf(u64 st[25])
156156
{
157157
int round;
158158

0 commit comments

Comments
 (0)