lkml.org 
[lkml]   [2016]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/urgent] x86/boot/64: Use 'push' instead of 'call' in start_cpu()
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

\
 
 \ /
  Last update: 2016-12-14 21:13    [W:0.078 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site