]> 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)
commit6bc07242088f8445128c9fa6497b7a89ab562710
tree9fd0f2a0b9d3c36998b1af1fcb6efbd52740952d
parent4041ee1c3024c734a18fa838f1d889829246fea6
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