Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1435399pxp; Thu, 17 Mar 2022 09:12:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDXLwTy/vg7ZRFTIBWhxtAj9uoXFbYz37DuKN0sTWdE3Br0nGUA5iQpuQWCye3Msr51/fH X-Received: by 2002:a17:907:97d4:b0:6df:ad22:f9c with SMTP id js20-20020a17090797d400b006dfad220f9cmr1060549ejc.680.1647533534148; Thu, 17 Mar 2022 09:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647533534; cv=none; d=google.com; s=arc-20160816; b=hYzha8eWHP3YZ5tq1niGt4FEziDWjbDjSSszBNT7klVd2W3fCVOdHVKSWlhnxOBYVE 9jc0PqLGAKkwe5PfmZAFmQjVtVcKk8XOwKUJpfhaS1txS+DiO5QSiWAGBGreHB8Rq11c SEm0QtX3tqVPf5aW4cDYRcw/XEMZ9CC33aedQdidNn+EBX6rrSvqefJX6U6p4yzJdrlD QX8DWomQyU+0o3/BiU2DHyESLX2zcf8UzIpCAPJA8dGVs3lDdPU6EQrvMPva3HN2olhH KLYsahDJPtvI2ffTOfwKSAQ9NS0MNX5AmQrKB3qWjDYfySxReQ9YOa2WLZFIQeF8LGXD vuMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=/axIPxwfKcQK1MDrKEmLYMEBsDEy+ys9P/FDsuInwrc=; b=kqvluSpbw+kNs2cjheYnwldaoXpO0h86z0CYD4IFeBFAPYNKEIEKVd+MXnwGdJiWmG cbB7Ftlwa27EgU/X/J8PI6napVc8BCzIaazgdRJrKlINwYJBc+i6ZROpb/uKSGPuQwgN uVXXyqvd5EQ4DqQwO+rCDfOAsg3D6Gyf7oix525bSlJhtf5W+T9xe7w4RqSc4MVQEuNU S73psGG8mQscUq1cC9nKMFvaisOlAMQGAikT9FH9agms0x8DCHUZrJo0eG6iJCCIi8bB G++nWRTdtBQ24gHDf9qOyHi/1OMNVDhcjqeDPgekMPF5H2jXRzZcG9lzSh/JMLLi+nJG cF0g== 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 i12-20020a50870c000000b00418c2b5bec9si1723956edb.427.2022.03.17.09.11.47; Thu, 17 Mar 2022 09:12:14 -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 S234709AbiCQNyn (ORCPT + 99 others); Thu, 17 Mar 2022 09:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231845AbiCQNyk (ORCPT ); Thu, 17 Mar 2022 09:54:40 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20C3381655 for ; Thu, 17 Mar 2022 06:53:23 -0700 (PDT) Received: from kwepemi100001.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KK7l91yBszcb9Y; Thu, 17 Mar 2022 21:48:21 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by kwepemi100001.china.huawei.com (7.221.188.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 17 Mar 2022 21:53:20 +0800 Received: from localhost.localdomain (10.175.112.125) 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.2308.21; Thu, 17 Mar 2022 21:53:19 +0800 From: Tong Tiangen To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , Pasha Tatashin , Andrew Morton , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Palmer Dabbelt , Albert Ou CC: , , , , Tong Tiangen Subject: [PATCH -next 0/4]mm: page_table_check: add support on arm64 and riscv Date: Thu, 17 Mar 2022 14:11:59 +0000 Message-ID: <20220317141203.3646253-1-tongtiangen@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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 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/ 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 | 63 ++++++++++++++++++++++++++++--- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/pgtable.h | 64 +++++++++++++++++++++++++++++--- arch/x86/include/asm/pgtable.h | 29 ++++++++++----- include/linux/pgtable.h | 27 ++++++++++---- mm/page_table_check.c | 25 ++++--------- 7 files changed, 164 insertions(+), 46 deletions(-) -- 2.18.0.huawei.25