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.7 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=ham 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 99D6DC433B4 for ; Wed, 5 May 2021 14:43:49 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 3FAD1613C3 for ; Wed, 5 May 2021 14:43:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FAD1613C3 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=desiato.20200630; 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=rF9THqVaxuzQ9TdzZT0PHBLTGzrhhBiZxNfUREy2sUY=; b=GUrEx4iBNzZiMwdy3QHxBVCOi EtVgC2p3tNwohEM8ANmGyWgBKB7yIoMWr50TYTPJPANUS2brvmtQLMGCYdN0l/8W0QFt7vaVBRls+ Zkw4+JGRU6HktmXjq0CxduIhSnZLQE4WjqGRfL2aH6Qtoy83P6w0wl1qIZ/qMirGhh7/YD7SywZuH ZAFNs7rmip/Qa4Z6lkyCHLPsjxT1uEk4+ODtwt5eDja1ZlTtMw//kIA8XytPor52KkmcOrXrBUpKh zckRAnbV6wg1t1OldZ01AsjoPYmS6+kF+22HLzUw2dYzVbJ3Q7KgSq6HVMcbMrtfpUeqzI7kykHww 3O0iwEYcg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leIim-001Suk-SS; Wed, 05 May 2021 14:41:53 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leIij-001SuQ-Ur for linux-arm-kernel@desiato.infradead.org; Wed, 05 May 2021 14:41:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:References: In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rxfeEd2JZZ2jCtZ3TK1Yxo1LRjVT+kx84kCS0crvHxg=; b=vSLRVFX+i4WH91oRLYydg0Tv8l 8JmSZ/5O7A8Fh0oFRYFD31z4CsmOQ9CdxIr7k0Be86Oxt5R005CxagffTQ4RwJV7T6OqoZlSYOsd3 dtO3NVX8gXaxZBnUXDkV+OF850L1N8b9TxNB+BxURmbAx15n3dtsG22D3Xocd82sMWmU3swL6SScb FPmWJdpOl39p+WgwnSjFiHUFH/z0l4+67KRN+y7BGKNuYLsmzKFVYvS4YFKB+0EyOue9lIBfC48Yr 9dymoPScKJKb9qPcFYsPgHTZQDcLKjjGfvidmtRggNOJeLVCpXrL4TcBIy8x0ypnIgcxyejhahUpA ORc+sEcw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leIih-004pss-B3 for linux-arm-kernel@lists.infradead.org; Wed, 05 May 2021 14:41:48 +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 D85C2613C1; Wed, 5 May 2021 14:41:45 +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) (envelope-from ) id 1leIid-00B1CT-SB; Wed, 05 May 2021 15:41:43 +0100 Date: Wed, 05 May 2021 15:41:43 +0100 Message-ID: <877dkdnsyg.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, yuzenghui@huawei.com Subject: Re: [PATCH] arm64: entry: always set GIC_PRIO_PSR_I_SET during entry In-Reply-To: <20210428152939.GB1343@C02TD0UTHF1T.local> References: <20210428111555.50880-1-mark.rutland@arm.com> <87im46o4j6.wl-maz@kernel.org> <20210428151439.GA1343@C02TD0UTHF1T.local> <20210428152939.GB1343@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-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, yuzenghui@huawei.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-20210505_074147_457870_EBED31B0 X-CRM114-Status: GOOD ( 28.27 ) 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 Wed, 28 Apr 2021 16:29:39 +0100, Mark Rutland wrote: > > On Wed, Apr 28, 2021 at 04:19:11PM +0100, Mark Rutland wrote: > > On Wed, Apr 28, 2021 at 03:41:17PM +0100, Marc Zyngier wrote: > > > Hi Mark, [...] > > > I'm a bit worried about forcing PMR to IRQON at this stage. We could > > > have been in IRQOFF state and entering the kernel because of a > > > NMI. Don't we risk losing track of how we made it here? > > > > I also worried about this, but after digging for a while I convinced > > myself there wasn't a problem, as: > > > > * This is what local_daif_mask() does today. It sets the PMR to > > GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET regardless of its original state. > > > > * For checking how we got here, we use either: > > - regs::pmr_save, which is sampled (immediately) before we alter HW PMR > > in the asm above. > > - DAIF, which is unaffected by this. > > > > * This is transparent to local_irq_save() .. local_irq_restore(), as > > that blindly saves/restores the PMR. > > > > ... oh, and within the GIC driver: > > * for a pNMI, we'll leave both PMR and DAIF as-is > > * for an IRQ, we'll set the PMU to GIC_PRIO_IRQOFF (regardless of the > original value), then unmask DAIF. > > ... so that'll do the right thing even if we enter with PMR set to > (GIC_PRIO_IRQON | CIG_PRIO_PSR_I_SET). Fair enough. FWIW: Acked-by: Marc Zyngier 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