Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4890820iob; Mon, 9 May 2022 04:12:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwociEbNz5FH4qaEV1s+fhjvhxrpuhV5gRLRrOsxdg5n2OW2H02/spmNJYFSK9XvSvua/fW X-Received: by 2002:a65:6d1b:0:b0:3c2:649d:4c9 with SMTP id bf27-20020a656d1b000000b003c2649d04c9mr12833386pgb.202.1652094738422; Mon, 09 May 2022 04:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652094738; cv=none; d=google.com; s=arc-20160816; b=g7jwjOqUvr1hZlRXvsy0Jk2lNHBnd2ow2bm1glAl5p43p+k9V2cMF4DLEyETROmfky Oac3sxiE+1tRskl9nyMSILPl2cx7Dt+6jLwN/Ci6hP+0Or6EaO0eWqxJ7gFbexeUd6R4 sW5NLPtZZ0XE7hyAF8DHKjp/NXAPqY2YcPEDDJ0/GdytcoBRYdK6kQlsWy6nxQL077ww iF7kIS2w1Y8P4gAiP3tOPmGBa0jvmJXZJYsSzydtcQLs7nI8Q69REtiMoT4co0yX1M8b kQXwhnSuzxvEGD+TycvP91tkO6Da9xf1KtJ3/Zp251rhY38hRYbQWEsZ4rnPqwj2hkF9 xugQ== 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=eS2i0k5uKuyUWjKaGrc+gaFPr4d0TaOXRvvEvIHKNgUDHANHSvNoSNAS1hBFQLjoXm Cp59of1WLHWbrpIewUieQUFL/EsLVzfpchICJnyrXg8cYLtsdGk62GNUI9gTy7CIfmDo t1zO8Ecq8tFHCefGooeZztAf2vVL/sxFXclY1tXikFg5Z4qXk1OZmi7d/tityLHy90Tb QCHdwSVfjuoYXZunI0rPOzP5TSgkW++6ES8wXe/OQk6dLbIAXj7VP6wRheWJrpDOLdab i7C5YsSCElIPCafFk9R/cNkZg31XNFyqyNebZY37W+ZwSItlkUFNJxzlK85/Z6IqBoe4 hu7A== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f11-20020a170903104b00b00153b2d16614si5696345plc.540.2022.05.09.04.12.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 04:12:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 58D0722DA1E; Mon, 9 May 2022 03:24:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384404AbiEGKqa (ORCPT + 99 others); Sat, 7 May 2022 06:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343737AbiEGKq3 (ORCPT ); Sat, 7 May 2022 06:46:29 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40F8753A46 for ; Sat, 7 May 2022 03:42:42 -0700 (PDT) Received: from kwepemi100023.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4KwP5w62gGzXdmx; Sat, 7 May 2022 18:37:56 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by kwepemi100023.china.huawei.com (7.221.188.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 7 May 2022 18:42:40 +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; Sat, 7 May 2022 18:42:38 +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 v7 1/6] mm: page_table_check: using PxD_SIZE instead of PxD_PAGE_SIZE Date: Sat, 7 May 2022 11:01:09 +0000 Message-ID: <20220507110114.4128854-2-tongtiangen@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220507110114.4128854-1-tongtiangen@huawei.com> References: <20220507110114.4128854-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: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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