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 E95D6CD11C2 for ; Wed, 10 Apr 2024 11:06:23 +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=2p9lm/+wkYacofjdB8AcpLYtqyGD7aZAg2uEjR65am8=; b=fZpY+N2uAjr6UB WlxmEvNDyDu2IxU/WDei+3LUxYeZ8SRwcSSlYrzdeRLrvubzQXVez2+jhDV4RHKoD3dwWXVoBeG9C sJUxFqdsmhAh5mlmk4jIK60QinpSnPtwspqdoL+CsGcEkSZVNTBqC/u55Wxj59cM2wHEwCjMPR+ZH iH2Hz0Odi3iYlyUjcwm/YG8plTpMgHY+a4lbggZ0eyLz43u8iEbN6lhYrTxD+gXeZBxf1asAH726p av7Uu36IZjIYzvGbaInI5qNrynC9WKIJduBEagExIfrfCK/ES65rR2Qj0R9Jztlz8J1NDSjxwtdKh aqUXe5CnfvhJxaby+sdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruVmO-00000006Xbv-0MwB; Wed, 10 Apr 2024 11:06:12 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruVmM-00000006XbI-0mko for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2024 11:06:11 +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 69B80139F; Wed, 10 Apr 2024 04:06:39 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.17.100]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB09C3F6C4; Wed, 10 Apr 2024 04:06:07 -0700 (PDT) Date: Wed, 10 Apr 2024 12:06:04 +0100 From: Mark Rutland To: Ryan Roberts Cc: Catalin Marinas , Will Deacon , Ard Biesheuvel , David Hildenbrand , Donald Dutile , Eric Chanudet , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Itaru Kitayama Subject: Re: [PATCH v2 2/4] arm64: mm: Batch dsb and isb when populating pgtables Message-ID: References: <20240404143308.2224141-1-ryan.roberts@arm.com> <20240404143308.2224141-3-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_040610_294972_BC54500C X-CRM114-Status: GOOD ( 25.74 ) 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, Apr 10, 2024 at 11:25:10AM +0100, Ryan Roberts wrote: > On 10/04/2024 11:06, Mark Rutland wrote: > > On Thu, Apr 04, 2024 at 03:33:06PM +0100, Ryan Roberts wrote: [> >> @@ -234,6 +238,13 @@ static void alloc_init_cont_pte(pmd_t *pmdp, unsigned long addr, > >> } while (addr = next, addr != end); > >> > >> pte_clear_fixmap(); > >> + > >> + /* > >> + * Ensure all previous pgtable writes are visible to the table walker. > >> + * See init_pte(). > >> + */ > >> + dsb(ishst); > >> + isb(); > > > > Hmm... currently the call to pte_clear_fixmap() alone should be sufficient, > > since that needs to update the PTE for the fixmap slot, then do maintenance for > > that. > > Yes, true... > > > > > So we could avoid the addition of the dsb+isb here, and have a comment: > > > > /* > > * Note: barriers and maintenance necessary to clear the fixmap slot > > * ensure that all previous pgtable writes are visible to the table > > * walker. > > */ > > pte_clear_fixmap(); > > > > ... which'd be fine as long as we keep this fixmap clearing rather than trying > > to do that lazily as in patch 4. > > But it isn't patch 4 that breaks it, it's patch 3. Once we have abstracted > pte_clear_fixmap() into the ops->unmap() call, for the "late" ops, unmap is a > noop. Ah, yep; I hadn't spotted that yet. > I guess the best solution there would be to require that unmap() always > issues these barriers. > > I'll do as you suggest for this patch. If we want to keep patch 3, then I'll add > the barriers for all unmap() impls. Thanks. It's going to take me a bit longer to chew through patches 3 and 4, but I will try to get through those soon. For now a slightly simpler option would be to have patch 3 introduce the DSB+ISB as above rather than in each of the unmap() impls. Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel