Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1103935pxb; Tue, 9 Feb 2021 23:25:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrsIKu2FDlS+syreGGB0vMMlgiJ03bUZzMpOeQRvAhPYbaqmPB4LPzF9jrbgW5G+Yv3hyN X-Received: by 2002:a17:906:3f89:: with SMTP id b9mr1655961ejj.204.1612941951830; Tue, 09 Feb 2021 23:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612941951; cv=none; d=google.com; s=arc-20160816; b=Pzg1rzwnOywnJttbKMUdIMjLm86S6FmfK4g8kne8/yxEcPsXyHqE0agSKcOyulNOTn LfhU20e20OyK7IeI8skPAgsRLdNgOAiPm0BsviZynEExQeXZ6T9dNxxN+HFpR4IfBjSX WKRXqZruZlCo8HcnCOB4qSOqdR35DIj7sgBFNEZF2RtnIe8dKTyMfHYFDXXm8DbipZoG dhJUndiBqliu98McMHKkfDZNukcoBiQqTlSLJ793Ld2pXbubn/HPX0ZHwqVoeEhEIyPQ hbw5oVj4F0X1XNxadMp5cxCziQBmcQvSW7V52fc4VkL2S8kdlCjeeRbe5M2oWnkd/eAT frtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3vg2hby0dj6+BRvVqR0OMPVYFkIYjsxsSS+LgYqs90U=; b=sdBWaluhP0FzoL1VijVLxWE0ooSDB9Peg7iPWK42dg/Lm3J4nYoMjjTCCO6fihO4PA u8APry4KTeMGYyMa432H5r0nbC4bpVMlicLa38MqG50JciZyfvVKjQLoUm3mh3xLSkOZ 86jqxWPoD+sKDrYTt4agP7gtU+G49vL4vlBZSmqxVYHR/D+w1BIdr/k4esdMyh6zNrhc b/eoplgDcQB59r3g0FqhHqLORxEyaySMazJaDQhMPuS6uj00eiB3i4SJN2An913GzUt4 REndZ27May/RP2vCB3jWNFsYwoatQveSCGx4TPvfGcPt67TTvEJ3jIwIf0uurfrbzjyK J73g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=liONZxEb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dj5si828543edb.450.2021.02.09.23.25.29; Tue, 09 Feb 2021 23:25:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=liONZxEb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232642AbhBIQEl (ORCPT + 99 others); Tue, 9 Feb 2021 11:04:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232637AbhBIQEj (ORCPT ); Tue, 9 Feb 2021 11:04:39 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E72C061756; Tue, 9 Feb 2021 08:03:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3vg2hby0dj6+BRvVqR0OMPVYFkIYjsxsSS+LgYqs90U=; b=liONZxEbDHQx4VbT1HxO7SGJOF iHr4n1HmIt0wmnc1EYTCn25izOhhM8QyUxE+okTprwSlTXl4Up92owtLGXTLR9+nhInJyWAiKSbUm XqOkZ6RIo+vPKRlHXDk3a5XZvDHvwHo5hoMWkJZvyikqeEeXhUI2Fxx6mEElPMAFXZH5wrLIvZ/cB CdiAOPkywPZZBAP0SzTT4Newt20YEKTHU1VmBNAD0fagHnf0A03UoOc6QAzc0LJHFnmoLVhPp5vjU A9mviX58OVIl+uaKR9v772MfHBf0mGDqYe3HKlBFVCzKrJEmZ7CpeLeoJN2UFuEpkpylO8mUlIkV9 O6TQ14Gg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1l9VUR-007eTp-BU; Tue, 09 Feb 2021 16:03:47 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 864D8301324; Tue, 9 Feb 2021 17:03:46 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4D2DD2B73FE88; Tue, 9 Feb 2021 17:03:46 +0100 (CET) Date: Tue, 9 Feb 2021 17:03:46 +0100 From: Peter Zijlstra To: Mark Rutland 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: 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: <20210209132430.GB71297@C02TD0UTHF1T.local> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? --- 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);