Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2880862pxp; Tue, 22 Mar 2022 07:47:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeq5IMXvYr7TlAaxWJmTGYrNnkRKPOdRDbHFL+yzrt8ub7+9O25p85C7Q3XsU5fl4mQavD X-Received: by 2002:a17:906:c107:b0:6df:c114:e286 with SMTP id do7-20020a170906c10700b006dfc114e286mr18710870ejc.216.1647960479261; Tue, 22 Mar 2022 07:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647960479; cv=none; d=google.com; s=arc-20160816; b=OHIkB+lYfA+is8Dcw536efkvWDSU89IE7hj4tAuPNaXkjr8aHiySV/j8hxuTlnjiZe Kkb08ZK5ajJ/qHWqKpjz0YEftNEcGyNJnv9Q5jhY5eVh8k9wbXYf4FwAu6seQimCnX4M MPwI1HEnxdKPPgiaIf5dCobGo0ImxdcwcjYLdZ+Ii1+HLRvS5LZLYV76pqQ3Tarl+yUL Ji18Vlg3dgm61a4iuhy9LyvC+5G92l8Pu9w28rNCKkbiB708LqsvqV0qfSQ6ofLU1ZO+ wkXOeONnXOEVBKNwn/pWm9vwB5VLn+r0p/PEdbpA00/dITu0Felj7wZyZiAqM8eOAr0x oyDw== 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=JoQRaOEckTCEq7+64TogKQ0gkIaK4tJ9HkvHFWBf7Yc=; b=I2tH2PDL1h2O5CGr/xiQZoQw4yGLBsDf7Y1X4avEUbNB1TtE/bpY5v23gCNuYHUJYB j+3oGWLv7RsMwIkiIrfblIUwVwzZz53iaAsvEMQLvlbBW4QRjYygw0gfwcimUifxz+cQ OpMFZ+DfKBw+nvx/DrRwikMt7M9zdjEiSs772YkEaNrYwHOSI6BBwiMxdFrX7VOx745x 1FVplkjCTgiWcmpG2gH8bdoG7Bk3TfozuaZ26gXEehJ0k6hWpDH1kxNyU6Bx7TAOTx97 2Hv4bGN2mXtMOUw/atD5UkU6UGKcslkoxijweFSq/fI2xveXQYiXRJ9E22uGURNUMwWD FRLg== 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 t26-20020a50c25a000000b0041945e1fb48si4869709edf.628.2022.03.22.07.47.33; Tue, 22 Mar 2022 07:47:59 -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 S237852AbiCVO2d (ORCPT + 99 others); Tue, 22 Mar 2022 10:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236729AbiCVO1b (ORCPT ); Tue, 22 Mar 2022 10:27:31 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ACB32B241 for ; Tue, 22 Mar 2022 07:25:51 -0700 (PDT) Received: from kwepemi100001.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KNDKx2LLzzcbFF; Tue, 22 Mar 2022 22:25:41 +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; Tue, 22 Mar 2022 22:25:48 +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; Tue, 22 Mar 2022 22:25:47 +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 , Albert Ou CC: , , , , Tong Tiangen Subject: [PATCH -next v2 0/4]mm: page_table_check: add support on arm64 and riscv Date: Tue, 22 Mar 2022 14:44:43 +0000 Message-ID: <20220322144447.3563146-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: dggems701-chm.china.huawei.com (10.3.19.178) 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/ v1 -> v2: 1. Fix arm64's pte/pmd/pud_user_accessible_page() according to the 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 | 27 +++++++---- mm/page_table_check.c | 25 ++++------- 7 files changed, 179 insertions(+), 46 deletions(-) -- 2.18.0.huawei.25