From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757369AbcAMKzO (ORCPT ); Wed, 13 Jan 2016 05:55:14 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33589 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750885AbcAMKzI (ORCPT ); Wed, 13 Jan 2016 05:55:08 -0500 Date: Wed, 13 Jan 2016 11:55:03 +0100 From: Ingo Molnar To: Josh Poimboeuf Cc: Borislav Petkov , 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: <20160113105503.GB11575@gmail.com> References: <20160112164711.GD22699@pd.tnic> <20160112174301.GD310@treble.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160112174301.GD310@treble.redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Josh Poimboeuf wrote: > > 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? > > Well, these STACKTOOL_IGNORE whitelist markers are only needed in a handful of > places, and only for code that does very weird things. Yes, they're a bit ugly, > but IMO they also communicate valuable information: "be careful, this code does > something very weird." How common are these markers? Like with lockdep, it all depends on magnitude: - If it's less than 10 I'd say it's OK. - If it's dozens then it's ho-hum. - If certain types of annotations can go over 100, then they are unacceptable. all such in-code overhead has to be balanced against the utility of the tooling. > As for whether to put the whitelist info in the code vs hard-coding it in > stacktool, I think it's clearer and less "magical" to put them directly in the > code. That's true - but I think Boris tried to ask something slightly different: can stacktool be taught to detect weird signatures automatically, and to ignore them automatically? Stuff like 16-bit code sure wounds 'weird' and the tool could detect that? Thanks, Ingo