From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762798AbcALQra (ORCPT ); Tue, 12 Jan 2016 11:47:30 -0500 Received: from mail.skyhub.de ([78.46.96.112]:42441 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759655AbcALQrZ (ORCPT ); Tue, 12 Jan 2016 11:47:25 -0500 Date: Tue, 12 Jan 2016 17:47:11 +0100 From: Borislav Petkov To: Josh Poimboeuf Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Michal Marek , Peter Zijlstra , Andy Lutomirski , Linus Torvalds , Andi Kleen , Pedro Alves , Namhyung Kim , Bernd Petrovitsch , Chris J Arges , Andrew Morton , Jiri Slaby , Arnaldo Carvalho de Melo Subject: Re: [PATCH v15 13/25] x86/reboot: Add ljmp instructions to stacktool whitelist Message-ID: <20160112164711.GD22699@pd.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 18, 2015 at 06:39:27AM -0600, Josh Poimboeuf wrote: > stacktool reports a false positive warning for the ljmp instruction in > machine_real_restart(). Normally, ljmp isn't allowed in a function, but > this is a special case where it's jumping into real mode. > > Add the jumps to a whitelist which tells stacktool to ignore them. > > Signed-off-by: Josh Poimboeuf > --- > arch/x86/kernel/reboot.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c > index 02693dd..1ea1c5e 100644 > --- a/arch/x86/kernel/reboot.c > +++ b/arch/x86/kernel/reboot.c > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -97,11 +98,13 @@ void __noreturn machine_real_restart(unsigned int type) > > /* Jump to the identity-mapped low memory code */ > #ifdef CONFIG_X86_32 > - asm volatile("jmpl *%0" : : > + asm volatile(STACKTOOL_IGNORE_INSN > + "jmpl *%0;" : : > "rm" (real_mode_header->machine_real_restart_asm), > "a" (type)); > #else > - asm volatile("ljmpl *%0" : : > + asm volatile(STACKTOOL_IGNORE_INSN > + "ljmpl *%0" : : > "m" (real_mode_header->machine_real_restart_asm), > "D" (type)); > #endif Well, I can't say that I'm crazy about all those new tools adding markers to unrelated kernel code. Can't you teach stacktool to ignore the whole machine_real_restart() function simply? -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.