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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 8FC4EC433DB for ; Tue, 9 Feb 2021 16:14:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C7E964EB4 for ; Tue, 9 Feb 2021 16:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232686AbhBIQOQ (ORCPT ); Tue, 9 Feb 2021 11:14:16 -0500 Received: from foss.arm.com ([217.140.110.172]:53710 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232782AbhBIQOL (ORCPT ); Tue, 9 Feb 2021 11:14:11 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9A2B8ED1; Tue, 9 Feb 2021 08:13:25 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.42.209]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 83C623F73D; Tue, 9 Feb 2021 08:13:24 -0800 (PST) Date: Tue, 9 Feb 2021 16:13:22 +0000 From: Mark Rutland To: Peter Zijlstra Cc: Randy Dunlap , Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List , Josh Poimboeuf Subject: Re: [PATCH] lockdep: Noinstr annotate warn_bogus_irq_restore() Message-ID: <20210209161322.GC71297@C02TD0UTHF1T.local> References: <20210208235246.01cb4daf@canb.auug.org.au> <2000eae0-89f4-a88f-a113-7fa47f16def7@infradead.org> <20210209132430.GB71297@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 05:03:46PM +0100, Peter Zijlstra wrote: > On Tue, Feb 09, 2021 at 01:24:30PM +0000, Mark Rutland wrote: > > On Tue, Feb 09, 2021 at 09:34:10AM +0100, Peter Zijlstra wrote: > > > > > > Subject: lockdep: Noinstr annotate warn_bogus_irq_restore() > > > From: Peter Zijlstra > > > Date: Tue Feb 9 09:30:03 CET 2021 > > > > > > vmlinux.o: warning: objtool: lock_is_held_type()+0x107: call to warn_bogus_irq_restore() leaves .noinstr.text section > > > > > > As per the general rule that WARNs are allowed to violate noinstr to > > > get out, annotate it away. > > > > > > Fixes: 997acaf6b4b5 ("lockdep: report broken irq restoration") > > > Reported-by: Randy Dunlap > > > Signed-off-by: Peter Zijlstra (Intel) > > > > Whoops; sorry for missing that! > > > > Acked-by: Mark Rutland > > This runs into sodding header hell on mips (and possibly others) > > How's this then? Looks fine to me, FWIW. Mark. > > --- > Subject: lockdep: Noinstr annotate warn_bogus_irq_restore() > From: Peter Zijlstra > Date: Tue Feb 9 09:30:03 CET 2021 > > vmlinux.o: warning: objtool: lock_is_held_type()+0x107: call to warn_bogus_irq_restore() leaves .noinstr.text section > > As per the general rule that WARNs are allowed to violate noinstr to > get out, annotate it away. > > Fixes: 997acaf6b4b5 ("lockdep: report broken irq restoration") > Reported-by: Randy Dunlap > Signed-off-by: Peter Zijlstra (Intel) > Acked-by: Mark Rutland > --- > include/linux/irqflags.h | 5 ++++- > kernel/locking/irqflag-debug.c | 4 +++- > 2 files changed, 7 insertions(+), 2 deletions(-) > > --- a/kernel/locking/irqflag-debug.c > +++ b/kernel/locking/irqflag-debug.c > @@ -4,8 +4,10 @@ > #include > #include > > -void warn_bogus_irq_restore(void) > +noinstr void warn_bogus_irq_restore(void) > { > + instrumentation_begin(); > WARN_ONCE(1, "raw_local_irq_restore() called with IRQs enabled\n"); > + instrumentation_end(); > } > EXPORT_SYMBOL(warn_bogus_irq_restore);