Skip to content

Commit

Permalink
x86/asm/crypto: Don't use RBP as a scratch register
Browse files Browse the repository at this point in the history
The frame pointer (RBP) is getting clobbered in
sha1_mb_mgr_submit_avx2() before a function call, which can mess up
stack traces.  Use R12 instead.

Signed-off-by: Josh Poimboeuf <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Bernd Petrovitsch <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Chris J Arges <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Michal Marek <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Pedro Alves <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/15a3eb7ebe68e37755927915f45e4f0bde4d18c5.1453405861.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
jpoimboe authored and Ingo Molnar committed Feb 24, 2016
1 parent aec4d0e commit 68874ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/x86/crypto/sha-mb/sha1_mb_mgr_submit_avx2.S
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ job_rax = %rax
len = %rax
DWORD_len = %eax

lane = %rbp
tmp3 = %rbp
lane = %r12
tmp3 = %r12

tmp = %r9
DWORD_tmp = %r9d
Expand All @@ -99,7 +99,7 @@ lane_data = %r10
# arg 2 : rdx : job
ENTRY(sha1_mb_mgr_submit_avx2)
push %rbx
push %rbp
push %r12

mov _unused_lanes(state), unused_lanes
mov unused_lanes, lane
Expand Down Expand Up @@ -190,7 +190,7 @@ len_is_0:
movl DWORD_tmp, _result_digest+1*16(job_rax)

return:
pop %rbp
pop %r12
pop %rbx
ret

Expand Down

0 comments on commit 68874ac

Please sign in to comment.