Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp892103pxb; Thu, 21 Apr 2022 12:47:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgul0tKyRbRdWgtowE0CnJD44rjQFGZbSswP1jo9EbKqOMOaPKht6d1ASaD53lI3WXhqEz X-Received: by 2002:a05:6402:3482:b0:423:e3d4:2137 with SMTP id v2-20020a056402348200b00423e3d42137mr1157912edc.369.1650570430419; Thu, 21 Apr 2022 12:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650570430; cv=none; d=google.com; s=arc-20160816; b=ZPYM8hcoAqJ2vhrZ1dPKAyT63pKhATL9jlEia4GtacC/VRa+VN2d592IV86DVDlBFU WZhhTh91KYXmrt1PE3wVd/PvuhgPy7CIVZjggD6AwHs00FZbdnzWXZwxT3h5BuOfwmIY UfKH4ukArN4uebXurp4eSeh9yR+v6KsgLvvDXuIckRWmPGDxI1F7vw46p7x40nfVoz4a +a9iDZqHnNny6a5KKqexLtDC9HkGU4ujHDSlDd7ALlxzGq8kZf+47CanTv0xy9Wt5pOp jwbckYLr9xT5YIkLRgjfNThs3wkHTMFy9I+pdtHXTSQUR+wNiN/kYOwSfjMV4UBE4Wog bCdQ== 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:subject:user-agent:mime-version:date:message-id; bh=SlgsdHzrTQsE9tVKezcpgTD9UisILPTBVWSG8DxxjdU=; b=DoVsL/xVPAsOHZBkS5cYuWPll1VQp1JrYy+dJTSytKzm8qpC07ySRxo1CGuiSJMYd/ OcoLmFcw7YWjQ36NnoboRS+X6XCP89QWFDRbY6R+xleDNuDt8kZB6nIoEmuoTBXPtpZs RWjom5qQbI+Vl4Qgjfm6QABomI8dUCmuz5RMLgBlS/IIAOe/HJNEmun394Y47VPucBfp woinPOTj6azA4nJWbbf0GGysT21Al0FvpJSvQ2G/TPKXgaYGTNo3I4oE22U5cUb6vRg3 c/cs/g+trVpqCO/HcGieak9uMqXnyJE0zEeN2TF4mxoFhSxMPl4a2X2fwiZzx1J4QChJ GZCg== 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 j9-20020a05640211c900b00423e43ebb81si5386077edw.29.2022.04.21.12.46.46; Thu, 21 Apr 2022 12:47:10 -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 S1384813AbiDUGaa (ORCPT + 99 others); Thu, 21 Apr 2022 02:30:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384827AbiDUGaG (ORCPT ); Thu, 21 Apr 2022 02:30:06 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3FCC13F31 for ; Wed, 20 Apr 2022 23:27:11 -0700 (PDT) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KkSH32BTGzfYw0; Thu, 21 Apr 2022 14:26:23 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 21 Apr 2022 14:27:09 +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; Thu, 21 Apr 2022 14:27:07 +0800 Message-ID: Date: Thu, 21 Apr 2022 14:27:07 +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 v4 1/4] mm: page_table_check: move pxx_user_accessible_page into x86 To: Anshuman Khandual , Pasha Tatashin CC: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Andrew Morton , "Catalin Marinas" , Will Deacon , "Paul Walmsley" , Palmer Dabbelt , Albert Ou , LKML , linux-mm , Linux ARM , , Kefeng Wang , Guohanjun References: <20220418034444.520928-1-tongtiangen@huawei.com> <20220418034444.520928-2-tongtiangen@huawei.com> <1671baf7-046e-7c52-183f-fd654125fd67@arm.com> <75f444a6-4f50-4356-9e71-f72c59bf0a52@arm.com> From: Tong Tiangen In-Reply-To: <75f444a6-4f50-4356-9e71-f72c59bf0a52@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-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 在 2022/4/21 11:44, Anshuman Khandual 写道: > > > On 4/21/22 08:35, Tong Tiangen wrote: >> >> >> 在 2022/4/21 0:44, Pasha Tatashin 写道: >>> On Wed, Apr 20, 2022 at 2:45 AM Tong Tiangen wrote: >>>> >>>> >>>> >>>> 在 2022/4/19 17:29, Anshuman Khandual 写道: >>>>> >>>>> >>>>> On 4/18/22 09:14, Tong Tiangen wrote: >>>>>> --- a/mm/page_table_check.c >>>>>> +++ b/mm/page_table_check.c >>>>>> @@ -10,6 +10,14 @@ >>>>>>    #undef pr_fmt >>>>>>    #define pr_fmt(fmt)        "page_table_check: " fmt >>>>>> >>>>>> +#ifndef PMD_PAGE_SIZE >>>>>> +#define PMD_PAGE_SIZE       PMD_SIZE >>>>>> +#endif >>>>>> + >>>>>> +#ifndef PUD_PAGE_SIZE >>>>>> +#define PUD_PAGE_SIZE       PUD_SIZE >>>>>> +#endif >>>>> >>>>> Why cannot PMD_SIZE/PUD_SIZE be used on every platform instead ? What is the >>>>> need for using PUD_PAGE_SIZE/PMD_PAGE_SIZE ? Are they different on x86 ? >>>>> . >>>> >>>> Hi, Pasha: >>>> I checked the definitions of PMD_SIZE/PUD_SIZE and >>>> PUD_PAGE_SIZE/PMD_PAGE_SIZE in x86 architecture and their use outside >>>> the architecture(eg: in mm/, all used PMD_SIZE/PUD_SIZE), Would it be >>>> better to use a unified PMD_SIZE/PUD_SIZE here? >>> >>> Hi Tong, >>> >>> Yes, it makes sense to use PMD_SIZE/PUD_SIZE instead of >>> PUD_PAGE_SIZE/PMD_PAGE_SIZE in page_table_check to be inline with the >>> rest of the mm/ >>> >>> Pasha >>> >> Hi Pasha and Anshuman: >> >> OK, Functional correctness is not affected here, i plan to optimize this point after this patchset is merged. > > As page table check is now being proposed to be supported on multiple platforms i.e > arm64, riscv besides just x86, it should not have any architecture specific macros > or functions. Hence please do generalize these PMD/PUD sizes in this series itself. > . OK, will resend. Thank you. Tong.