Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755153AbcLNIiw (ORCPT ); Wed, 14 Dec 2016 03:38:52 -0500 Received: from terminus.zytor.com ([198.137.202.10]:37294 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754867AbcLNIiV (ORCPT ); Wed, 14 Dec 2016 03:38:21 -0500 Date: Wed, 14 Dec 2016 00:37:31 -0800 From: tip-bot for Josh Poimboeuf Message-ID: Cc: jpoimboe@redhat.com, dvlasenk@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, brgerst@gmail.com, peterz@infradead.org, tglx@linutronix.de, mingo@kernel.org, luto@kernel.org, bp@alien8.de, torvalds@linux-foundation.org Reply-To: mingo@kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, luto@kernel.org, bp@alien8.de, brgerst@gmail.com, peterz@infradead.org, hpa@zytor.com, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, jpoimboe@redhat.com In-Reply-To: <2cadd9f16c77da7ee7957bfc5e1c67928c23ca48.1481685203.git.jpoimboe@redhat.com> References: <2cadd9f16c77da7ee7957bfc5e1c67928c23ca48.1481685203.git.jpoimboe@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/boot/64: Push correct start_cpu() return address Git-Commit-ID: 31dcfec11f827e9a5d8720fe4728f1305894884f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1922 Lines: 49 Commit-ID: 31dcfec11f827e9a5d8720fe4728f1305894884f Gitweb: http://git.kernel.org/tip/31dcfec11f827e9a5d8720fe4728f1305894884f Author: Josh Poimboeuf AuthorDate: Tue, 13 Dec 2016 21:25:36 -0600 Committer: Ingo Molnar CommitDate: Wed, 14 Dec 2016 08:48:05 +0100 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 Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/2cadd9f16c77da7ee7957bfc5e1c67928c23ca48.1481685203.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/head_64.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 1facaf4..b467b14 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -298,12 +298,13 @@ ENTRY(start_cpu) * REX.W + FF /5 JMP m16:64 Jump far, absolute indirect, * address given in m16:64. */ - pushq $1f # put return address on stack for unwinder -1: xorq %rbp, %rbp # clear frame pointer + pushq $.Lafter_lret # put return address on stack for unwinder + xorq %rbp, %rbp # clear frame pointer movq initial_code(%rip), %rax pushq $__KERNEL_CS # set correct cs pushq %rax # target address in negative space lretq +.Lafter_lret: ENDPROC(start_cpu) #include "verify_cpu.S"