OSDN Git Service

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)
commit660bb8e1f833ea63185fe80fde847e3e42f18e3b
tree9fd0f2a0b9d3c36998b1af1fcb6efbd52740952d
parentee772cb641135739c1530647391d5a04c39db192
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