Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933248AbcLNUNY (ORCPT ); Wed, 14 Dec 2016 15:13:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48102 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbcLNUNW (ORCPT ); Wed, 14 Dec 2016 15:13:22 -0500 Date: Wed, 14 Dec 2016 14:13:20 -0600 From: Josh Poimboeuf To: hpa@zytor.com Cc: linux-tip-commits@vger.kernel.org, tip-bot for Josh Poimboeuf , 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() Message-ID: <20161214201320.ee2zmymq4u7gzz2j@treble> References: <4d8a1952759721d42d1e62ba9e4a7e3ac5df8574.1481685203.git.jpoimboe@redhat.com> <50553B60-057F-46E4-BB93-ADCE7B5F821D@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50553B60-057F-46E4-BB93-ADCE7B5F821D@zytor.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 14 Dec 2016 20:13:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1266 Lines: 31 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 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