Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp525032ybt; Wed, 17 Jun 2020 07:18:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFV5F1awCwRKvu5/SxrGosjSbxIhI2POzBf4XmdrL/FesaQ+R1cO8Q3oBjrHwpGW+nAgQW X-Received: by 2002:a05:6402:1a48:: with SMTP id bf8mr7626038edb.133.1592403525752; Wed, 17 Jun 2020 07:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592403525; cv=none; d=google.com; s=arc-20160816; b=iWGCTxg/jyzzCylkFjvj8gqPk8UQ4XXtxJ4j05/kFscGFoyCcZjuUZdaIJXVWW0VlW YkSxlmKqDDEGLDsOF88po3sGX6K9Da5VV/YhSeC9nd08EwiQt6ceGTEnlUkVxcfnDLDe 4lZok8vaQd7n+zgIkm67SrlqxhDzmoB9fykoJv9TrXeD7GnGGpOdIxQRqbJDeHAajklF TMKsv3Gf+sWRWi6tJ2HQOWA3XHlvvMOtTAi1kDBVoZjTHfilUSCaVWbP3S4DwsjWqx2o 2ne5EeqPEw14EHD+c7phKDo3fWTGqPJdXJe3BKVWCVNmOOKHSYUiU7x9n9s9qM5pJyZP 3ESg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=xCWwrtt4R6JSO9LVcFEqt5cuGiE0bgYI7KAlASVZyEI=; b=FXA2OYqdQV19U5HyYbNA2JSzkU4Z/LiGvJtZRFq09xtjkWJgoI0I1WWDBrY+TJRlpO QGiLcQmv9lj0PXeBICPK7qODn6JKyL0CdL6/MZhq75YUUWER3TN13XwrYKypSENybYbE +bdYhH7XqAM9Jubq3BYFWPO4kzHn7+w+Tuk6L8JjTgyktyp8AMDUOFUEaI0q6Y7Qczz9 L3v+9a4aLAVSeaKytmfM/Z/PAfo3p80uZXQ0fDUjFJvB+rHc/8SoWAIKi+4y1f+bzwpU Lw22/+NA7I9YV9+LzVbk1R8w8wLjtbkQfcJarLcIWxvMIM/Lx9rOyNJWGKuWr3ycP1cZ 9lZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=WE0MqTxx; 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 lz22si6318ejb.113.2020.06.17.07.18.23; Wed, 17 Jun 2020 07:18:45 -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=pass header.i=@ellerman.id.au header.s=201909 header.b=WE0MqTxx; 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 S1726976AbgFQONh (ORCPT + 99 others); Wed, 17 Jun 2020 10:13:37 -0400 Received: from ozlabs.org ([203.11.71.1]:41669 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbgFQONh (ORCPT ); Wed, 17 Jun 2020 10:13:37 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 49n6Vl166Tz9sSF; Thu, 18 Jun 2020 00:13:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1592403215; bh=yJ7IVrfjUL7bvgBlIpbHcEVKh7AcaV7LQqGjQYFZ0aU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WE0MqTxxT7dIxRLJ1twvDRMuwovW0/xLVJHQQjQ77nBMyuaW+4pKigwfQEwOPoqSg SuL1eUB6O244tcxeQSyJG+pZLUwLacx+6JYcX89Oi5cuw5j3odJYTC9tzT3sEJFCSV XUhvqflTg1ebHEyELsLH2TQPWFRos+vDbiRngKUmO4qdwqR5n/rnU+vZciKgvUN4vM 01dzSGX/L/TtPqQlMZL1wymLIahPaolbCzP1RatjHTPaaFBHt2NfhS5dr79EPzjAa9 +HaFiIkR5yUz9AKVVSGITnpMClbXpZwt6FmnU4angf2OZeBux5BdqzKSGQxy5ugWxj +ZGCwIn3mfFwg== From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Will Deacon , Andrew Morton , "Peter Zijlstra \(Intel\)" Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org Subject: Re: [PATCH 1/3] mm/gup: Use huge_ptep_get() in gup_hugepte() In-Reply-To: References: Date: Thu, 18 Jun 2020 00:14:05 +1000 Message-ID: <87zh91dbki.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > gup_hugepte() reads hugepage table entries, it can't read > them directly, huge_ptep_get() must be used. > > Fixes: 2ab3a0a02905 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") I see that commit in older versions of linux-next but not in mainline. In mainline it seems to be: 9e343b467c70 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") I guess it got rebased somewhere along the way. I fixed it up when applying, and the other two as well. cheers > Cc: Will Deacon > Signed-off-by: Christophe Leroy > --- > mm/gup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/gup.c b/mm/gup.c > index de9e36262ccb..761df4944ef5 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -2425,7 +2425,7 @@ static int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr, > if (pte_end < end) > end = pte_end; > > - pte = READ_ONCE(*ptep); > + pte = huge_ptep_get(ptep); > > if (!pte_access_permitted(pte, flags & FOLL_WRITE)) > return 0; > -- > 2.25.0