The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: tip-bot for Josh Poimboeuf <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, bp@alien8.de,
	tglx@linutronix.de, torvalds@linux-foundation.org,
	peterz@infradead.org, luto@kernel.org, jpoimboe@redhat.com,
	mingo@kernel.org, brgerst@gmail.com, dvlasenk@redhat.com
Subject: [tip:x86/urgent] x86/boot/64: Use 'push' instead of 'call' in start_cpu()
Date: Wed, 14 Dec 2016 00:36:58 -0800	[thread overview]
Message-ID: <tip-ec2d86a9b646d93f1948569f368e2c6f5449e6c7@git.kernel.org> (raw)
In-Reply-To: <4d8a1952759721d42d1e62ba9e4a7e3ac5df8574.1481685203.git.jpoimboe@redhat.com>

Commit-ID:  ec2d86a9b646d93f1948569f368e2c6f5449e6c7
Gitweb:     http://git.kernel.org/tip/ec2d86a9b646d93f1948569f368e2c6f5449e6c7
Author:     Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Tue, 13 Dec 2016 21:25:35 -0600
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 14 Dec 2016 08:48:05 +0100

x86/boot/64: Use 'push' instead of 'call' in start_cpu()

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 uses a call
instruction to do that, which is rather obtuse.  Use a straightforward
push instead.

Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
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/4d8a1952759721d42d1e62ba9e4a7e3ac5df8574.1481685203.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/head_64.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 90de288..1facaf4 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -298,7 +298,7 @@ ENTRY(start_cpu)
 	 *	REX.W + FF /5 JMP m16:64 Jump far, absolute indirect,
 	 *		address given in m16:64.
 	 */
-	call	1f		# put return address on stack for unwinder
+	pushq	$1f		# put return address on stack for unwinder
 1:	xorq	%rbp, %rbp	# clear frame pointer
 	movq	initial_code(%rip), %rax
 	pushq	$__KERNEL_CS	# set correct cs

  reply	other threads:[~2016-12-14  8:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14  3:25 [PATCH 0/2] x86/boot/64: a couple of start_cpu() cleanups Josh Poimboeuf
2016-12-14  3:25 ` [PATCH 1/2] x86/boot/64: use 'push' instead of 'call' in start_cpu() Josh Poimboeuf
2016-12-14  8:36   ` tip-bot for Josh Poimboeuf [this message]
2016-12-14 19:24     ` [tip:x86/urgent] x86/boot/64: Use " hpa
2016-12-14 20:13       ` Josh Poimboeuf
2016-12-14  3:25 ` [PATCH 2/2] x86/boot/64: push correct start_cpu() return address Josh Poimboeuf
2016-12-14  8:37   ` [tip:x86/urgent] x86/boot/64: Push " tip-bot for Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-ec2d86a9b646d93f1948569f368e2c6f5449e6c7@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox