linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: hpa@zytor.com
Cc: linux-tip-commits@vger.kernel.org,
	tip-bot for Josh Poimboeuf <tipbot@zytor.com>,
	linux-kernel@vger.kernel.org, bp@alien8.de, tglx@linutronix.de,
	torvalds@linux-foundation.org, peterz@infradead.org,
	luto@kernel.org, mingo@kernel.org, brgerst@gmail.com,
	dvlasenk@redhat.com
Subject: Re: [tip:x86/urgent] x86/boot/64: Use 'push' instead of 'call' in start_cpu()
Date: Wed, 14 Dec 2016 14:13:20 -0600	[thread overview]
Message-ID: <20161214201320.ee2zmymq4u7gzz2j@treble> (raw)
In-Reply-To: <50553B60-057F-46E4-BB93-ADCE7B5F821D@zytor.com>

On Wed, Dec 14, 2016 at 11:24:19AM -0800, hpa@zytor.com wrote:
> On December 14, 2016 12:36:58 AM PST, tip-bot for Josh Poimboeuf <tipbot@zytor.com> wrote:
> >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
> 
> This adds another relocation to the kernel.  I hope this is safe at this point in the code?

AFAIK, it should be fine.  All relocations were either applied at build
time, or for KASLR, in the compressed boot code which extracts and
copies this code.

Also there are already a bunch of relocations in the rest of the code in
this file, all of which runs before this code does.

(And even if that weren't the case, this address is only used for
displaying stack traces, so pushing a zero or some garbage here wouldn't
really break anything.)

-- 
Josh

  reply	other threads:[~2016-12-14 20:13 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:x86/urgent] x86/boot/64: Use " tip-bot for Josh Poimboeuf
2016-12-14 19:24     ` hpa
2016-12-14 20:13       ` Josh Poimboeuf [this message]
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=20161214201320.ee2zmymq4u7gzz2j@treble \
    --to=jpoimboe@redhat.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.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=tipbot@zytor.com \
    --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;
as well as URLs for NNTP newsgroup(s).