aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2016-12-13 22:25:36 -0500
committerIngo Molnar <mingo@kernel.org>2016-12-14 02:48:05 -0500
commit31dcfec11f827e9a5d8720fe4728f1305894884f (patch)
tree07efdae8580b83a64eeb56e8a7d458d7432535cf
parentec2d86a9b646d93f1948569f368e2c6f5449e6c7 (diff)
x86/boot/64: Push correct start_cpu() return address
start_cpu() pushes a text address on the stack so that stack traces from idle tasks will show start_cpu() at the end. But it currently shows the wrong function offset. It's more correct to show the address immediately after the 'lretq' instruction. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/2cadd9f16c77da7ee7957bfc5e1c67928c23ca48.1481685203.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/head_64.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 1facaf4f2308..b467b14b03eb 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -298,12 +298,13 @@ ENTRY(start_cpu)
298 * REX.W + FF /5 JMP m16:64 Jump far, absolute indirect, 298 * REX.W + FF /5 JMP m16:64 Jump far, absolute indirect,
299 * address given in m16:64. 299 * address given in m16:64.
300 */ 300 */
301 pushq $1f # put return address on stack for unwinder 301 pushq $.Lafter_lret # put return address on stack for unwinder
3021: xorq %rbp, %rbp # clear frame pointer 302 xorq %rbp, %rbp # clear frame pointer
303 movq initial_code(%rip), %rax 303 movq initial_code(%rip), %rax
304 pushq $__KERNEL_CS # set correct cs 304 pushq $__KERNEL_CS # set correct cs
305 pushq %rax # target address in negative space 305 pushq %rax # target address in negative space
306 lretq 306 lretq
307.Lafter_lret:
307ENDPROC(start_cpu) 308ENDPROC(start_cpu)
308 309
309#include "verify_cpu.S" 310#include "verify_cpu.S"