Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1663667ybt; Mon, 15 Jun 2020 06:25:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgAXV7cYcTZc5qNITSpuZXKGMhbM5uutNxivP053jqHhhg5DhspvnPmm28jojXDA/0PHm8 X-Received: by 2002:a17:906:ecef:: with SMTP id qt15mr24801727ejb.91.1592227540559; Mon, 15 Jun 2020 06:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592227540; cv=none; d=google.com; s=arc-20160816; b=kVIYpNeS9Fr+GcQCcu4eUEVASkezFN7cS5XyhLAVmkp7iQbZS3MNkw1XblhYIiT74+ QPDDuUrTwp+EAqnSqGyCCTh/v/BVi2dRjr+z27gNPwCypYyfLfIlRggcypmAwxUJhoRw ZMc039TVY6//Td7QMoMfaV8F4gpZrdYE3Qh9nQC4c3siDi88b2EZ00BMXQ9cVA1+wGW2 d2P//MBuafPVLY4BYeIH7SZv4y0O3nTBxWdiNcGVjwrn5ju+4HDyEw3eErxvk88PJf+A e8xcpvqIgaLwus+FBl0LEHtcwlasknBf0ustaajT+i5kHACS6f8Ap0+Mn6Ij8+Vl0FCE wf5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=v1JuBkjgVZu6X7IHxoR7umQyE9OF6DuLKgiaH5Hdipo=; b=s0002kSEmjieuHsg42VUSfCu+ChBTxNXlDwNBnDTzetTkALeyki8NaMRR50fD7N6mW rgUb9zOF/N53tETSrUTTvdoyQ3kcYChXb+a1M3vnYx5jl5HJGZmcUPdjDFz8h1+k8quZ TbUPFgOt3a92u2yXxVbS0flnFvsLPB6Bg/kUtsv5o/2laDvwayvYQFCqTjxltdd6JJVV S/0jJdbEZEBjGk4aa65w7m7MPbTBJse+oE/2xo/fa6HKzS69JISSZZ24trjaijiQz6us sNNcsdmDoVrEG5rwGSk71aB3JR4IPXMWoEzlCzsxtlfxmWkcKi8Q2ilM0XKIV8rF0LT+ fr/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ZtjyYI1P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si8641403edu.550.2020.06.15.06.25.16; Mon, 15 Jun 2020 06:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ZtjyYI1P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730322AbgFONW5 (ORCPT + 99 others); Mon, 15 Jun 2020 09:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730065AbgFONW5 (ORCPT ); Mon, 15 Jun 2020 09:22:57 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53257C061A0E for ; Mon, 15 Jun 2020 06:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=v1JuBkjgVZu6X7IHxoR7umQyE9OF6DuLKgiaH5Hdipo=; b=ZtjyYI1PdGCLGqQJMjknk88JGR DPJo+q7dRMl6FQf1kQ+G9qipHOGhNzgMsWxR6R7yPRVKFhAffl7efh8hLqcXncydwOLJLQBa1ygqZ yBbeegWmPfz5A/nnnuAfMFX1YCHy3fSdiOcfryly1pKErYTXfpt3bF6mNOXb4r+fAOtVmIu8cex6R meDI2kVU5cRGqrQvFjfJI1PYLyfrR3gF/RPlMO3LgzJZj/ouo2HFD3NURcKaw/WlWE1yGr0eJSr3y LhT/61NbJ5pm1cRmAI1jyU7bNUJDBec63wahNEtmR/Pl+r0jS24HybzVHNRurvsk1CHnJKB4xguqc 9/vUqJlQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkp4Z-0007C9-4L; Mon, 15 Jun 2020 13:22:47 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B653D306102; Mon, 15 Jun 2020 15:22:44 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A0C2C2392E70D; Mon, 15 Jun 2020 15:22:44 +0200 (CEST) Date: Mon, 15 Jun 2020 15:22:44 +0200 From: Peter Zijlstra To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Will Deacon , Andrew Morton , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org Subject: Re: [PATCH 3/3] powerpc/8xx: Provide ptep_get() with 16k pages Message-ID: <20200615132244.GR2531@hirez.programming.kicks-ass.net> References: <341688399c1b102756046d19ea6ce39db1ae4742.1592225558.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <341688399c1b102756046d19ea6ce39db1ae4742.1592225558.git.christophe.leroy@csgroup.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 12:57:59PM +0000, Christophe Leroy wrote: > READ_ONCE() now enforces atomic read, which leads to: > Fixes: 2ab3a0a02905 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") > Cc: Will Deacon > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/nohash/32/pgtable.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h b/arch/powerpc/include/asm/nohash/32/pgtable.h > index b56f14160ae5..77addb599ce7 100644 > --- a/arch/powerpc/include/asm/nohash/32/pgtable.h > +++ b/arch/powerpc/include/asm/nohash/32/pgtable.h > @@ -286,6 +286,16 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, > return __pte(pte_update(mm, addr, ptep, ~0, 0, 0)); > } > > +#if defined(CONFIG_PPC_8xx) && defined(CONFIG_PPC_16K_PAGES) > +#define __HAVE_ARCH_PTEP_GET > +static inline pte_t ptep_get(pte_t *ptep) > +{ > + pte_t pte = {READ_ONCE(ptep->pte), 0, 0, 0}; > + > + return pte; > +} > +#endif Would it make sense to have a comment with this magic? The casual reader might wonder WTH just happened when he stumbles on this :-) Other than that, the series looks good to me, Thanks! Acked-by: Peter Zijlstra (Intel)