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=-4.0 required=3.0 tests=BAYES_00,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 9599DC07E99 for ; Thu, 8 Jul 2021 16:39:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BE2D6145A for ; Thu, 8 Jul 2021 16:39:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229595AbhGHQmN (ORCPT ); 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.