From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89CBBC433EF for ; Fri, 22 Apr 2022 04:40:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443970AbiDVEnb (ORCPT ); Fri, 22 Apr 2022 00:43:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbiDVEn0 (ORCPT ); Fri, 22 Apr 2022 00:43:26 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B85312DD70 for ; Thu, 21 Apr 2022 21:40:34 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 476D31570; Thu, 21 Apr 2022 21:40:34 -0700 (PDT) Received: from [10.163.40.48] (unknown [10.163.40.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8AA053F5A1; Thu, 21 Apr 2022 21:40:26 -0700 (PDT) Message-ID: Date: Fri, 22 Apr 2022 10:11:12 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH -next v5 1/5] mm: page_table_check: using PxD_SIZE instead of PxD_PAGE_SIZE Content-Language: en-US To: Tong Tiangen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Pasha Tatashin , Andrew Morton , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Kefeng Wang , Guohanjun References: <20220421082042.1167967-1-tongtiangen@huawei.com> <20220421082042.1167967-2-tongtiangen@huawei.com> From: Anshuman Khandual In-Reply-To: <20220421082042.1167967-2-tongtiangen@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/21/22 13:50, Tong Tiangen wrote: > Macro PUD_SIZE/PMD_SIZE is more general in various architectures. Using > PUD_SIZE/PMD_SIZE instead of PUD_PAGE_SIZE/PMD_PAGE_SIZE can better > support page table check in architectures other than x86 and it is no > functional impact on x86.> > Suggested-by: Anshuman Khandual > Signed-off-by: Tong Tiangen There are multiple structural problems in the commit message wording but will leave them upto Andrew, if he could fix while merging. Otherwise LGTM 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)); > } > }