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 68F0EC54E94 for ; Thu, 26 Jan 2023 10:32:56 +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=3pO9GRl6m1ZKys1bktLUyuLxRzswJHMUjbKsu7s5Ooo=; b=CMQcIRXrm+nJYs KFlP2MCDvUCwthyUJ8aAI4zLJMWTARz1HoY6lHnhZ8c1N7xXLHnlDUW/KXUJ7b0s9Jyf3A68ip08c 0w65cRIaaH+mUa0bOTUuPSeKKufoIaFiXgZIFb3SP5e93FRms3tkezwlEn/O1VCQauBzdcIKErjT6 aQECxidXmrwfsmWyE92oEbpjm912w+kn067gY/JqkfB3npKH3245lbxFroGtuC9066f00bo/waxVJ PagwEGVfbYzxJOWB7aVB5VsJ8XzBDgY86UYjXj0NqdVCdAV59NW1S09eLOtbSpBG6cWEtJJH11c/5 /u1GPTsvZURv6q+rth+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKzY2-00ASXW-H2; Thu, 26 Jan 2023 10:32:02 +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 1pKzXy-00ASWO-8J for linux-arm-kernel@lists.infradead.org; Thu, 26 Jan 2023 10:31:59 +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 E789E4B3; Thu, 26 Jan 2023 02:32:37 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.10.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B7F43F71E; Thu, 26 Jan 2023 02:31:54 -0800 (PST) Date: Thu, 26 Jan 2023 10:31:52 +0000 From: Mark Rutland To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, broonie@kernel.org, catalin.marinas@arm.com, will@kernel.org Subject: Re: [PATCH v2 5/5] arm64: irqflags: use alternative branches for pseudo-NMI logic Message-ID: References: <20230125163826.496739-1-mark.rutland@arm.com> <20230125163826.496739-6-mark.rutland@arm.com> <877cx9el3x.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <877cx9el3x.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230126_023158_366457_35567D55 X-CRM114-Status: GOOD ( 15.02 ) 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, Jan 26, 2023 at 08:49:38AM +0000, Marc Zyngier wrote: > On Wed, 25 Jan 2023 16:38:26 +0000, > Mark Rutland wrote: > > [...] > > > +static __always_inline void __daif_local_irq_restore(unsigned long flags) > > +{ > > + barrier(); > > + write_sysreg(flags, daif); > > + barrier(); > > +} > > + > > +static __always_inline void __pmr_local_irq_restore(unsigned long flags) > > +{ > > + barrier(); > > + write_sysreg_s(flags, SYS_ICC_PMR_EL1); > > + pmr_sync(); > > + barrier(); > > +} > > It would be good to at least mention why we need these compile-time > barriers which are not that explicit in the existing code. I guess > they are equivalent to the "memory" clobber in the asm sequences that > this replaces, Yes; that was the idea. > but they don't seem to be used consistently throughout this patch. Yes; looking with fresh eyes, the missing barriers around PMR manipulation are buggy. Thanks for pointing that out! I'll go and add the missing barriers, and update the commit message accordingly. I'll also use barrier() around the DAIF helpers rather than a memory clobber so that the equivalent DAIF and PMR helpers more clearly correspond to one another. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel