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=-9.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,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 D6256C47094 for ; Thu, 10 Jun 2021 16:28:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9789C61263 for ; Thu, 10 Jun 2021 16:28:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9789C61263 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=M55fXbqqChW0nQU6ruoVgjownHyrwMw9dKk+HyriT9A=; b=Q+cZgjrcK6IKX1 J+EtiGguJvbmb6ud7R2AYjEXGIL1+371FVVSV6rzvuI/wY0SFiGRaPh2kWnC6tbofiIGO3IjHRf/+ lHgLCjGnsHKBCgSiTiE8N+tVT/4BHd9FS394Tlg0d5msrMKyZx3XtZx9SfOGN/GGF2VizTUhnZSQX WkX6MPJa3fdUz7qPZkJU7tiUqiqmCVIqeDQy3URqOBnoX2C8JLZq0UlVbkx7nS+rBQqQiulSujq59 jtanKyj5R2kZSCR9wL7swQLh8AXs4dLVeo3LEY7IONl9/VOTyEfxCqXoyUO0m/wBkH/8WNl6xmBS6 JsXnsWZIWKNd/TZx30Hw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrNWH-001fL5-Im; Thu, 10 Jun 2021 16:27:02 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrNVn-001fF0-Uh for linux-arm-kernel@lists.infradead.org; Thu, 10 Jun 2021 16:26:33 +0000 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 9B06460C40; Thu, 10 Jun 2021 16:26:31 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.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 1lrNVl-006mHG-K1; Thu, 10 Jun 2021 17:26:29 +0100 Date: Thu, 10 Jun 2021 17:26:28 +0100 Message-ID: <87h7i5r8i3.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Will Deacon , Catalin Marinas , Alexandru Elisei , Thomas Gleixner , valentin.schneider@arm.com, kernel-team@android.com Subject: Re: [PATCH] irqchip/gic-v3: Workaround inconsistent PMR setting on NMI entry In-Reply-To: <20210610155917.GA63335@C02TD0UTHF1T.local> References: <20210610145731.1350460-1-maz@kernel.org> <20210610155917.GA63335@C02TD0UTHF1T.local> 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") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, will@kernel.org, catalin.marinas@arm.com, alexandru.elisei@arm.com, tglx@linutronix.de, valentin.schneider@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210610_092632_065582_CAE9E0A6 X-CRM114-Status: GOOD ( 32.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 10 Jun 2021 16:59:30 +0100, Mark Rutland wrote: > > Hi Marc, > > On Thu, Jun 10, 2021 at 03:57:31PM +0100, Marc Zyngier wrote: > > The arm64 entry code suffers from an annoying issue on taking > > a NMI, as it sets PMR to a value that actually allows IRQs > > to be acknowledged. This is done for consistency with other parts > > of the code, and is in the process of being fixed. This shouldn't > > be a problem, as we are not enabling interrupts whilst in NMI > > context. > > > > However, in the infortunate scenario that we took a spurious NMI > > (retired before the read of IAR) *and* that there is an IRQ pending > > at the same time, we'll ack the IRQ in NMI context. Too bad. > > > > In order to avoid deadlocks while running something like perf, > > teach the GICv3 driver about this situation: if we were in > > a context where no interrupt should have fired, transiently > > set PMR to a value that only allows NMIs before acking the pending > > interrupt, and restore the original value after that. > > > > This papers over the core issue for the time being, and makes > > NMIs great again. Sort of. > > > > Co-developed-by: Mark Rutland > > According to the kernel documentation, a Co-developed-by should be > immediately followed by that developer's Signed-off-by, so FWIW: > > Signed-off-by: Mark Rutland > > ... unless you want to downgrade that to a Suggested-by, which is also > fine by me! Nah, we both wasted too many grey bits on this one, and I want shared responsibility for it! > > > Signed-off-by: Marc Zyngier > > Having played about with a few options, I think this is the > simplest/cleanest thing we can do for now, and given it's all in one > place and "obviously correct", I think there's little risk that this > will break something else. So: > > Reviewed-by: Mark Rutland > > We should probably also give this: > > Fixes: 4d6a38da8e79e94c ("arm64: entry: always set GIC_PRIO_PSR_I_SET during entry") > > ... since prior to that commit the `gic_prio_irq_setup` gunk would > prevent this specific problem (though other bits like > local_daif_{save,restore}()) would be broken in NMI paths. Yup. I'll add that too and send it as a fix for -rc6. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel