crypto: x86/blowfish - Fix RBP usage
commit569f11c9f788959b640116b5bbd6d8a1f07326da
authorJosh Poimboeuf <jpoimboe@redhat.com>
Mon, 18 Sep 2017 19:42:00 +0000 (18 14:42 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 20 Sep 2017 09:42:31 +0000 (20 17:42 +0800)
tree491fe651a7daa4fb738224b2e269ce9c8af4dd1d
parentbd6227a150fdb56e7bb734976ef6e53a2c1cb334
crypto: x86/blowfish - 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 R12 instead of RBP.  R12 can't be used as the RT0 register because
of x86 instruction encoding limitations.  So use R12 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/blowfish-x86_64-asm_64.S