From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A401C43331 for ; Thu, 2 Apr 2020 21:49:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D299A20737 for ; Thu, 2 Apr 2020 21:49:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389303AbgDBVts (ORCPT ); Thu, 2 Apr 2020 17:49:48 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:39090 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729549AbgDBVts (ORCPT ); Thu, 2 Apr 2020 17:49:48 -0400 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jK7i0-0003n8-Nm; Thu, 02 Apr 2020 23:49:08 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 0CDB5100D52; Thu, 2 Apr 2020 23:49:08 +0200 (CEST) From: Thomas Gleixner To: Josh Poimboeuf Cc: LKML , x86@kernel.org, Paul McKenney , "Joel Fernandes \(Google\)" , "Steven Rostedt \(VMware\)" , Masami Hiramatsu , Alexei Starovoitov , Frederic Weisbecker , Mathieu Desnoyers , Brian Gerst , Juergen Gross , Alexandre Chartre , Peter Zijlstra , Tom Lendacky , Paolo Bonzini , kvm@vger.kernel.org Subject: Re: [RESEND][patch V3 06/23] bug: Annotate WARN/BUG/stackfail as noinstr safe In-Reply-To: <20200402210115.zpk52dyc6ofg2bve@treble> References: <20200320175956.033706968@linutronix.de> <20200320180032.994128577@linutronix.de> <20200402210115.zpk52dyc6ofg2bve@treble> Date: Thu, 02 Apr 2020 23:49:08 +0200 Message-ID: <87369lmucr.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Josh Poimboeuf writes: > On Fri, Mar 20, 2020 at 07:00:02PM +0100, Thomas Gleixner wrote: >> --- a/arch/x86/include/asm/bug.h >> +++ b/arch/x86/include/asm/bug.h >> @@ -70,13 +70,16 @@ do { \ >> #define HAVE_ARCH_BUG >> #define BUG() \ >> do { \ >> + instr_begin(); \ >> _BUG_FLAGS(ASM_UD2, 0); \ >> unreachable(); \ >> } while (0) > > For visual symmetry at least, it seems like this wants an instr_end() > before the unreachable(). Does objtool not like that? There was some hickup, but can't remember. Will try to reproduce with the latest version of Peter's objtool changes. >> --- a/include/asm-generic/bug.h >> +++ b/include/asm-generic/bug.h >> @@ -83,14 +83,19 @@ extern __printf(4, 5) >> void warn_slowpath_fmt(const char *file, const int line, unsigned taint, >> const char *fmt, ...); >> #define __WARN() __WARN_printf(TAINT_WARN, NULL) >> -#define __WARN_printf(taint, arg...) \ >> - warn_slowpath_fmt(__FILE__, __LINE__, taint, arg) >> +#define __WARN_printf(taint, arg...) do { \ >> + instr_begin(); \ >> + warn_slowpath_fmt(__FILE__, __LINE__, taint, arg); \ >> + instr_end(); \ >> + while (0) > > Missing a '}' before the 'while'? Yep, fixed that locally already. Thanks, tglx