Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3904614ioa; Tue, 26 Apr 2022 12:03:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPS4IVf9FJEYCTcU+90rq0ZMBYtmbCrFFW2Z3LpyhJ7fYUmzU5HNvZ0PBycQRVbtGCx2hh X-Received: by 2002:a17:902:edc5:b0:158:4065:a5ce with SMTP id q5-20020a170902edc500b001584065a5cemr25302885plk.55.1650999811849; Tue, 26 Apr 2022 12:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650999811; cv=none; d=google.com; s=arc-20160816; b=KEJZYsgC/ErEgC7as5HemKtBfEzbLi6hsmQdv46FBqTxLmAYXiEV5EzuvJ9pqHAH/2 sY8z/9r6QYkFHv2+scYDyOxL+p+XxRL+8V+Im+7h+cL+XReW1VVYzsLEzi28fI5bsfyd qf0L7UqynqCTHGWR1cO+ve2PuhZYjdIDCZ8RkGWLSBRE2i+yQakKFhp3NHdHxEjvCCb8 y2wOThHH3VzhFXrP7f/RnU28Vpd0ZZnIrfy9HOwYsLob/ofTKWByWGXAkWwm+F/jS6TH /pfgzL1jJiY5IqAIkhpPxW9MJ+HASFK4tBaoeBy9UBkwQBHgYs+6ccUUD52/ERPZBNM4 /44g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Yot3LWOoe8VlfjfWLgH1/CH1atqt1hP/FM7A5qjRSZE=; b=jIHjk19ue+ffwesFb6CpsKuVO21QTzR09sgsq1YiH4JEbonRuF5x5/Wvyy6wtFKYTM rO61dHNjTrXhi3koOQX5y9MUgJl1z2UUGlB2ngLNtGBQn2ssxUiMEkdq7BOUB5b+9KbL oBtNxLEMGsW0nCMxSn8w6ivPqQdgs3sYZuhvHiakDkcTKgI7wPtTQxEnQo5XyzojhCbN EkXuIqm4GbCqstjmlzxCU6Bt4Ncog13dVdAXdhuHBQMgyUvWvhF6U5M8BVPAJ+o2yM1s 5MHFdouFBco9aY7qwLdRXWtWA4c48tjjdwYhA4c2HnlXMdi9di2E6L7xoLQdK/iWo8N5 w3Wg== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a17090322c800b00153b2d164e8si9326123plg.240.2022.04.26.12.03.13; Tue, 26 Apr 2022 12:03:31 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344015AbiDZHzM (ORCPT + 99 others); Tue, 26 Apr 2022 03:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343867AbiDZHzJ (ORCPT ); Tue, 26 Apr 2022 03:55:09 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7920EBCA9 for ; Tue, 26 Apr 2022 00:52:02 -0700 (PDT) Received: from kwepemi500026.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KnYxJ0lFDzhYnh; Tue, 26 Apr 2022 15:51:48 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by kwepemi500026.china.huawei.com (7.221.188.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Apr 2022 15:52:00 +0800 Received: from localhost.localdomain (10.175.112.125) by kwepemm600017.china.huawei.com (7.193.23.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Apr 2022 15:51:58 +0800 From: Tong Tiangen To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , Pasha Tatashin , Anshuman Khandual , Andrew Morton , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou CC: , , , , Tong Tiangen , Kefeng Wang , Guohanjun Subject: [PATCH -next v6 1/6] mm: page_table_check: using PxD_SIZE instead of PxD_PAGE_SIZE Date: Tue, 26 Apr 2022 08:10:31 +0000 Message-ID: <20220426081036.1374452-2-tongtiangen@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220426081036.1374452-1-tongtiangen@huawei.com> References: <20220426081036.1374452-1-tongtiangen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 Compared with PxD_PAGE_SIZE, which is defined and used only on X86, PxD_SIZE is more common in each architecture. Therefore, it is more reasonable to use PxD_SIZE instead of PxD_PAGE_SIZE in page_table_check.c. At the same time, it is easier to support page table check in other architectures. The substitution has no functional impact on the x86. Suggested-by: Anshuman Khandual Signed-off-by: Tong Tiangen Acked-by: Pasha Tatashin Reviewed-by: Anshuman Khandual --- mm/page_table_check.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_table_check.c b/mm/page_table_check.c index 2458281bff89..eb0d0b71cdf6 100644 --- a/mm/page_table_check.c +++ b/mm/page_table_check.c @@ -177,7 +177,7 @@ void __page_table_check_pmd_clear(struct mm_struct *mm, unsigned long addr, if (pmd_user_accessible_page(pmd)) { page_table_check_clear(mm, addr, pmd_pfn(pmd), - PMD_PAGE_SIZE >> PAGE_SHIFT); + PMD_SIZE >> PAGE_SHIFT); } } EXPORT_SYMBOL(__page_table_check_pmd_clear); @@ -190,7 +190,7 @@ void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr, if (pud_user_accessible_page(pud)) { page_table_check_clear(mm, addr, pud_pfn(pud), - PUD_PAGE_SIZE >> PAGE_SHIFT); + PUD_SIZE >> PAGE_SHIFT); } } EXPORT_SYMBOL(__page_table_check_pud_clear); @@ -219,7 +219,7 @@ void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr, __page_table_check_pmd_clear(mm, addr, *pmdp); if (pmd_user_accessible_page(pmd)) { page_table_check_set(mm, addr, pmd_pfn(pmd), - PMD_PAGE_SIZE >> PAGE_SHIFT, + PMD_SIZE >> PAGE_SHIFT, pmd_write(pmd)); } } @@ -234,7 +234,7 @@ void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr, __page_table_check_pud_clear(mm, addr, *pudp); if (pud_user_accessible_page(pud)) { page_table_check_set(mm, addr, pud_pfn(pud), - PUD_PAGE_SIZE >> PAGE_SHIFT, + PUD_SIZE >> PAGE_SHIFT, pud_write(pud)); } } -- 2.25.1