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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3761C433F5 for ; Fri, 22 Apr 2022 06:30:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 614A46B0072; Fri, 22 Apr 2022 02:30:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 59E4E6B0073; Fri, 22 Apr 2022 02:30:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 417D76B0074; Fri, 22 Apr 2022 02:30:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 2B35F6B0072 for ; Fri, 22 Apr 2022 02:30:13 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E4BCF245E0 for ; Fri, 22 Apr 2022 06:30:12 +0000 (UTC) X-FDA: 79383540264.02.6F98FD4 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf06.hostedemail.com (Postfix) with ESMTP id EFEE5180008 for ; Fri, 22 Apr 2022 06:30:10 +0000 (UTC) Received: from kwepemi100023.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kl4Hy5T8mz1J9m3; Fri, 22 Apr 2022 14:29:18 +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; Fri, 22 Apr 2022 14:30:05 +0800 Received: from [10.174.179.234] (10.174.179.234) 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; Fri, 22 Apr 2022 14:30:04 +0800 Message-ID: <10215555-5eb6-d53d-5949-d603ce346d6f@huawei.com> Date: Fri, 22 Apr 2022 14:30:03 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH -next v5 2/5] mm: page_table_check: move pxx_user_accessible_page into x86 To: Anshuman Khandual , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , Pasha Tatashin , Andrew Morton , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou CC: , , , , Kefeng Wang , Guohanjun References: <20220421082042.1167967-1-tongtiangen@huawei.com> <20220421082042.1167967-3-tongtiangen@huawei.com> <905f22d6-0671-21b2-a341-bdc5ba02e59c@arm.com> From: Tong Tiangen In-Reply-To: <905f22d6-0671-21b2-a341-bdc5ba02e59c@arm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.234] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: EFEE5180008 X-Stat-Signature: mq6756o9dk8teefaub4rw46su4zr88qc Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf06.hostedemail.com: domain of tongtiangen@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=tongtiangen@huawei.com X-HE-Tag: 1650609010-62160 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 在 2022/4/22 13:11, Anshuman Khandual 写道: > Similar to previous commits on the same file, the following subject > line format, would have been preferred. > > mm/page_table_check: > > On 4/21/22 13:50, Tong Tiangen wrote: >> From: Kefeng Wang >> >> The pxx_user_accessible_page() check the PTE bit, it's > > s/check/checks ^^^^ > >> architecture-specific code, move them into x86's pgtable.h > The commit message should have been more clear, atleast complete in > sentences. I dont want to be bike shedding here but this is definitely > incomplete. These helpers are being moved out to make the page table > check framework, platform independent. Hence the commit message should > mention this. The commit message is not very clear and it is too simple. Thanks. > >> >> Signed-off-by: Kefeng Wang >> Signed-off-by: Tong Tiangen >> Acked-by: Pasha Tatashin >> --- >> arch/x86/include/asm/pgtable.h | 19 +++++++++++++++++++ >> mm/page_table_check.c | 17 ----------------- >> 2 files changed, 19 insertions(+), 17 deletions(-) >> >> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h >> index b7464f13e416..564abe42b0f7 100644 >> --- a/arch/x86/include/asm/pgtable.h >> +++ b/arch/x86/include/asm/pgtable.h >> @@ -1447,6 +1447,25 @@ static inline bool arch_has_hw_pte_young(void) >> return true; >> } >> >> +#ifdef CONFIG_PAGE_TABLE_CHECK >> +static inline bool pte_user_accessible_page(pte_t pte) >> +{ >> + return (pte_val(pte) & _PAGE_PRESENT) && (pte_val(pte) & _PAGE_USER); >> +} >> + >> +static inline bool pmd_user_accessible_page(pmd_t pmd) >> +{ >> + return pmd_leaf(pmd) && (pmd_val(pmd) & _PAGE_PRESENT) && >> + (pmd_val(pmd) & _PAGE_USER); >> +} >> + >> +static inline bool pud_user_accessible_page(pud_t pud) >> +{ >> + return pud_leaf(pud) && (pud_val(pud) & _PAGE_PRESENT) && >> + (pud_val(pud) & _PAGE_USER); > > A line break is not really required here (and above as well). As single > complete line would still be within 100 characters. > Right, now one line can have 100 characters. Thanks. >> +} >> +#endif >> + >> #endif /* __ASSEMBLY__ */ >> >> #endif /* _ASM_X86_PGTABLE_H */ >> diff --git a/mm/page_table_check.c b/mm/page_table_check.c >> index eb0d0b71cdf6..3692bea2ea2c 100644 >> --- a/mm/page_table_check.c >> +++ b/mm/page_table_check.c >> @@ -52,23 +52,6 @@ static struct page_table_check *get_page_table_check(struct page_ext *page_ext) >> return (void *)(page_ext) + page_table_check_ops.offset; >> } >> >> -static inline bool pte_user_accessible_page(pte_t pte) >> -{ >> - return (pte_val(pte) & _PAGE_PRESENT) && (pte_val(pte) & _PAGE_USER); >> -} >> - >> -static inline bool pmd_user_accessible_page(pmd_t pmd) >> -{ >> - return pmd_leaf(pmd) && (pmd_val(pmd) & _PAGE_PRESENT) && >> - (pmd_val(pmd) & _PAGE_USER); >> -} >> - >> -static inline bool pud_user_accessible_page(pud_t pud) >> -{ >> - return pud_leaf(pud) && (pud_val(pud) & _PAGE_PRESENT) && >> - (pud_val(pud) & _PAGE_USER); >> -} >> - >> /* >> * An enty is removed from the page table, decrement the counters for that page >> * verify that it is of correct type and counters do not become negative. > > With above mentioned code cleanup and commit message changes in place. > > Reviewed-by: Anshuman Khandual > .