Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5827694iob; Tue, 10 May 2022 04:48:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbF4CHaeGaJ18OtFki6PSE8l2w3VdhhNl54iDHsZRIVDodlcKqMClWcpAjZmkccOyQPPmA X-Received: by 2002:a17:907:2da9:b0:6f8:6104:659 with SMTP id gt41-20020a1709072da900b006f861040659mr13770069ejc.556.1652183297963; Tue, 10 May 2022 04:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652183297; cv=none; d=google.com; s=arc-20160816; b=px3Pw+WUFTSC8NxzHr9FyHGSuwU+70hE4w6iuqKbODWVjwvPGwq8aIlG64VX91OTOr hZgBsqdZVXYUNZpe6M8yx4e7IbBrBBTzpQT3/cEVOVfVc2i940qwqybSlCOtNLyRK88D MTuUvprEyom24SJ2hXa9NSjccttCwTHaQxbfH80M1lYi+1bInSWtufFhNiXMwqhABRaT q09Bt9PHlM4UA06MNQgfCsHR7QUvI72QpWvt7K8v00tvSSKsvnc1WtpBGs4WO1GxaWLc NX8gvNIB8LYZDDxAK9eZd/+m88XQ3SATGZZCsvC5yWb2akL3NohrGuX1qpJBgoWPd/j0 zqhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Rcl4kBiEMs60g61kJbeTVL+ok3Kl9fcWRD7/PY0ySiU=; b=e9z/2FJaSFQ2jomJ5A8WHRJQP964ggGOOV8fuBszEjrLR1noqgBUsRYYzSN0ub/r5/ 3bFFL08ZkiFuLjkuTEL5D7DKJm5V7wWOxnMYwANuxbXZyxJZFo3y+OnMFgyVSmvZGSeQ gASQqALH+mWkNOMiC+ciGTnXpRcigQuu+4I8rMB2Cx0JuZWGWnbGZbCUbn8kBQETWSao xP3SNDDS6emLZmGDXGQii5nCAa4g93KlYAdS+iKsqiD8lTKMhtiJY4RRkSw3fSUKCLVO zksJPyJOUJNo9+KDxGC9B/R7s9ksnm6nltNgzWj/g437EoSL/Av5DeFDL7reuzAYl8zI rA/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e20-20020a056402191400b004280eea2dfesi16601570edz.287.2022.05.10.04.47.53; Tue, 10 May 2022 04:48:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240719AbiEJLRP (ORCPT + 99 others); Tue, 10 May 2022 07:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240723AbiEJLRK (ORCPT ); Tue, 10 May 2022 07:17:10 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFB2922242D for ; Tue, 10 May 2022 04:13:12 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R431e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0VCr6xlO_1652181186; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VCr6xlO_1652181186) by smtp.aliyun-inc.com(127.0.0.1); Tue, 10 May 2022 19:13:06 +0800 From: Baolin Wang To: catalin.marinas@arm.com, will@kernel.org, mike.kravetz@oracle.com, akpm@linux-foundation.org Cc: songmuchun@bytedance.com, willy@infradead.org, anshuman.khandual@arm.com, christophe.leroy@csgroup.eu, baolin.wang@linux.alibaba.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/2] arm64/hugetlb: Use ptep_get() to get the pte value of a huge page Date: Tue, 10 May 2022 19:12:52 +0800 Message-Id: <6aabddaf4cae5ae2205c3a7df9b9e15dbd61b641.1652180088.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The original huge_ptep_get() on ARM64 is just a wrapper of ptep_get(), which will not take into account any contig-PTEs dirty and access bits. Meanwhile we will implement a new ARM64-specific huge_ptep_get() interface in following patch, which will take into account any contig-PTEs dirty and access bits and only be allowed to pass the head pte of a contig-PTE/PMD size page. Thus change to use ptep_get() to get the pte value of a huge page as a preparation. Signed-off-by: Baolin Wang --- arch/arm64/mm/hugetlbpage.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index ca8e65c..be5e2f3 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -172,7 +172,7 @@ static pte_t get_clear_flush(struct mm_struct *mm, unsigned long pgsize, unsigned long ncontig) { - pte_t orig_pte = huge_ptep_get(ptep); + pte_t orig_pte = ptep_get(ptep); bool valid = pte_valid(orig_pte); unsigned long i, saddr = addr; @@ -385,7 +385,7 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, { int ncontig; size_t pgsize; - pte_t orig_pte = huge_ptep_get(ptep); + pte_t orig_pte = ptep_get(ptep); if (!pte_cont(orig_pte)) return ptep_get_and_clear(mm, addr, ptep); @@ -408,11 +408,11 @@ static int __cont_access_flags_changed(pte_t *ptep, pte_t pte, int ncontig) { int i; - if (pte_write(pte) != pte_write(huge_ptep_get(ptep))) + if (pte_write(pte) != pte_write(ptep_get(ptep))) return 1; for (i = 0; i < ncontig; i++) { - pte_t orig_pte = huge_ptep_get(ptep + i); + pte_t orig_pte = ptep_get(ptep + i); if (pte_dirty(pte) != pte_dirty(orig_pte)) return 1; -- 1.8.3.1