Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp604979pxv; Thu, 8 Jul 2021 09:40:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFHYvfYMGTCD3eyj7Nd9dpRSyIxw+x5kBv6Ig1SnFczUHj1W9IbqmbRV5twqK7EuiDqbM2 X-Received: by 2002:aa7:ccd2:: with SMTP id y18mr39819897edt.196.1625762445559; Thu, 08 Jul 2021 09:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625762445; cv=none; d=google.com; s=arc-20160816; b=ASDygbvdqFOMtO6LOkXYJ061u9wv+UacmloLiNLVKfv/byF3jROsTJegj0GdPvhZiz /xBFn3FSsdKYbri/1RQIuz2Nf7+gP7AdcMhDaBFfExUHocYWNloGP2H+ALo9Mj1ym3ye 6Zonv5GSXvba/c3UluXrv8zzChTOpU8adAvjz091cSogS7Cc+MeNfYjR9/ir98KDXRw6 8NZyBWBeeP9ag2OWCNXRZB3fScSumTSsmfcFVDqkWmG4MgLQogQMxquqRYjZPJR7OWVr fiPAXN+fwgdCl1yG4iWAI0cmdRugiAModCggUfdfaaoTlnDhXPLTSVyOPVZShIcf57uC pSQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=qk9HDieKN1dNISfv0Pda56ycGKYOuy+KHRtJFdSi4H4=; b=pW0nq68Ru7k/uZsG23zK8+4p8R7rsrnmI/AbloKT2wewXf+xaA6a9AtaBDrMR/A+pC GelfgCorK99y7teT0xnWvqn0vK4a62Tt4LjwWeoiftj5KHP2QdGZ3cd2Wg0Z1CdaEJBW 7rKwvvCn6n8781oljfnFwYGkXyeM0UuJHbJtp0YZ0s7Hsx+JB32V2dBLDv3OxvxiRHYm IvoQcn+QzU4ac6RUVlIY3cB/E7v5Hq7MPP7AAnKFQ7dABTTdrpN4umJJ7U80xgUnQxog NJGza5Z8AmyB0TWAFKdxeZV63CLKkpXqX0VeZsZ5t0N6p6lkm1v3zzhuHVzSmPZLBSnc t5JQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si3887972edy.320.2021.07.08.09.40.22; Thu, 08 Jul 2021 09:40:45 -0700 (PDT) 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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbhGHQmN (ORCPT + 99 others); Thu, 8 Jul 2021 12:42:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:37690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbhGHQmN (ORCPT ); Thu, 8 Jul 2021 12:42:13 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 269F761446; Thu, 8 Jul 2021 16:39:31 +0000 (UTC) Received: from host31-54-148-101.range31-54.btcentralplus.com ([31.54.148.101] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m1X3g-00C7mG-Vj; Thu, 08 Jul 2021 17:39:29 +0100 Date: Thu, 08 Jul 2021 17:39:28 +0100 Message-ID: <87eec83glb.wl-maz@kernel.org> From: Marc Zyngier To: Serge Semin Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , kernel-team@android.com, Guenter Roeck , Thomas Bogendoerfer Subject: Re: [PATCH] irqchip/mips: Fix RCU violation when using irqdomain lookup on interrupt entry In-Reply-To: <20210708094608.anrgynyzu6h233pr@mobilestation> References: <20210706110647.3979002-1-maz@kernel.org> <20210708094608.anrgynyzu6h233pr@mobilestation> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 31.54.148.101 X-SA-Exim-Rcpt-To: fancer.lancer@gmail.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, kernel-team@android.com, linux@roeck-us.net, tsbogend@alpha.franken.de X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sergey, On Thu, 08 Jul 2021 10:46:08 +0100, Serge Semin wrote: > > Hi Marc, > Thanks for the fix. > > On Tue, Jul 06, 2021 at 12:06:47PM +0100, Marc Zyngier wrote: > > Since d4a45c68dc81 ("irqdomain: Protect the linear revmap with RCU"), > > any irqdomain lookup requires the RCU read lock to be held. > > > > This assumes that the architecture code will be structured such as > > irq_enter() will be called *before* the interrupt is looked up > > in the irq domain. However, this isn't the case for MIPS, and a number > > of drivers are structured to do it the other way around when handling > > an interrupt in their root irqchip (secondary irqchips are OK by > > construction). > > > > This results in a RCU splat on a lockdep-enabled kernel when the kernel > > takes an interrupt from idle, as reported by Guenter Roeck. > > Alas I am still on 5.12-rc4, so can't test it out at the moment. Soon > after getting further on the modern kernel version I'll give this > patch a try on my hw and send a report. It is likely that I'll send a pull request to Thomas with this shortly, given that it affects existing systems and that this patch does address the issue (see Guenter's report). We can always amend things once you've had the time to upgrade your kernel to the latest. Thanks, M. -- Without deviation from the norm, progress is not possible.