]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: lib/curve25519 - work around Clang stack spilling issue
authorArd Biesheuvel <ardb@kernel.org>
Fri, 8 Nov 2019 12:22:35 +0000 (13:22 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 17 Nov 2019 01:02:43 +0000 (09:02 +0800)
commit1da797ab56af943670c1b999f1e9ca4ad87330a1
tree9fd0f2a0b9d3c36998b1af1fcb6efbd52740952d
parent0e12d64d9877d6045ead6c3362cb1d47cc58192c
crypto: lib/curve25519 - work around Clang stack spilling issue

Arnd reports that the 32-bit generic library code for Curve25119 ends
up using an excessive amount of stack space when built with Clang:

  lib/crypto/curve25519-fiat32.c:756:6: error: stack frame size
      of 1384 bytes in function 'curve25519_generic'
      [-Werror,-Wframe-larger-than=]

Let's give some hints to the compiler regarding which routines should
not be inlined, to prevent it from running out of registers and spilling
to the stack. The resulting code performs identically under both GCC
and Clang, and makes the warning go away.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
lib/crypto/curve25519-fiat32.c