From patchwork Tue Sep 17 07:31:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 13805940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F99DC35FEC for ; Tue, 17 Sep 2024 07:31:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 79EDA6B0088; Tue, 17 Sep 2024 03:31:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 74EAD6B0089; Tue, 17 Sep 2024 03:31:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 616446B008A; Tue, 17 Sep 2024 03:31:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 404FE6B0088 for ; Tue, 17 Sep 2024 03:31:32 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DA2FC1C1584 for ; Tue, 17 Sep 2024 07:31:31 +0000 (UTC) X-FDA: 82573409982.29.5E827FF Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf28.hostedemail.com (Postfix) with ESMTP id 475F3C000E for ; Tue, 17 Sep 2024 07:31:29 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726558234; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=9j+eEexw0pwPhbimlz/fltFkGnw7JabcD0F6Vy6jlyg=; b=i/007MjhKHkLXi2kiBlxUfBaEAFn3JUglwup/wc0xNPgZsGFo6gvncJ+ocUr33A8XOECAT 7rcPhcgSpJqLAzgFN2a1s/7FaOtHx5h3xyC+NRv5iQ1OalinNnDCSYO4uu5ZSsmFduhEPh u9R3t3GBl9bqta6qaCtF7zrFL73IiAk= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726558234; a=rsa-sha256; cv=none; b=5/wYSje+scyBkEd/ysQu+TFQYg/n9/xD0+zNii89Z1i2X5c1QYABsjBLRUA+GC4EBgPQye J5+QjoBz/neuRnJpfz21CwCz8LQv1knlY7NpNwyuuWcLwSvGz3Hl2Fbgxy74SLJoqSqg65 4soY4gQh5T7JKC1OGF6gIU6mPdUnPi0= 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 AF4CF1063; Tue, 17 Sep 2024 00:31:57 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.61.158]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 904823F64C; Tue, 17 Sep 2024 00:31:23 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org Cc: Anshuman Khandual , Andrew Morton , David Hildenbrand , Ryan Roberts , "Mike Rapoport (IBM)" , Arnd Bergmann , x86@kernel.org, linux-m68k@lists.linux-m68k.org, linux-fsdevel@vger.kernel.org, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V2 0/7] mm: Use pxdp_get() for accessing page table entries Date: Tue, 17 Sep 2024 13:01:10 +0530 Message-Id: <20240917073117.1531207-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 475F3C000E X-Stat-Signature: ntzx1k9mtuwt4n3odz67rxra8ad51rww X-HE-Tag: 1726558289-90581 X-HE-Meta: U2FsdGVkX18aIZs18iwkNm63OFrr/ge9OcuURNhoxlVLyI40tPPxlfgBwzN7C91TSpYlCHi7VwPYd0/WB3a0u4GLAjT/slCuH4tINIH14tDgpnfc8kgSMuVU/MHoBgPKCKFIofiiWLvgc073OCC5pDGSCNwVpvyMDosbqKpWVHI6cE4fjXfOPTWUIRLLLQCTEIBmz9Cr+Rl6msqL2qnuIvgskZ2fQei5QGvX2e8U8TOaHQ9np/RQKoIMWSh0pzE0kZ8PgNSxS3izcZUs8pBdtHfh9dVqMyb2kZmlr7DiTPGTmKIj4IDq5eQ8RFxmpO9LdtkXM6jOnQ8o/s11IZaViZeFcttwPhrGTGXEh5MaRCH5pOX6hdlyiKIXA4KW3wDqI4DCEFhj5kB3Cqf0cuAipVTX5lIYZdPKoLVaBomji9LaWdD4Tjgx9kbSmNVfvTp1AQFF18Rfo1fZqTiFOGsZkStwSLleV/zK35M61KvnLFX7MXUZXaLjDJONH+gkNFmk+Eda7n9S/kbubVEtMLlU3SyXNBsa+U3d8fVRQymvywAccFwQ6nGqMWZSLpkzTQnoHVmsPA3/ZDW1gyeC9RDdfzsDSDcdm4Fwd27vjslBu0zwVT6E/1H7zX2nHIGYOiZ9RWdb3CzTmaspVIQttLISIH5j4eHyGAdnWO7EIGCsAiw2UjRSvdQcIGZBdEuOGYwwpFL1v7JKroU2bZ/XRB2hN6P6Cn1jZWiWPo4LiiJA65zhQdf2CZTiCRJ45yQjZ5IOShGtXRoAlCt0GX9niyMfjpdbbPU7z7tVGFguVkrbwShfq5otWjY/nHPRMawmwlT51ncjf2ela4wkpC2SA4buEzk0ugWV0PtSwiYnmY+PfMQodHKNVR+QaCsZti9P2UQR3VZ3X7+FfEgC1uYNGcXygaGFZEMYAoE2Z5xpIdCltRJFF4mIX1MctaLqNmyTd4vc0hGvAYhklR23c8YjFz2 lmKKQAHJ Fj0ofInJOcct5+gAeH35V6zNHAjqtXCYXWKSPVqT66bwtfDoKuLz0oEOnpsn4n1FDshSX1FnRlk8WJHo336dPNy2J34u7SSs78mjHJdJTHA6IHIKpJWBgwVbx1bekGp+YuJTS0JJ2OSX9ddNlgaXHY1Kr0lSqHoTEoig/xsraPF6K1/3xL46C/16Ud4fSArsUJuChmQ3+ts84V1umou6i9h7OrmpaeTbuQYLOMLgz2U5BQ3HNKJVqSf6CVbwghx7v+rbXXHYgOcPNIYS8spibsmrg3H+9dZclqGwBAAou44Hq0HbtlQ3VdFE+oRD0RosG3Rvm4eJjB/x+HbivO1cOeFt46SMZrlpe3017Q3oNXYFBXVvN1F0Wbkc5KzVR84LKVD/r51aX+NOdUsTSuDnaekvnTr1P1Pbyj68uep19WAQzRtTUcOdOmkGGXjkkv/nGwooWrqFjeyhGnqPQCW1pSGxZaSCdRujKtWsXMt+Q8rZvdS8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This series converts all generic page table entries direct derefences via pxdp_get() based helpers extending the changes brought in via the commit c33c794828f2 ("mm: ptep_get() conversion"). First it does some platform specific changes for m68k and x86 architecture. This series has been build tested on multiple architecture such as x86, arm64, powerpc, powerpc64le, riscv, and m68k etc. Cc: Andrew Morton Cc: David Hildenbrand Cc: Ryan Roberts Cc: "Mike Rapoport (IBM)" Cc: Arnd Bergmann Cc: x86@kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-mm@kvack.org Cc: linux-fsdevel@vger.kernel.org Cc: kasan-dev@googlegroups.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Cc: kasan-dev@googlegroups.com Changes in V2: - Separated out PUD changes from P4D changes - Updated the commit message for x86 patch per Dave - Implemented local variable page table value caching when applicable - Updated all commit messages regarding local variable caching Changes in V1: https://lore.kernel.org/all/20240913084433.1016256-1-anshuman.khandual@arm.com/ Anshuman Khandual (7): m68k/mm: Change pmd_val() x86/mm: Drop page table entry address output from pxd_ERROR() mm: Use ptep_get() for accessing PTE entries mm: Use pmdp_get() for accessing PMD entries mm: Use pudp_get() for accessing PUD entries mm: Use p4dp_get() for accessing P4D entries mm: Use pgdp_get() for accessing PGD entries arch/m68k/include/asm/page.h | 2 +- arch/x86/include/asm/pgtable-3level.h | 12 ++-- arch/x86/include/asm/pgtable_64.h | 20 +++--- drivers/misc/sgi-gru/grufault.c | 13 ++-- fs/proc/task_mmu.c | 28 +++++---- fs/userfaultfd.c | 6 +- include/linux/huge_mm.h | 6 +- include/linux/mm.h | 6 +- include/linux/pgtable.h | 49 +++++++++------ kernel/events/core.c | 6 +- mm/gup.c | 43 ++++++------- mm/hmm.c | 2 +- mm/huge_memory.c | 90 +++++++++++++++------------ mm/hugetlb.c | 10 +-- mm/hugetlb_vmemmap.c | 4 +- mm/kasan/init.c | 38 +++++------ mm/kasan/shadow.c | 12 ++-- mm/khugepaged.c | 4 +- mm/madvise.c | 6 +- mm/mapping_dirty_helpers.c | 2 +- mm/memory-failure.c | 14 ++--- mm/memory.c | 71 +++++++++++---------- mm/mempolicy.c | 4 +- mm/migrate.c | 4 +- mm/migrate_device.c | 10 +-- mm/mlock.c | 6 +- mm/mprotect.c | 2 +- mm/mremap.c | 4 +- mm/page_table_check.c | 4 +- mm/page_vma_mapped.c | 6 +- mm/pagewalk.c | 10 +-- mm/percpu.c | 8 +-- mm/pgalloc-track.h | 6 +- mm/pgtable-generic.c | 30 ++++----- mm/ptdump.c | 8 +-- mm/rmap.c | 10 +-- mm/sparse-vmemmap.c | 10 +-- mm/vmalloc.c | 58 +++++++++-------- mm/vmscan.c | 6 +- 39 files changed, 333 insertions(+), 297 deletions(-)