Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp774023pxb; Fri, 22 Apr 2022 10:51:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQk4vNIoo9M/xl8E9y6UsJKJl4Bq7yWE8ZjUynHWyopRxgIyJnAZyzKH+YdFT/sCUQA9hS X-Received: by 2002:a62:7943:0:b0:50a:cd7a:8336 with SMTP id u64-20020a627943000000b0050acd7a8336mr5941288pfc.59.1650649916961; Fri, 22 Apr 2022 10:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650649916; cv=none; d=google.com; s=arc-20160816; b=MjvlQpId2VPGZoWd8SoUfHdn7o/z/+7SEPR1RF5FG2rEEIN9vAKOJjtisjgkoM7iI1 hDykq2zjIcTvRQRKIX1RgreH6ear1K7VKknzQCYC3Pozpn95YcZEFYb5DTJ2T8FewKsl +fIzXrsEyw35QPZBXg68e3CYdnYgNHP7QuRhnDbeLDnEf+aiN2tHpPbw8tH76faNBulE IGPuZCyjelO21/276Fgfx9QP6QAoN/wvWRDE9GIMV1CL88eG6Dr0zTFyy/cLcwE76Sd5 osCf2/baVXkpB9ECsAOW42SR6czLgJ6nDkFzCqCBy1XqswUwvOwN4/x/wL7NFV6Yl49X NR/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=itSl7IXVVzeWqevkITmRl3NhxURFEyLs5LIyXJzxJn4=; b=g/qmUgBacuOZQ2UKvtvaWQ3pIi8SfnIjOE+qegfFpzA/WW44Ep5rwVDbmjAy/+bQhM r5jd9eIhMagcKBQO28Zu8RTSSqjrYJ6HCh7qdFYs2/v4A47squSUh6OJOQQO1lpnW8qZ /6SoEkAlZ2atySdNGw1VneMnX03Hy7De1pLYyaEyzC1dTaXvASYgd9iqDqJgTcrIinTG 5ZW9xYagvHhu+5mWjFoh37Rqpix9tSwm79ZPOI8DBkh/73f73plBs8wGVstVxOZE4aLW Q/kmSuZXO5ykSD73/X6VXpzluaRDG5osB2D9Lv/uivtOW2az1hXh64BTKMgTAJ3RXnES hrAA== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 18-20020a631952000000b003823f33cdd2si9132598pgz.209.2022.04.22.10.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 10:51:56 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 045D6BCB68; Fri, 22 Apr 2022 10:35:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443968AbiDVEn3 (ORCPT + 99 others); Fri, 22 Apr 2022 00:43:29 -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 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 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)); > } > }