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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 D3666C433DF for ; Tue, 18 Aug 2020 16:24:50 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8746E2067C for ; Tue, 18 Aug 2020 16:24:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="SS9qWW4i" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8746E2067C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BWGTX3jdrzDqgF for ; Wed, 19 Aug 2020 02:24:48 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=peterz@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=SS9qWW4i; dkim-atps=neutral Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BWFX32ZMKzDqZQ for ; Wed, 19 Aug 2020 01:41:55 +1000 (AEST) 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=YC5uocxVWr0+W2/Gmoj0x49mC0HJbzGZXtwi1gy/ZcQ=; b=SS9qWW4idnVrCKkBcCU6p41ReX FbE/tWKHXCBN1dynhu4TioUKAvis/2xaDgWasXUZeqxXnSLOUXPcNJReKashsZVkV2mZ/WPUvpDqE rniDmzWbKqmZ3/J1j0dNL3mRHmfDElx4qfghEf7CIRadcbJTNdTkc8habCarBSY9/Y3KraOt+/5OW KBc6ykYp6SlAlisz4QzMyDw29bGYWsvoxfzo266zxINRAIgvj9zUQ42J6VqyzuxWXzJBp/IjHsiKa qXPNiybyxs7NplvnIBe0U3K2p15x+oSHEPMygRBpdzsqF7kqu8S01CtTzcLIQn/6PDtCSaEIF195A cnpgycng==; 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.92.3 #3 (Red Hat Linux)) id 1k83kC-0004ai-3J; Tue, 18 Aug 2020 15:41:48 +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 1DDC3300DB4; Tue, 18 Aug 2020 17:41:43 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0B714200D4BEA; Tue, 18 Aug 2020 17:41:43 +0200 (CEST) Date: Tue, 18 Aug 2020 17:41:43 +0200 From: peterz@infradead.org To: Nicholas Piggin Subject: Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state Message-ID: <20200818154143.GT2674@hirez.programming.kicks-ass.net> References: <20200723105615.1268126-1-npiggin@gmail.com> <20200807111126.GI2674@hirez.programming.kicks-ass.net> <1597220073.mbvcty6ghk.astroid@bobo.none> <20200812103530.GL2674@hirez.programming.kicks-ass.net> <1597735273.s0usqkrlsk.astroid@bobo.none> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1597735273.s0usqkrlsk.astroid@bobo.none> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Alexey Kardashevskiy , Will Deacon , linux-kernel@vger.kernel.org, Ingo Molnar , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Aug 18, 2020 at 05:22:33PM +1000, Nicholas Piggin wrote: > Excerpts from peterz@infradead.org's message of August 12, 2020 8:35 pm: > > On Wed, Aug 12, 2020 at 06:18:28PM +1000, Nicholas Piggin wrote: > >> Excerpts from peterz@infradead.org's message of August 7, 2020 9:11 pm: > >> > > >> > What's wrong with something like this? > >> > > >> > AFAICT there's no reason to actually try and add IRQ tracing here, it's > >> > just a hand full of instructions at the most. > >> > >> Because we may want to use that in other places as well, so it would > >> be nice to have tracing. > >> > >> Hmm... also, I thought NMI context was free to call local_irq_save/restore > >> anyway so the bug would still be there in those cases? > > > > NMI code has in_nmi() true, in which case the IRQ tracing is disabled > > (except for x86 which has CONFIG_TRACE_IRQFLAGS_NMI). > > > > That doesn't help. It doesn't fix the lockdep irq state going out of > synch with the actual irq state. The code which triggered this with the > special powerpc irq disable has in_nmi() true as well. Urgh, you're talking about using lockdep_assert_irqs*() from NMI context? If not, I'm afraid I might've lost the plot a little on what exact failure case we're talking about.