Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2914648pxb; Mon, 18 Apr 2022 10:57:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydyGDzXYuMcRrkXQDqbuNIIAB215KXEeTstclrNQ0olHEviC7Jst+aGoxIa35lbHBpZgnv X-Received: by 2002:a63:f743:0:b0:3a6:6786:30b1 with SMTP id f3-20020a63f743000000b003a6678630b1mr9536366pgk.243.1650304628497; Mon, 18 Apr 2022 10:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650304628; cv=none; d=google.com; s=arc-20160816; b=sJWTf76BChNOga1MTMnxRNMpFamVWq6fo/Fpm07IwetsZItkxtlfELPm6997aew8dE 9OvNAFBQwAk5BkfLmLJRdQKYNMW/bH4Zq3Hv2UbWfpOZPbrOSnFzbdQleI1BWH7Np3FY Z8VXKI9iysdQT6JNC2n6p9jBC5a6xWlq+SjqKS8ZSqHcMcjzWoDsNuzM6oPLChgYeUKb o0GMedWZDFtA7ijqpJaQygtkU+z0xbOgku2l8Ral0swNGxZ3vy4HXWrcNE4Om3gZ/aqQ JPSrX36kW/bf851kErL1Mz5cADGe7oLdddf4bajqE8Wy+ll8R+rKZkYP0kZgkbtIK6z8 HY1Q== 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=Z0hjCNWMEE3SmAnBQLKVmyYxHS9mSPboED0NId0tCdQ=; b=boyOefbWfeT9NDbnn8MXKgYZnaoaClUTZ2mShSVegVAVgUcTR1ulhv375sB/9Z149f oJa4AK09Y0rfugfYE4fulz6+rjszYUnTBk/FBHeAoasKZprfGfEQnBXRxpISIegLObW6 JuJbCa09BzEEv2kMXSBtgJ1pUeuTGoIlMn0P8tt2jhue/4cYbZ+dGSeiGI7T2tTt3PAN o8FFzzWzqLesjfiD/Th56zv2LOvz5X7Smew9PxdmgJLyEJ1UgZciFveHMX1agnoEhNrR x3WvZczM/QU5qzr7gM9cv7bN6wdipZJBPjspfTZf0QoXXKbbcpcQAs1hUw6TDacHaSKt APtQ== 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 d184-20020a6368c1000000b0038233e5d18dsi9792903pgc.491.2022.04.18.10.56.52; Mon, 18 Apr 2022 10:57:08 -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 S232603AbiDRGOy (ORCPT + 99 others); Mon, 18 Apr 2022 02:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbiDRGOw (ORCPT ); Mon, 18 Apr 2022 02:14:52 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 483A217A8C for ; Sun, 17 Apr 2022 23:12:14 -0700 (PDT) Received: from kwepemi100002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Khc3B69nnzFptq; Mon, 18 Apr 2022 14:09:42 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by kwepemi100002.china.huawei.com (7.221.188.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 18 Apr 2022 14:12:11 +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; Mon, 18 Apr 2022 14:12:10 +0800 Message-ID: <0b023809-8138-a44f-83e2-db54a7446954@huawei.com> Date: Mon, 18 Apr 2022 14:12:09 +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 0/4]mm: page_table_check: add support on arm64 and riscv To: 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: <20220418034444.520928-1-tongtiangen@huawei.com> From: Tong Tiangen In-Reply-To: <20220418034444.520928-1-tongtiangen@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.234] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-7.8 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,T_SCC_BODY_TEXT_LINE 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 Hi Andrew, Catalin, Palmer: This patch modifies the code related to the mm/x86/arm64/riscv, who can help me merge it if no object, Maybe Andrew is more appropriate? Thanks, Tong. 在 2022/4/18 11:44, Tong Tiangen 写道: > Page table check performs extra verifications at the time when new > pages become accessible from the userspace by getting their page > table entries (PTEs PMDs etc.) added into the table. It is supported > on X86[1]. > > This patchset made some simple changes and make it easier to support > new architecture, then we support this feature on ARM64 and RISCV. > > [1]https://lore.kernel.org/lkml/20211123214814.3756047-1-pasha.tatashin@soleen.com/ > > v3 -> v4: > 1. Adapt to next-20220414 > > v2 -> v3: > 1. Modify ptep_clear() in include/linux/pgtable.h, using IS_ENABLED > according to the suggestions of Pasha. > > v1 -> v2: > 1. Fix arm64's pte/pmd/pud_user_accessible_page() according to the > suggestions of Catalin. > 2. Also fix riscv's pte_pmd_pud_user_accessible_page(). > > Kefeng Wang (2): > mm: page_table_check: move pxx_user_accessible_page into x86 > arm64: mm: add support for page table check > > Tong Tiangen (2): > mm: page_table_check: add hooks to public helpers > riscv: mm: add support for page table check > > arch/arm64/Kconfig | 1 + > arch/arm64/include/asm/pgtable.h | 65 ++++++++++++++++++++++++--- > arch/riscv/Kconfig | 1 + > arch/riscv/include/asm/pgtable.h | 77 +++++++++++++++++++++++++++++--- > arch/x86/include/asm/pgtable.h | 29 +++++++----- > include/linux/pgtable.h | 26 +++++++---- > mm/page_table_check.c | 25 ++++------- > 7 files changed, 178 insertions(+), 46 deletions(-) >