Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp941536pxb; Fri, 22 Apr 2022 14:57:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7cf96lKE2YqS+1znLdmhwpT+r7b6vT4f72frVMRcbVcet5pJnNOUIwdIxW9tCcjaaOsi2 X-Received: by 2002:a65:4189:0:b0:3a2:1682:5fc with SMTP id a9-20020a654189000000b003a2168205fcmr5572220pgq.426.1650664620143; Fri, 22 Apr 2022 14:57:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650664620; cv=none; d=google.com; s=arc-20160816; b=rNPRhsD8OPJvMG0JNVgALpTw86hp2QVRchkUCazk48VOZdscf63GrNbad4PI3kbIqf uN0cdHfY2Sl5ZZucy+qLeCSqmmXSI8yH8ov433UlUXVCmrgT526ptgkBO/7TYw1rxc09 O6Vy+G+u5RnTLI3liLGVCb6uS8j+SDaF0mm1bPtDfMQCptNdoIlo/q9MtGUH90T+i1xC EsRT848gHPGaAsnCdiM2cTRG8uwzpUMLd6v1LURb71sOxJ/LAgFe1fBGqiZ6SSC1SVdG 4+9gyVthJEb5ZmedzrP+Iwf0a3/VxEHt7QAyJFERdsQh+B7MO1YL6NP5ulUpHs1x245p WRAw== 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=HPaIGuA9ydpULTVgmKbBXL04rW4L09sTnjkayJ+RnFU=; b=GpCWkCdEmMx4nWAbxXniBKVhNTiM2mpFVJQBNbVNT5QRUYERiaMYx7iNN2/D7z8ysO 4ahJIZhEWEn7i+fXD3Mhc3qNgm3xbF2KT0fWteKOZWbBy1sTpy4ezHqB465Ut8iCMuV7 5YVe/oyxUIX1oUA9BJC+hGq20WyzS5Hhg12dYNPfvdovInBoSJa6qY0cS40u0egq+8De fZERMRzg3hEX2y6bq2N9C6UCgIMfxpCGP7d0etL52arOVXMoRsYUu2mKAJXQAIfxmJxF oXnwj/GdZmc7vptbTYVuy/r1rZYNWJS1ydBAJJA5GKaD9PidO8J3XstIWMami3JARrAV cUkA== 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 l3-20020a170902f68300b00153b2d16607si9879979plg.527.2022.04.22.14.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:57:00 -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 F3F24245E4D; Fri, 22 Apr 2022 13:04:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383993AbiDUDrQ (ORCPT + 99 others); Wed, 20 Apr 2022 23:47:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242476AbiDUDrM (ORCPT ); Wed, 20 Apr 2022 23:47:12 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D7E64A1AD for ; Wed, 20 Apr 2022 20:44:23 -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 5488E1477; Wed, 20 Apr 2022 20:44:23 -0700 (PDT) Received: from [192.168.225.231] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 441B93F766; Wed, 20 Apr 2022 20:44:15 -0700 (PDT) Message-ID: <75f444a6-4f50-4356-9e71-f72c59bf0a52@arm.com> Date: Thu, 21 Apr 2022 09:14:54 +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 v4 1/4] mm: page_table_check: move pxx_user_accessible_page into x86 Content-Language: en-US To: Tong Tiangen , 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 , linux-riscv@lists.infradead.org, Kefeng Wang , Guohanjun References: <20220418034444.520928-1-tongtiangen@huawei.com> <20220418034444.520928-2-tongtiangen@huawei.com> <1671baf7-046e-7c52-183f-fd654125fd67@arm.com> From: Anshuman Khandual In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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.