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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9E051C433F5 for ; Fri, 13 May 2022 14:10:16 +0000 (UTC) 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eJnunTB1cxWBe7T60/gk2hYauKAbQpWjW25Tt/IGJy8=; b=IRgbigsv3v2vlX Ziv+s+JMa+c7uiPsI2KTr1j0+PPxlxDpNs1yPKFSCBLMLhBok2FmTanjprQ7WshD+PG79gmnYZkdH XGdEGBG5308kFS/oMgOea0G3NGXicUX9u8R1ZWW27JhZSeiFE6gEuFMQNAXzvLvUCCWAWRHSBWDnO J4aXDw8Y+1Wwt4oFoHeA0vzZDW8WIOXGfRbvB0xYDa2qlMNA+kb9/sX0bSkCRb6S8LLPT8zIhWWYO lZzj4MNh2nb/BQZNDvvCWloxfYVCA7lFcZcTwuS8ajLZBw92aIJwz+YrztwNylKV0T4O1jptnb4hd MURnlc3SE8AF9N/L6FJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1npVyV-00GNJD-Tx; Fri, 13 May 2022 14:08:59 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1npVyS-00GNIi-HL for linux-arm-kernel@lists.infradead.org; Fri, 13 May 2022 14:08:57 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0BB6E143D; Fri, 13 May 2022 07:08:55 -0700 (PDT) Received: from lakrids (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B3CE3F5A1; Fri, 13 May 2022 07:08:54 -0700 (PDT) Date: Fri, 13 May 2022 15:08:38 +0100 From: Mark Rutland To: Joey Gouly Cc: linux-arm-kernel@lists.infradead.org, maz@kernel.org, tglx@linutronix.de, will.deacon@arm.com, nd@arm.com Subject: Re: [PATCH 3/3] irqchip/gic-v3: fix priority mask handling Message-ID: References: <20220513133038.226182-1-mark.rutland@arm.com> <20220513133038.226182-4-mark.rutland@arm.com> <20220513134552.GA35971@e124191.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220513134552.GA35971@e124191.cambridge.arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220513_070856_655624_48727642 X-CRM114-Status: GOOD ( 19.55 ) 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 Fri, May 13, 2022 at 02:45:52PM +0100, Joey Gouly wrote: > Hi Mark, > > On Fri, May 13, 2022 at 02:30:38PM +0100, Mark Rutland wrote: > > When a kernel is built with CONFIG_ARM64_PSEUDO_NMI=y and pseudo-NMIs > > are enabled at runtime, GICv3's gic_handle_irq() can leave DAIF and > > ICC_PMR_EL1 in an unexpected state in some cases, breaking subsequent > > usage of local_irq_enable() and resulting in softirqs being run with > > IRQs erroneously masked (possibly resulting in deadlocks). > > > > This can happen when an IRQ exception is taken from a context where > > regular IRQs were unmasked, and either: > > > > (1) ICC_IAR1_EL1 indicates a special INTID (e.g. as a result of an IRQ > > being withdrawn since the IRQ exception was taken). > > > > (2) ICC_IAR1_EL1 and ICC_RPR_EL1 indicate an NMI was acknowledged. > > > > When an NMI is taken from a context where regular IRQs were masked, > > there is no problem. > > > > [..] > > > +/* > > + * An exception has been taken from a context with IRQs enabled, which can only > I think this should be: IRQs *disabled*? Yes; whoops. I've fixed that up locally. > > + * be an NMI. > > + * > > + * The entry code called us with DAIF.IF set to keep NMIs masked. We must leave > > + * DAIF.IF (and ICC_PMR_EL1) unchanged. > > + * > > + * The entry code has performed NMI entry. > > + */ > > +static void __gic_handle_irq_from_irqsoff(struct pt_regs *regs) Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel