]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: x86/cast6 - Fix RBP usage
authorJosh Poimboeuf <jpoimboe@redhat.com>
Mon, 18 Sep 2017 19:42:03 +0000 (14:42 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 20 Sep 2017 09:42:33 +0000 (17:42 +0800)
commit2c0db14115a905803a69dbe2beeec175915c6c1d
treea107140c131e533b931a9a0e98a742df78feb92d
parentb8f1f7174762ff6afbea756b25846a49868f51b4
crypto: x86/cast6 - Fix RBP usage

Using RBP as a temporary register breaks frame pointer convention and
breaks stack traces when unwinding from an interrupt in the crypto code.

Use R15 instead of RBP.  R15 can't be used as the RID1 register because
of x86 instruction encoding limitations.  So use R15 for CTX and RDI for
CTX.  This means that CTX is no longer an implicit function argument.
Instead it needs to be explicitly copied from RDI.

Reported-by: Eric Biggers <ebiggers@google.com>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Eric Biggers <ebiggers@google.com>
Acked-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/cast6-avx-x86_64-asm_64.S