From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28268C4167B for ; Mon, 28 Feb 2022 10:48:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234902AbiB1KtY (ORCPT ); Mon, 28 Feb 2022 05:49:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232469AbiB1KtX (ORCPT ); Mon, 28 Feb 2022 05:49:23 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 32CCE43486; Mon, 28 Feb 2022 02:48:44 -0800 (PST) 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 EA0F81063; Mon, 28 Feb 2022 02:48:43 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.47.185]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6F2553F73D; Mon, 28 Feb 2022 02:48:36 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, geert@linux-m68k.org, Anshuman Khandual , Christoph Hellwig , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linux-mips@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-s390@vger.kernel.org, linux-riscv@lists.infradead.org, linux-alpha@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-parisc@vger.kernel.org, openrisc@lists.librecores.org, linux-um@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH V3 00/30] mm/mmap: Drop protection_map[] and platform's __SXXX/__PXXX requirements Date: Mon, 28 Feb 2022 16:17:23 +0530 Message-Id: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org protection_map[] is an array based construct that translates given vm_flags combination. This array contains page protection map, which is populated by the platform via [__S000 .. __S111] and [__P000 .. __P111] exported macros. Primary usage for protection_map[] is for vm_get_page_prot(), which is used to determine page protection value for a given vm_flags. vm_get_page_prot() implementation, could again call platform overrides arch_vm_get_page_prot() and arch_filter_pgprot(). Some platforms override protection_map[] that was originally built with __SXXX/__PXXX with different runtime values. Currently there are multiple layers of abstraction i.e __SXXX/__PXXX macros , protection_map[], arch_vm_get_page_prot() and arch_filter_pgprot() built between the platform and generic MM, finally defining vm_get_page_prot(). Hence this series proposes to drop all these abstraction levels and instead just move the responsibility of defining vm_get_page_prot() to the platform itself making it clean and simple. This first introduces ARCH_HAS_VM_GET_PAGE_PROT which enables the platforms to define custom vm_get_page_prot(). This starts converting platforms that either change protection_map[] or define the overrides arch_filter_pgprot() or arch_vm_get_page_prot() which enables for those constructs to be dropped off completely. This series then converts remaining platforms which enables for __SXXX/__PXXX constructs to be dropped off completely. Finally it drops the generic vm_get_page_prot() and then ARCH_HAS_VM_GET_PAGE_PROT as every platform now defines their own vm_get_page_prot(). The series has been inspired from an earlier discuss with Christoph Hellwig https://lore.kernel.org/all/1632712920-8171-1-git-send-email-anshuman.khandual@arm.com/ This series applies on 5.17-rc6 after the following patch. https://lore.kernel.org/all/1643004823-16441-1-git-send-email-anshuman.khandual@arm.com/ This series has been cross built for multiple platforms. - Anshuman Cc: Christoph Hellwig Cc: Andrew Morton Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: sparclinux@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-s390@vger.kernel.org Cc: linux-riscv@lists.infradead.org Cc: linux-alpha@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-csky@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: linux-parisc@vger.kernel.org Cc: openrisc@lists.librecores.org Cc: linux-um@lists.infradead.org Cc: linux-hexagon@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org Changes in V3: - Dropped variable 'i' from sme_early_init() on x86 platform - Moved CONFIG_COLDFIRE vm_get_page_prot() inside arch/m68k/mm/mcfmmu.c - Moved CONFIG_SUN3 vm_get_page_prot() inside arch/m68k/mm/sun3mmu.c - Dropped cachebits for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped PAGE_XXX_C definitions from arch/m68k/include/asm/motorola_pgtable.h - Used PAGE_XXX instead for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped all references to protection_map[] in the tree - Replaced s/extensa/xtensa/ on the patch title - Moved left over comments from pgtable.h into init.c on nios2 platform Changes in V2: https://lore.kernel.org/all/1645425519-9034-1-git-send-email-anshuman.khandual@arm.com/ - Dropped the entire comment block in [PATCH 30/30] per Geert - Replaced __P010 (although commented) with __PAGE_COPY on arm platform - Replaced __P101 with PAGE_READONLY on um platform Changes in V1: https://lore.kernel.org/all/1644805853-21338-1-git-send-email-anshuman.khandual@arm.com/ - Add white spaces around the | operators - Moved powerpc_vm_get_page_prot() near vm_get_page_prot() on powerpc - Moved arm64_vm_get_page_prot() near vm_get_page_prot() on arm64 - Moved sparc_vm_get_page_prot() near vm_get_page_prot() on sparc - Compacted vm_get_page_prot() switch cases on all platforms - _PAGE_CACHE040 inclusion is dependent on CPU_IS_040_OR_060 - VM_SHARED case should return PAGE_NONE (not PAGE_COPY) on SH platform - Reorganized VM_SHARED, VM_EXEC, VM_WRITE, VM_READ - Dropped the last patch [RFC V1 31/31] which added macros for vm_flags combinations https://lore.kernel.org/all/1643029028-12710-32-git-send-email-anshuman.khandual@arm.com/ Changes in RFC: https://lore.kernel.org/all/1643029028-12710-1-git-send-email-anshuman.khandual@arm.com/ Anshuman Khandual (29): mm/debug_vm_pgtable: Drop protection_map[] usage mm/mmap: Clarify protection_map[] indices mm/mmap: Add new config ARCH_HAS_VM_GET_PAGE_PROT powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sparc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mips/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop protection_map[] mm/mmap: Drop arch_filter_pgprot() mm/mmap: Drop arch_vm_get_page_pgprot() s390/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT riscv/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT alpha/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sh/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT xtensa/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT parisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT openrisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT um/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT microblaze/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nios2/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT hexagon/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nds32/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT ia64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop generic vm_get_page_prot() mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT Christoph Hellwig (1): x86/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arch/alpha/include/asm/pgtable.h | 17 ----- arch/alpha/mm/init.c | 37 +++++++++++ arch/arc/include/asm/pgtable-bits-arcv2.h | 17 ----- arch/arc/mm/mmap.c | 41 ++++++++++++ arch/arm/include/asm/pgtable.h | 20 +----- arch/arm/lib/uaccess_with_memcpy.c | 2 +- arch/arm/mm/mmu.c | 44 +++++++++++-- arch/arm64/Kconfig | 1 - arch/arm64/include/asm/memory.h | 3 +- arch/arm64/include/asm/mman.h | 24 ------- arch/arm64/include/asm/pgtable-prot.h | 18 ------ arch/arm64/include/asm/pgtable.h | 11 ---- arch/arm64/mm/mmap.c | 78 +++++++++++++++++++++++ arch/csky/include/asm/pgtable.h | 18 ------ arch/csky/mm/init.c | 32 ++++++++++ arch/hexagon/include/asm/pgtable.h | 24 ------- arch/hexagon/mm/init.c | 67 +++++++++++++++++++ arch/ia64/include/asm/pgtable.h | 17 ----- arch/ia64/mm/init.c | 41 +++++++++++- arch/m68k/include/asm/mcf_pgtable.h | 59 ----------------- arch/m68k/include/asm/motorola_pgtable.h | 29 --------- arch/m68k/include/asm/sun3_pgtable.h | 22 ------- arch/m68k/mm/mcfmmu.c | 59 +++++++++++++++++ arch/m68k/mm/motorola.c | 43 ++++++++++++- arch/m68k/mm/sun3mmu.c | 39 ++++++++++++ arch/microblaze/include/asm/pgtable.h | 17 ----- arch/microblaze/mm/init.c | 41 ++++++++++++ arch/mips/include/asm/pgtable.h | 22 ------- arch/mips/mm/cache.c | 60 +++++++++-------- arch/nds32/include/asm/pgtable.h | 17 ----- arch/nds32/mm/mmap.c | 37 +++++++++++ arch/nios2/include/asm/pgtable.h | 24 ------- arch/nios2/mm/init.c | 47 ++++++++++++++ arch/openrisc/include/asm/pgtable.h | 18 ------ arch/openrisc/mm/init.c | 41 ++++++++++++ arch/parisc/include/asm/pgtable.h | 20 ------ arch/parisc/mm/init.c | 40 ++++++++++++ arch/powerpc/include/asm/mman.h | 12 ---- arch/powerpc/include/asm/pgtable.h | 19 ------ arch/powerpc/mm/mmap.c | 59 +++++++++++++++++ arch/riscv/include/asm/pgtable.h | 16 ----- arch/riscv/mm/init.c | 42 ++++++++++++ arch/s390/include/asm/pgtable.h | 17 ----- arch/s390/mm/mmap.c | 33 ++++++++++ arch/sh/include/asm/pgtable.h | 17 ----- arch/sh/mm/mmap.c | 38 +++++++++++ arch/sparc/include/asm/mman.h | 6 -- arch/sparc/include/asm/pgtable_32.h | 19 ------ arch/sparc/include/asm/pgtable_64.h | 19 ------ arch/sparc/mm/init_32.c | 35 ++++++++++ arch/sparc/mm/init_64.c | 70 ++++++++++++++------ arch/um/include/asm/pgtable.h | 17 ----- arch/um/kernel/mem.c | 35 ++++++++++ arch/x86/Kconfig | 1 - arch/x86/include/asm/pgtable.h | 5 -- arch/x86/include/asm/pgtable_types.h | 19 ------ arch/x86/include/uapi/asm/mman.h | 14 ---- arch/x86/mm/Makefile | 2 +- arch/x86/mm/mem_encrypt_amd.c | 6 -- arch/x86/mm/pgprot.c | 71 +++++++++++++++++++++ arch/x86/um/mem_32.c | 2 +- arch/xtensa/include/asm/pgtable.h | 19 ------ arch/xtensa/mm/init.c | 35 ++++++++++ drivers/gpu/drm/drm_vm.c | 4 +- include/linux/mm.h | 6 -- include/linux/mman.h | 4 -- mm/Kconfig | 3 - mm/debug_vm_pgtable.c | 31 +++++---- mm/mmap.c | 44 +------------ 69 files changed, 1138 insertions(+), 729 deletions(-) create mode 100644 arch/x86/mm/pgprot.c -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F677C4332F for ; Mon, 28 Feb 2022 10:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=kVUwFDVUIzg1m6aX9PrOWzhcGhMxeNFivlTgJv3PjLM=; b=HKDJni/WgJWf7u PAyHuON5KH9jROb1xulqDB3cu3gLFXS+DjVbssOzeST/IJhiYagXlxTEzxBQ4kEWC+o2RcFXK2T+S wBgIx7LYC3zXbN46ivjzv3DRyR15W/kp7lSi9AzxUpAvT94/L5fDltWextJ/smL07kjvJKELE0XeT vssYGOpkWFYGqJ6fa4rtpAInQI9S3IFHihteM2BbkfeGZ8K6wCmxmjZubhRqIknW33aC4JIs4BQHj eFdVz4g7m8Dc47I7cXeLvshrCRyIUDhBpdBSgth247Kye4D2vLiP9nxU9jrNIYVVkOK7NMeWGzFNG Y3JStSpShzt/N1iLWoFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOdaN-00BXBp-KN; Mon, 28 Feb 2022 10:48:59 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOdaA-00BX7B-8K; Mon, 28 Feb 2022 10:48:48 +0000 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 EA0F81063; Mon, 28 Feb 2022 02:48:43 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.47.185]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6F2553F73D; Mon, 28 Feb 2022 02:48:36 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, geert@linux-m68k.org, Anshuman Khandual , Christoph Hellwig , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linux-mips@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-s390@vger.kernel.org, linux-riscv@lists.infradead.org, linux-alpha@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-parisc@vger.kernel.org, openrisc@lists.librecores.org, linux-um@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH V3 00/30] mm/mmap: Drop protection_map[] and platform's __SXXX/__PXXX requirements Date: Mon, 28 Feb 2022 16:17:23 +0530 Message-Id: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_024846_419449_F78B946A X-CRM114-Status: GOOD ( 17.74 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org protection_map[] is an array based construct that translates given vm_flags combination. This array contains page protection map, which is populated by the platform via [__S000 .. __S111] and [__P000 .. __P111] exported macros. Primary usage for protection_map[] is for vm_get_page_prot(), which is used to determine page protection value for a given vm_flags. vm_get_page_prot() implementation, could again call platform overrides arch_vm_get_page_prot() and arch_filter_pgprot(). Some platforms override protection_map[] that was originally built with __SXXX/__PXXX with different runtime values. Currently there are multiple layers of abstraction i.e __SXXX/__PXXX macros , protection_map[], arch_vm_get_page_prot() and arch_filter_pgprot() built between the platform and generic MM, finally defining vm_get_page_prot(). Hence this series proposes to drop all these abstraction levels and instead just move the responsibility of defining vm_get_page_prot() to the platform itself making it clean and simple. This first introduces ARCH_HAS_VM_GET_PAGE_PROT which enables the platforms to define custom vm_get_page_prot(). This starts converting platforms that either change protection_map[] or define the overrides arch_filter_pgprot() or arch_vm_get_page_prot() which enables for those constructs to be dropped off completely. This series then converts remaining platforms which enables for __SXXX/__PXXX constructs to be dropped off completely. Finally it drops the generic vm_get_page_prot() and then ARCH_HAS_VM_GET_PAGE_PROT as every platform now defines their own vm_get_page_prot(). The series has been inspired from an earlier discuss with Christoph Hellwig https://lore.kernel.org/all/1632712920-8171-1-git-send-email-anshuman.khandual@arm.com/ This series applies on 5.17-rc6 after the following patch. https://lore.kernel.org/all/1643004823-16441-1-git-send-email-anshuman.khandual@arm.com/ This series has been cross built for multiple platforms. - Anshuman Cc: Christoph Hellwig Cc: Andrew Morton Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: sparclinux@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-s390@vger.kernel.org Cc: linux-riscv@lists.infradead.org Cc: linux-alpha@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-csky@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: linux-parisc@vger.kernel.org Cc: openrisc@lists.librecores.org Cc: linux-um@lists.infradead.org Cc: linux-hexagon@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org Changes in V3: - Dropped variable 'i' from sme_early_init() on x86 platform - Moved CONFIG_COLDFIRE vm_get_page_prot() inside arch/m68k/mm/mcfmmu.c - Moved CONFIG_SUN3 vm_get_page_prot() inside arch/m68k/mm/sun3mmu.c - Dropped cachebits for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped PAGE_XXX_C definitions from arch/m68k/include/asm/motorola_pgtable.h - Used PAGE_XXX instead for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped all references to protection_map[] in the tree - Replaced s/extensa/xtensa/ on the patch title - Moved left over comments from pgtable.h into init.c on nios2 platform Changes in V2: https://lore.kernel.org/all/1645425519-9034-1-git-send-email-anshuman.khandual@arm.com/ - Dropped the entire comment block in [PATCH 30/30] per Geert - Replaced __P010 (although commented) with __PAGE_COPY on arm platform - Replaced __P101 with PAGE_READONLY on um platform Changes in V1: https://lore.kernel.org/all/1644805853-21338-1-git-send-email-anshuman.khandual@arm.com/ - Add white spaces around the | operators - Moved powerpc_vm_get_page_prot() near vm_get_page_prot() on powerpc - Moved arm64_vm_get_page_prot() near vm_get_page_prot() on arm64 - Moved sparc_vm_get_page_prot() near vm_get_page_prot() on sparc - Compacted vm_get_page_prot() switch cases on all platforms - _PAGE_CACHE040 inclusion is dependent on CPU_IS_040_OR_060 - VM_SHARED case should return PAGE_NONE (not PAGE_COPY) on SH platform - Reorganized VM_SHARED, VM_EXEC, VM_WRITE, VM_READ - Dropped the last patch [RFC V1 31/31] which added macros for vm_flags combinations https://lore.kernel.org/all/1643029028-12710-32-git-send-email-anshuman.khandual@arm.com/ Changes in RFC: https://lore.kernel.org/all/1643029028-12710-1-git-send-email-anshuman.khandual@arm.com/ Anshuman Khandual (29): mm/debug_vm_pgtable: Drop protection_map[] usage mm/mmap: Clarify protection_map[] indices mm/mmap: Add new config ARCH_HAS_VM_GET_PAGE_PROT powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sparc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mips/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop protection_map[] mm/mmap: Drop arch_filter_pgprot() mm/mmap: Drop arch_vm_get_page_pgprot() s390/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT riscv/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT alpha/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sh/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT xtensa/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT parisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT openrisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT um/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT microblaze/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nios2/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT hexagon/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nds32/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT ia64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop generic vm_get_page_prot() mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT Christoph Hellwig (1): x86/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arch/alpha/include/asm/pgtable.h | 17 ----- arch/alpha/mm/init.c | 37 +++++++++++ arch/arc/include/asm/pgtable-bits-arcv2.h | 17 ----- arch/arc/mm/mmap.c | 41 ++++++++++++ arch/arm/include/asm/pgtable.h | 20 +----- arch/arm/lib/uaccess_with_memcpy.c | 2 +- arch/arm/mm/mmu.c | 44 +++++++++++-- arch/arm64/Kconfig | 1 - arch/arm64/include/asm/memory.h | 3 +- arch/arm64/include/asm/mman.h | 24 ------- arch/arm64/include/asm/pgtable-prot.h | 18 ------ arch/arm64/include/asm/pgtable.h | 11 ---- arch/arm64/mm/mmap.c | 78 +++++++++++++++++++++++ arch/csky/include/asm/pgtable.h | 18 ------ arch/csky/mm/init.c | 32 ++++++++++ arch/hexagon/include/asm/pgtable.h | 24 ------- arch/hexagon/mm/init.c | 67 +++++++++++++++++++ arch/ia64/include/asm/pgtable.h | 17 ----- arch/ia64/mm/init.c | 41 +++++++++++- arch/m68k/include/asm/mcf_pgtable.h | 59 ----------------- arch/m68k/include/asm/motorola_pgtable.h | 29 --------- arch/m68k/include/asm/sun3_pgtable.h | 22 ------- arch/m68k/mm/mcfmmu.c | 59 +++++++++++++++++ arch/m68k/mm/motorola.c | 43 ++++++++++++- arch/m68k/mm/sun3mmu.c | 39 ++++++++++++ arch/microblaze/include/asm/pgtable.h | 17 ----- arch/microblaze/mm/init.c | 41 ++++++++++++ arch/mips/include/asm/pgtable.h | 22 ------- arch/mips/mm/cache.c | 60 +++++++++-------- arch/nds32/include/asm/pgtable.h | 17 ----- arch/nds32/mm/mmap.c | 37 +++++++++++ arch/nios2/include/asm/pgtable.h | 24 ------- arch/nios2/mm/init.c | 47 ++++++++++++++ arch/openrisc/include/asm/pgtable.h | 18 ------ arch/openrisc/mm/init.c | 41 ++++++++++++ arch/parisc/include/asm/pgtable.h | 20 ------ arch/parisc/mm/init.c | 40 ++++++++++++ arch/powerpc/include/asm/mman.h | 12 ---- arch/powerpc/include/asm/pgtable.h | 19 ------ arch/powerpc/mm/mmap.c | 59 +++++++++++++++++ arch/riscv/include/asm/pgtable.h | 16 ----- arch/riscv/mm/init.c | 42 ++++++++++++ arch/s390/include/asm/pgtable.h | 17 ----- arch/s390/mm/mmap.c | 33 ++++++++++ arch/sh/include/asm/pgtable.h | 17 ----- arch/sh/mm/mmap.c | 38 +++++++++++ arch/sparc/include/asm/mman.h | 6 -- arch/sparc/include/asm/pgtable_32.h | 19 ------ arch/sparc/include/asm/pgtable_64.h | 19 ------ arch/sparc/mm/init_32.c | 35 ++++++++++ arch/sparc/mm/init_64.c | 70 ++++++++++++++------ arch/um/include/asm/pgtable.h | 17 ----- arch/um/kernel/mem.c | 35 ++++++++++ arch/x86/Kconfig | 1 - arch/x86/include/asm/pgtable.h | 5 -- arch/x86/include/asm/pgtable_types.h | 19 ------ arch/x86/include/uapi/asm/mman.h | 14 ---- arch/x86/mm/Makefile | 2 +- arch/x86/mm/mem_encrypt_amd.c | 6 -- arch/x86/mm/pgprot.c | 71 +++++++++++++++++++++ arch/x86/um/mem_32.c | 2 +- arch/xtensa/include/asm/pgtable.h | 19 ------ arch/xtensa/mm/init.c | 35 ++++++++++ drivers/gpu/drm/drm_vm.c | 4 +- include/linux/mm.h | 6 -- include/linux/mman.h | 4 -- mm/Kconfig | 3 - mm/debug_vm_pgtable.c | 31 +++++---- mm/mmap.c | 44 +------------ 69 files changed, 1138 insertions(+), 729 deletions(-) create mode 100644 arch/x86/mm/pgprot.c -- 2.25.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF9CEC433F5 for ; Mon, 28 Feb 2022 10:49:18 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4K6cZN2mQNz3bpb for ; Mon, 28 Feb 2022 21:49:16 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=arm.com (client-ip=217.140.110.172; helo=foss.arm.com; envelope-from=anshuman.khandual@arm.com; receiver=) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lists.ozlabs.org (Postfix) with ESMTP id 4K6cYt5JXsz2yMD for ; Mon, 28 Feb 2022 21:48:46 +1100 (AEDT) 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 EA0F81063; Mon, 28 Feb 2022 02:48:43 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.47.185]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6F2553F73D; Mon, 28 Feb 2022 02:48:36 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, akpm@linux-foundation.org Subject: [PATCH V3 00/30] mm/mmap: Drop protection_map[] and platform's __SXXX/__PXXX requirements Date: Mon, 28 Feb 2022 16:17:23 +0530 Message-Id: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-mips@vger.kernel.org, sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-csky@vger.kernel.org, Christoph Hellwig , geert@linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, Anshuman Khandual , linux-um@lists.infradead.org, linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" protection_map[] is an array based construct that translates given vm_flags combination. This array contains page protection map, which is populated by the platform via [__S000 .. __S111] and [__P000 .. __P111] exported macros. Primary usage for protection_map[] is for vm_get_page_prot(), which is used to determine page protection value for a given vm_flags. vm_get_page_prot() implementation, could again call platform overrides arch_vm_get_page_prot() and arch_filter_pgprot(). Some platforms override protection_map[] that was originally built with __SXXX/__PXXX with different runtime values. Currently there are multiple layers of abstraction i.e __SXXX/__PXXX macros , protection_map[], arch_vm_get_page_prot() and arch_filter_pgprot() built between the platform and generic MM, finally defining vm_get_page_prot(). Hence this series proposes to drop all these abstraction levels and instead just move the responsibility of defining vm_get_page_prot() to the platform itself making it clean and simple. This first introduces ARCH_HAS_VM_GET_PAGE_PROT which enables the platforms to define custom vm_get_page_prot(). This starts converting platforms that either change protection_map[] or define the overrides arch_filter_pgprot() or arch_vm_get_page_prot() which enables for those constructs to be dropped off completely. This series then converts remaining platforms which enables for __SXXX/__PXXX constructs to be dropped off completely. Finally it drops the generic vm_get_page_prot() and then ARCH_HAS_VM_GET_PAGE_PROT as every platform now defines their own vm_get_page_prot(). The series has been inspired from an earlier discuss with Christoph Hellwig https://lore.kernel.org/all/1632712920-8171-1-git-send-email-anshuman.khandual@arm.com/ This series applies on 5.17-rc6 after the following patch. https://lore.kernel.org/all/1643004823-16441-1-git-send-email-anshuman.khandual@arm.com/ This series has been cross built for multiple platforms. - Anshuman Cc: Christoph Hellwig Cc: Andrew Morton Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: sparclinux@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-s390@vger.kernel.org Cc: linux-riscv@lists.infradead.org Cc: linux-alpha@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-csky@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: linux-parisc@vger.kernel.org Cc: openrisc@lists.librecores.org Cc: linux-um@lists.infradead.org Cc: linux-hexagon@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org Changes in V3: - Dropped variable 'i' from sme_early_init() on x86 platform - Moved CONFIG_COLDFIRE vm_get_page_prot() inside arch/m68k/mm/mcfmmu.c - Moved CONFIG_SUN3 vm_get_page_prot() inside arch/m68k/mm/sun3mmu.c - Dropped cachebits for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped PAGE_XXX_C definitions from arch/m68k/include/asm/motorola_pgtable.h - Used PAGE_XXX instead for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped all references to protection_map[] in the tree - Replaced s/extensa/xtensa/ on the patch title - Moved left over comments from pgtable.h into init.c on nios2 platform Changes in V2: https://lore.kernel.org/all/1645425519-9034-1-git-send-email-anshuman.khandual@arm.com/ - Dropped the entire comment block in [PATCH 30/30] per Geert - Replaced __P010 (although commented) with __PAGE_COPY on arm platform - Replaced __P101 with PAGE_READONLY on um platform Changes in V1: https://lore.kernel.org/all/1644805853-21338-1-git-send-email-anshuman.khandual@arm.com/ - Add white spaces around the | operators - Moved powerpc_vm_get_page_prot() near vm_get_page_prot() on powerpc - Moved arm64_vm_get_page_prot() near vm_get_page_prot() on arm64 - Moved sparc_vm_get_page_prot() near vm_get_page_prot() on sparc - Compacted vm_get_page_prot() switch cases on all platforms - _PAGE_CACHE040 inclusion is dependent on CPU_IS_040_OR_060 - VM_SHARED case should return PAGE_NONE (not PAGE_COPY) on SH platform - Reorganized VM_SHARED, VM_EXEC, VM_WRITE, VM_READ - Dropped the last patch [RFC V1 31/31] which added macros for vm_flags combinations https://lore.kernel.org/all/1643029028-12710-32-git-send-email-anshuman.khandual@arm.com/ Changes in RFC: https://lore.kernel.org/all/1643029028-12710-1-git-send-email-anshuman.khandual@arm.com/ Anshuman Khandual (29): mm/debug_vm_pgtable: Drop protection_map[] usage mm/mmap: Clarify protection_map[] indices mm/mmap: Add new config ARCH_HAS_VM_GET_PAGE_PROT powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sparc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mips/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop protection_map[] mm/mmap: Drop arch_filter_pgprot() mm/mmap: Drop arch_vm_get_page_pgprot() s390/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT riscv/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT alpha/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sh/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT xtensa/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT parisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT openrisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT um/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT microblaze/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nios2/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT hexagon/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nds32/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT ia64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop generic vm_get_page_prot() mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT Christoph Hellwig (1): x86/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arch/alpha/include/asm/pgtable.h | 17 ----- arch/alpha/mm/init.c | 37 +++++++++++ arch/arc/include/asm/pgtable-bits-arcv2.h | 17 ----- arch/arc/mm/mmap.c | 41 ++++++++++++ arch/arm/include/asm/pgtable.h | 20 +----- arch/arm/lib/uaccess_with_memcpy.c | 2 +- arch/arm/mm/mmu.c | 44 +++++++++++-- arch/arm64/Kconfig | 1 - arch/arm64/include/asm/memory.h | 3 +- arch/arm64/include/asm/mman.h | 24 ------- arch/arm64/include/asm/pgtable-prot.h | 18 ------ arch/arm64/include/asm/pgtable.h | 11 ---- arch/arm64/mm/mmap.c | 78 +++++++++++++++++++++++ arch/csky/include/asm/pgtable.h | 18 ------ arch/csky/mm/init.c | 32 ++++++++++ arch/hexagon/include/asm/pgtable.h | 24 ------- arch/hexagon/mm/init.c | 67 +++++++++++++++++++ arch/ia64/include/asm/pgtable.h | 17 ----- arch/ia64/mm/init.c | 41 +++++++++++- arch/m68k/include/asm/mcf_pgtable.h | 59 ----------------- arch/m68k/include/asm/motorola_pgtable.h | 29 --------- arch/m68k/include/asm/sun3_pgtable.h | 22 ------- arch/m68k/mm/mcfmmu.c | 59 +++++++++++++++++ arch/m68k/mm/motorola.c | 43 ++++++++++++- arch/m68k/mm/sun3mmu.c | 39 ++++++++++++ arch/microblaze/include/asm/pgtable.h | 17 ----- arch/microblaze/mm/init.c | 41 ++++++++++++ arch/mips/include/asm/pgtable.h | 22 ------- arch/mips/mm/cache.c | 60 +++++++++-------- arch/nds32/include/asm/pgtable.h | 17 ----- arch/nds32/mm/mmap.c | 37 +++++++++++ arch/nios2/include/asm/pgtable.h | 24 ------- arch/nios2/mm/init.c | 47 ++++++++++++++ arch/openrisc/include/asm/pgtable.h | 18 ------ arch/openrisc/mm/init.c | 41 ++++++++++++ arch/parisc/include/asm/pgtable.h | 20 ------ arch/parisc/mm/init.c | 40 ++++++++++++ arch/powerpc/include/asm/mman.h | 12 ---- arch/powerpc/include/asm/pgtable.h | 19 ------ arch/powerpc/mm/mmap.c | 59 +++++++++++++++++ arch/riscv/include/asm/pgtable.h | 16 ----- arch/riscv/mm/init.c | 42 ++++++++++++ arch/s390/include/asm/pgtable.h | 17 ----- arch/s390/mm/mmap.c | 33 ++++++++++ arch/sh/include/asm/pgtable.h | 17 ----- arch/sh/mm/mmap.c | 38 +++++++++++ arch/sparc/include/asm/mman.h | 6 -- arch/sparc/include/asm/pgtable_32.h | 19 ------ arch/sparc/include/asm/pgtable_64.h | 19 ------ arch/sparc/mm/init_32.c | 35 ++++++++++ arch/sparc/mm/init_64.c | 70 ++++++++++++++------ arch/um/include/asm/pgtable.h | 17 ----- arch/um/kernel/mem.c | 35 ++++++++++ arch/x86/Kconfig | 1 - arch/x86/include/asm/pgtable.h | 5 -- arch/x86/include/asm/pgtable_types.h | 19 ------ arch/x86/include/uapi/asm/mman.h | 14 ---- arch/x86/mm/Makefile | 2 +- arch/x86/mm/mem_encrypt_amd.c | 6 -- arch/x86/mm/pgprot.c | 71 +++++++++++++++++++++ arch/x86/um/mem_32.c | 2 +- arch/xtensa/include/asm/pgtable.h | 19 ------ arch/xtensa/mm/init.c | 35 ++++++++++ drivers/gpu/drm/drm_vm.c | 4 +- include/linux/mm.h | 6 -- include/linux/mman.h | 4 -- mm/Kconfig | 3 - mm/debug_vm_pgtable.c | 31 +++++---- mm/mmap.c | 44 +------------ 69 files changed, 1138 insertions(+), 729 deletions(-) create mode 100644 arch/x86/mm/pgprot.c -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E982BC433F5 for ; Mon, 28 Feb 2022 10:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=I7XFDr+jq+h+PLNVsZJYVRq5r6JIP14lBcgc2z59ofs=; b=Na5nPKzY68q9Z5 a0Lcawoy1wNDd18FSDaGMOjEwhxRc4joSqSfWPGC0xrSC2BLHsHUD3rAhRFavqZROYyuOzZpaAuH0 q3ZcLgU2ANk071tgJPFC7U6fQr5+EPRK/h8r0d/l3lbPfz530vhYaqdM0ms2ps7l61fN6B8RGbaib DotYJt0SHGlPTuypI61fSQDOn48nRvvnixpiJD7U7zYHB9ausCmnLy78jh0l9hpzXMVviQ38fVPsc QAZoiJ5UC2CavTET15AboAQEhRL2G0BZ7n8yg/J1NwbwG7m8BU9xIFOTAcb0PAq/WymZQUPxScBwE u2bjkHxvDyrGCa+wtBBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOdaP-00BXCi-CD; Mon, 28 Feb 2022 10:49:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOdaA-00BX7B-8K; Mon, 28 Feb 2022 10:48:48 +0000 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 EA0F81063; Mon, 28 Feb 2022 02:48:43 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.47.185]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6F2553F73D; Mon, 28 Feb 2022 02:48:36 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, geert@linux-m68k.org, Anshuman Khandual , Christoph Hellwig , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linux-mips@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-s390@vger.kernel.org, linux-riscv@lists.infradead.org, linux-alpha@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-parisc@vger.kernel.org, openrisc@lists.librecores.org, linux-um@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH V3 00/30] mm/mmap: Drop protection_map[] and platform's __SXXX/__PXXX requirements Date: Mon, 28 Feb 2022 16:17:23 +0530 Message-Id: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_024846_419449_F78B946A X-CRM114-Status: GOOD ( 17.74 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org protection_map[] is an array based construct that translates given vm_flags combination. This array contains page protection map, which is populated by the platform via [__S000 .. __S111] and [__P000 .. __P111] exported macros. Primary usage for protection_map[] is for vm_get_page_prot(), which is used to determine page protection value for a given vm_flags. vm_get_page_prot() implementation, could again call platform overrides arch_vm_get_page_prot() and arch_filter_pgprot(). Some platforms override protection_map[] that was originally built with __SXXX/__PXXX with different runtime values. Currently there are multiple layers of abstraction i.e __SXXX/__PXXX macros , protection_map[], arch_vm_get_page_prot() and arch_filter_pgprot() built between the platform and generic MM, finally defining vm_get_page_prot(). Hence this series proposes to drop all these abstraction levels and instead just move the responsibility of defining vm_get_page_prot() to the platform itself making it clean and simple. This first introduces ARCH_HAS_VM_GET_PAGE_PROT which enables the platforms to define custom vm_get_page_prot(). This starts converting platforms that either change protection_map[] or define the overrides arch_filter_pgprot() or arch_vm_get_page_prot() which enables for those constructs to be dropped off completely. This series then converts remaining platforms which enables for __SXXX/__PXXX constructs to be dropped off completely. Finally it drops the generic vm_get_page_prot() and then ARCH_HAS_VM_GET_PAGE_PROT as every platform now defines their own vm_get_page_prot(). The series has been inspired from an earlier discuss with Christoph Hellwig https://lore.kernel.org/all/1632712920-8171-1-git-send-email-anshuman.khandual@arm.com/ This series applies on 5.17-rc6 after the following patch. https://lore.kernel.org/all/1643004823-16441-1-git-send-email-anshuman.khandual@arm.com/ This series has been cross built for multiple platforms. - Anshuman Cc: Christoph Hellwig Cc: Andrew Morton Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: sparclinux@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-s390@vger.kernel.org Cc: linux-riscv@lists.infradead.org Cc: linux-alpha@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-csky@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: linux-parisc@vger.kernel.org Cc: openrisc@lists.librecores.org Cc: linux-um@lists.infradead.org Cc: linux-hexagon@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org Changes in V3: - Dropped variable 'i' from sme_early_init() on x86 platform - Moved CONFIG_COLDFIRE vm_get_page_prot() inside arch/m68k/mm/mcfmmu.c - Moved CONFIG_SUN3 vm_get_page_prot() inside arch/m68k/mm/sun3mmu.c - Dropped cachebits for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped PAGE_XXX_C definitions from arch/m68k/include/asm/motorola_pgtable.h - Used PAGE_XXX instead for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped all references to protection_map[] in the tree - Replaced s/extensa/xtensa/ on the patch title - Moved left over comments from pgtable.h into init.c on nios2 platform Changes in V2: https://lore.kernel.org/all/1645425519-9034-1-git-send-email-anshuman.khandual@arm.com/ - Dropped the entire comment block in [PATCH 30/30] per Geert - Replaced __P010 (although commented) with __PAGE_COPY on arm platform - Replaced __P101 with PAGE_READONLY on um platform Changes in V1: https://lore.kernel.org/all/1644805853-21338-1-git-send-email-anshuman.khandual@arm.com/ - Add white spaces around the | operators - Moved powerpc_vm_get_page_prot() near vm_get_page_prot() on powerpc - Moved arm64_vm_get_page_prot() near vm_get_page_prot() on arm64 - Moved sparc_vm_get_page_prot() near vm_get_page_prot() on sparc - Compacted vm_get_page_prot() switch cases on all platforms - _PAGE_CACHE040 inclusion is dependent on CPU_IS_040_OR_060 - VM_SHARED case should return PAGE_NONE (not PAGE_COPY) on SH platform - Reorganized VM_SHARED, VM_EXEC, VM_WRITE, VM_READ - Dropped the last patch [RFC V1 31/31] which added macros for vm_flags combinations https://lore.kernel.org/all/1643029028-12710-32-git-send-email-anshuman.khandual@arm.com/ Changes in RFC: https://lore.kernel.org/all/1643029028-12710-1-git-send-email-anshuman.khandual@arm.com/ Anshuman Khandual (29): mm/debug_vm_pgtable: Drop protection_map[] usage mm/mmap: Clarify protection_map[] indices mm/mmap: Add new config ARCH_HAS_VM_GET_PAGE_PROT powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sparc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mips/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop protection_map[] mm/mmap: Drop arch_filter_pgprot() mm/mmap: Drop arch_vm_get_page_pgprot() s390/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT riscv/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT alpha/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sh/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT xtensa/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT parisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT openrisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT um/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT microblaze/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nios2/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT hexagon/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nds32/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT ia64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop generic vm_get_page_prot() mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT Christoph Hellwig (1): x86/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arch/alpha/include/asm/pgtable.h | 17 ----- arch/alpha/mm/init.c | 37 +++++++++++ arch/arc/include/asm/pgtable-bits-arcv2.h | 17 ----- arch/arc/mm/mmap.c | 41 ++++++++++++ arch/arm/include/asm/pgtable.h | 20 +----- arch/arm/lib/uaccess_with_memcpy.c | 2 +- arch/arm/mm/mmu.c | 44 +++++++++++-- arch/arm64/Kconfig | 1 - arch/arm64/include/asm/memory.h | 3 +- arch/arm64/include/asm/mman.h | 24 ------- arch/arm64/include/asm/pgtable-prot.h | 18 ------ arch/arm64/include/asm/pgtable.h | 11 ---- arch/arm64/mm/mmap.c | 78 +++++++++++++++++++++++ arch/csky/include/asm/pgtable.h | 18 ------ arch/csky/mm/init.c | 32 ++++++++++ arch/hexagon/include/asm/pgtable.h | 24 ------- arch/hexagon/mm/init.c | 67 +++++++++++++++++++ arch/ia64/include/asm/pgtable.h | 17 ----- arch/ia64/mm/init.c | 41 +++++++++++- arch/m68k/include/asm/mcf_pgtable.h | 59 ----------------- arch/m68k/include/asm/motorola_pgtable.h | 29 --------- arch/m68k/include/asm/sun3_pgtable.h | 22 ------- arch/m68k/mm/mcfmmu.c | 59 +++++++++++++++++ arch/m68k/mm/motorola.c | 43 ++++++++++++- arch/m68k/mm/sun3mmu.c | 39 ++++++++++++ arch/microblaze/include/asm/pgtable.h | 17 ----- arch/microblaze/mm/init.c | 41 ++++++++++++ arch/mips/include/asm/pgtable.h | 22 ------- arch/mips/mm/cache.c | 60 +++++++++-------- arch/nds32/include/asm/pgtable.h | 17 ----- arch/nds32/mm/mmap.c | 37 +++++++++++ arch/nios2/include/asm/pgtable.h | 24 ------- arch/nios2/mm/init.c | 47 ++++++++++++++ arch/openrisc/include/asm/pgtable.h | 18 ------ arch/openrisc/mm/init.c | 41 ++++++++++++ arch/parisc/include/asm/pgtable.h | 20 ------ arch/parisc/mm/init.c | 40 ++++++++++++ arch/powerpc/include/asm/mman.h | 12 ---- arch/powerpc/include/asm/pgtable.h | 19 ------ arch/powerpc/mm/mmap.c | 59 +++++++++++++++++ arch/riscv/include/asm/pgtable.h | 16 ----- arch/riscv/mm/init.c | 42 ++++++++++++ arch/s390/include/asm/pgtable.h | 17 ----- arch/s390/mm/mmap.c | 33 ++++++++++ arch/sh/include/asm/pgtable.h | 17 ----- arch/sh/mm/mmap.c | 38 +++++++++++ arch/sparc/include/asm/mman.h | 6 -- arch/sparc/include/asm/pgtable_32.h | 19 ------ arch/sparc/include/asm/pgtable_64.h | 19 ------ arch/sparc/mm/init_32.c | 35 ++++++++++ arch/sparc/mm/init_64.c | 70 ++++++++++++++------ arch/um/include/asm/pgtable.h | 17 ----- arch/um/kernel/mem.c | 35 ++++++++++ arch/x86/Kconfig | 1 - arch/x86/include/asm/pgtable.h | 5 -- arch/x86/include/asm/pgtable_types.h | 19 ------ arch/x86/include/uapi/asm/mman.h | 14 ---- arch/x86/mm/Makefile | 2 +- arch/x86/mm/mem_encrypt_amd.c | 6 -- arch/x86/mm/pgprot.c | 71 +++++++++++++++++++++ arch/x86/um/mem_32.c | 2 +- arch/xtensa/include/asm/pgtable.h | 19 ------ arch/xtensa/mm/init.c | 35 ++++++++++ drivers/gpu/drm/drm_vm.c | 4 +- include/linux/mm.h | 6 -- include/linux/mman.h | 4 -- mm/Kconfig | 3 - mm/debug_vm_pgtable.c | 31 +++++---- mm/mmap.c | 44 +------------ 69 files changed, 1138 insertions(+), 729 deletions(-) create mode 100644 arch/x86/mm/pgprot.c -- 2.25.1 _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4AC7C433F5 for ; Mon, 28 Feb 2022 10:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=kHI59yO8l7eZFHKVMIoSRC16sezeZ+ijWnKUQAx34QY=; b=jLyW248043cY9T iXgvCodsGp2HoM8lBwlwzDNmOAjHRAxlWOX+TtTA0YiOvyw8bNoW4qSUIbxSk/fn+WSopbV+owWwM Sx7RGgf3WyWaVrS4RJm0kJC+2Ep5POlVgoxf4b7zyLdNk7qITWcQ4PJZx6rhrh5tYxyt/C2wvqkXI MhiFhbHocN0d/jVQMo29UcRXaWkXwt8NqoYWsmDT41PSzCUcz8IAkIq+sax2P/KLou6gawTAK8bVf wrltN2o7TGKfInYp6lLiG/PJoDKvBbWx4dJgBpaji2NkxceimUoCbplgDO3heVX5obJUx8Sh8iJFI G5C6JIuaL1P0wD8Zg0eA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOdaE-00BX8a-Hh; Mon, 28 Feb 2022 10:48:50 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOdaA-00BX7B-8K; Mon, 28 Feb 2022 10:48:48 +0000 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 EA0F81063; Mon, 28 Feb 2022 02:48:43 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.47.185]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6F2553F73D; Mon, 28 Feb 2022 02:48:36 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, geert@linux-m68k.org, Anshuman Khandual , Christoph Hellwig , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linux-mips@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-s390@vger.kernel.org, linux-riscv@lists.infradead.org, linux-alpha@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-parisc@vger.kernel.org, openrisc@lists.librecores.org, linux-um@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH V3 00/30] mm/mmap: Drop protection_map[] and platform's __SXXX/__PXXX requirements Date: Mon, 28 Feb 2022 16:17:23 +0530 Message-Id: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_024846_419449_F78B946A X-CRM114-Status: GOOD ( 17.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org protection_map[] is an array based construct that translates given vm_flags combination. This array contains page protection map, which is populated by the platform via [__S000 .. __S111] and [__P000 .. __P111] exported macros. Primary usage for protection_map[] is for vm_get_page_prot(), which is used to determine page protection value for a given vm_flags. vm_get_page_prot() implementation, could again call platform overrides arch_vm_get_page_prot() and arch_filter_pgprot(). Some platforms override protection_map[] that was originally built with __SXXX/__PXXX with different runtime values. Currently there are multiple layers of abstraction i.e __SXXX/__PXXX macros , protection_map[], arch_vm_get_page_prot() and arch_filter_pgprot() built between the platform and generic MM, finally defining vm_get_page_prot(). Hence this series proposes to drop all these abstraction levels and instead just move the responsibility of defining vm_get_page_prot() to the platform itself making it clean and simple. This first introduces ARCH_HAS_VM_GET_PAGE_PROT which enables the platforms to define custom vm_get_page_prot(). This starts converting platforms that either change protection_map[] or define the overrides arch_filter_pgprot() or arch_vm_get_page_prot() which enables for those constructs to be dropped off completely. This series then converts remaining platforms which enables for __SXXX/__PXXX constructs to be dropped off completely. Finally it drops the generic vm_get_page_prot() and then ARCH_HAS_VM_GET_PAGE_PROT as every platform now defines their own vm_get_page_prot(). The series has been inspired from an earlier discuss with Christoph Hellwig https://lore.kernel.org/all/1632712920-8171-1-git-send-email-anshuman.khandual@arm.com/ This series applies on 5.17-rc6 after the following patch. https://lore.kernel.org/all/1643004823-16441-1-git-send-email-anshuman.khandual@arm.com/ This series has been cross built for multiple platforms. - Anshuman Cc: Christoph Hellwig Cc: Andrew Morton Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: sparclinux@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-s390@vger.kernel.org Cc: linux-riscv@lists.infradead.org Cc: linux-alpha@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-csky@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: linux-parisc@vger.kernel.org Cc: openrisc@lists.librecores.org Cc: linux-um@lists.infradead.org Cc: linux-hexagon@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org Changes in V3: - Dropped variable 'i' from sme_early_init() on x86 platform - Moved CONFIG_COLDFIRE vm_get_page_prot() inside arch/m68k/mm/mcfmmu.c - Moved CONFIG_SUN3 vm_get_page_prot() inside arch/m68k/mm/sun3mmu.c - Dropped cachebits for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped PAGE_XXX_C definitions from arch/m68k/include/asm/motorola_pgtable.h - Used PAGE_XXX instead for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped all references to protection_map[] in the tree - Replaced s/extensa/xtensa/ on the patch title - Moved left over comments from pgtable.h into init.c on nios2 platform Changes in V2: https://lore.kernel.org/all/1645425519-9034-1-git-send-email-anshuman.khandual@arm.com/ - Dropped the entire comment block in [PATCH 30/30] per Geert - Replaced __P010 (although commented) with __PAGE_COPY on arm platform - Replaced __P101 with PAGE_READONLY on um platform Changes in V1: https://lore.kernel.org/all/1644805853-21338-1-git-send-email-anshuman.khandual@arm.com/ - Add white spaces around the | operators - Moved powerpc_vm_get_page_prot() near vm_get_page_prot() on powerpc - Moved arm64_vm_get_page_prot() near vm_get_page_prot() on arm64 - Moved sparc_vm_get_page_prot() near vm_get_page_prot() on sparc - Compacted vm_get_page_prot() switch cases on all platforms - _PAGE_CACHE040 inclusion is dependent on CPU_IS_040_OR_060 - VM_SHARED case should return PAGE_NONE (not PAGE_COPY) on SH platform - Reorganized VM_SHARED, VM_EXEC, VM_WRITE, VM_READ - Dropped the last patch [RFC V1 31/31] which added macros for vm_flags combinations https://lore.kernel.org/all/1643029028-12710-32-git-send-email-anshuman.khandual@arm.com/ Changes in RFC: https://lore.kernel.org/all/1643029028-12710-1-git-send-email-anshuman.khandual@arm.com/ Anshuman Khandual (29): mm/debug_vm_pgtable: Drop protection_map[] usage mm/mmap: Clarify protection_map[] indices mm/mmap: Add new config ARCH_HAS_VM_GET_PAGE_PROT powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sparc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mips/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop protection_map[] mm/mmap: Drop arch_filter_pgprot() mm/mmap: Drop arch_vm_get_page_pgprot() s390/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT riscv/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT alpha/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sh/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT xtensa/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT parisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT openrisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT um/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT microblaze/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nios2/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT hexagon/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nds32/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT ia64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop generic vm_get_page_prot() mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT Christoph Hellwig (1): x86/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arch/alpha/include/asm/pgtable.h | 17 ----- arch/alpha/mm/init.c | 37 +++++++++++ arch/arc/include/asm/pgtable-bits-arcv2.h | 17 ----- arch/arc/mm/mmap.c | 41 ++++++++++++ arch/arm/include/asm/pgtable.h | 20 +----- arch/arm/lib/uaccess_with_memcpy.c | 2 +- arch/arm/mm/mmu.c | 44 +++++++++++-- arch/arm64/Kconfig | 1 - arch/arm64/include/asm/memory.h | 3 +- arch/arm64/include/asm/mman.h | 24 ------- arch/arm64/include/asm/pgtable-prot.h | 18 ------ arch/arm64/include/asm/pgtable.h | 11 ---- arch/arm64/mm/mmap.c | 78 +++++++++++++++++++++++ arch/csky/include/asm/pgtable.h | 18 ------ arch/csky/mm/init.c | 32 ++++++++++ arch/hexagon/include/asm/pgtable.h | 24 ------- arch/hexagon/mm/init.c | 67 +++++++++++++++++++ arch/ia64/include/asm/pgtable.h | 17 ----- arch/ia64/mm/init.c | 41 +++++++++++- arch/m68k/include/asm/mcf_pgtable.h | 59 ----------------- arch/m68k/include/asm/motorola_pgtable.h | 29 --------- arch/m68k/include/asm/sun3_pgtable.h | 22 ------- arch/m68k/mm/mcfmmu.c | 59 +++++++++++++++++ arch/m68k/mm/motorola.c | 43 ++++++++++++- arch/m68k/mm/sun3mmu.c | 39 ++++++++++++ arch/microblaze/include/asm/pgtable.h | 17 ----- arch/microblaze/mm/init.c | 41 ++++++++++++ arch/mips/include/asm/pgtable.h | 22 ------- arch/mips/mm/cache.c | 60 +++++++++-------- arch/nds32/include/asm/pgtable.h | 17 ----- arch/nds32/mm/mmap.c | 37 +++++++++++ arch/nios2/include/asm/pgtable.h | 24 ------- arch/nios2/mm/init.c | 47 ++++++++++++++ arch/openrisc/include/asm/pgtable.h | 18 ------ arch/openrisc/mm/init.c | 41 ++++++++++++ arch/parisc/include/asm/pgtable.h | 20 ------ arch/parisc/mm/init.c | 40 ++++++++++++ arch/powerpc/include/asm/mman.h | 12 ---- arch/powerpc/include/asm/pgtable.h | 19 ------ arch/powerpc/mm/mmap.c | 59 +++++++++++++++++ arch/riscv/include/asm/pgtable.h | 16 ----- arch/riscv/mm/init.c | 42 ++++++++++++ arch/s390/include/asm/pgtable.h | 17 ----- arch/s390/mm/mmap.c | 33 ++++++++++ arch/sh/include/asm/pgtable.h | 17 ----- arch/sh/mm/mmap.c | 38 +++++++++++ arch/sparc/include/asm/mman.h | 6 -- arch/sparc/include/asm/pgtable_32.h | 19 ------ arch/sparc/include/asm/pgtable_64.h | 19 ------ arch/sparc/mm/init_32.c | 35 ++++++++++ arch/sparc/mm/init_64.c | 70 ++++++++++++++------ arch/um/include/asm/pgtable.h | 17 ----- arch/um/kernel/mem.c | 35 ++++++++++ arch/x86/Kconfig | 1 - arch/x86/include/asm/pgtable.h | 5 -- arch/x86/include/asm/pgtable_types.h | 19 ------ arch/x86/include/uapi/asm/mman.h | 14 ---- arch/x86/mm/Makefile | 2 +- arch/x86/mm/mem_encrypt_amd.c | 6 -- arch/x86/mm/pgprot.c | 71 +++++++++++++++++++++ arch/x86/um/mem_32.c | 2 +- arch/xtensa/include/asm/pgtable.h | 19 ------ arch/xtensa/mm/init.c | 35 ++++++++++ drivers/gpu/drm/drm_vm.c | 4 +- include/linux/mm.h | 6 -- include/linux/mman.h | 4 -- mm/Kconfig | 3 - mm/debug_vm_pgtable.c | 31 +++++---- mm/mmap.c | 44 +------------ 69 files changed, 1138 insertions(+), 729 deletions(-) create mode 100644 arch/x86/mm/pgprot.c -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anshuman Khandual Date: Mon, 28 Feb 2022 16:17:23 +0530 Subject: [OpenRISC] [PATCH V3 00/30] mm/mmap: Drop protection_map[] and platform's __SXXX/__PXXX requirements Message-ID: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org protection_map[] is an array based construct that translates given vm_flags combination. This array contains page protection map, which is populated by the platform via [__S000 .. __S111] and [__P000 .. __P111] exported macros. Primary usage for protection_map[] is for vm_get_page_prot(), which is used to determine page protection value for a given vm_flags. vm_get_page_prot() implementation, could again call platform overrides arch_vm_get_page_prot() and arch_filter_pgprot(). Some platforms override protection_map[] that was originally built with __SXXX/__PXXX with different runtime values. Currently there are multiple layers of abstraction i.e __SXXX/__PXXX macros , protection_map[], arch_vm_get_page_prot() and arch_filter_pgprot() built between the platform and generic MM, finally defining vm_get_page_prot(). Hence this series proposes to drop all these abstraction levels and instead just move the responsibility of defining vm_get_page_prot() to the platform itself making it clean and simple. This first introduces ARCH_HAS_VM_GET_PAGE_PROT which enables the platforms to define custom vm_get_page_prot(). This starts converting platforms that either change protection_map[] or define the overrides arch_filter_pgprot() or arch_vm_get_page_prot() which enables for those constructs to be dropped off completely. This series then converts remaining platforms which enables for __SXXX/__PXXX constructs to be dropped off completely. Finally it drops the generic vm_get_page_prot() and then ARCH_HAS_VM_GET_PAGE_PROT as every platform now defines their own vm_get_page_prot(). The series has been inspired from an earlier discuss with Christoph Hellwig https://lore.kernel.org/all/1632712920-8171-1-git-send-email-anshuman.khandual at arm.com/ This series applies on 5.17-rc6 after the following patch. https://lore.kernel.org/all/1643004823-16441-1-git-send-email-anshuman.khandual at arm.com/ This series has been cross built for multiple platforms. - Anshuman Cc: Christoph Hellwig Cc: Andrew Morton Cc: linuxppc-dev at lists.ozlabs.org Cc: linux-arm-kernel at lists.infradead.org Cc: sparclinux at vger.kernel.org Cc: linux-mips at vger.kernel.org Cc: linux-m68k at lists.linux-m68k.org Cc: linux-s390 at vger.kernel.org Cc: linux-riscv at lists.infradead.org Cc: linux-alpha at vger.kernel.org Cc: linux-sh at vger.kernel.org Cc: linux-snps-arc at lists.infradead.org Cc: linux-csky at vger.kernel.org Cc: linux-xtensa at linux-xtensa.org Cc: linux-parisc at vger.kernel.org Cc: openrisc at lists.librecores.org Cc: linux-um at lists.infradead.org Cc: linux-hexagon at vger.kernel.org Cc: linux-ia64 at vger.kernel.org Cc: linux-mm at kvack.org Cc: linux-arch at vger.kernel.org Cc: linux-kernel at vger.kernel.org Changes in V3: - Dropped variable 'i' from sme_early_init() on x86 platform - Moved CONFIG_COLDFIRE vm_get_page_prot() inside arch/m68k/mm/mcfmmu.c - Moved CONFIG_SUN3 vm_get_page_prot() inside arch/m68k/mm/sun3mmu.c - Dropped cachebits for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped PAGE_XXX_C definitions from arch/m68k/include/asm/motorola_pgtable.h - Used PAGE_XXX instead for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped all references to protection_map[] in the tree - Replaced s/extensa/xtensa/ on the patch title - Moved left over comments from pgtable.h into init.c on nios2 platform Changes in V2: https://lore.kernel.org/all/1645425519-9034-1-git-send-email-anshuman.khandual at arm.com/ - Dropped the entire comment block in [PATCH 30/30] per Geert - Replaced __P010 (although commented) with __PAGE_COPY on arm platform - Replaced __P101 with PAGE_READONLY on um platform Changes in V1: https://lore.kernel.org/all/1644805853-21338-1-git-send-email-anshuman.khandual at arm.com/ - Add white spaces around the | operators - Moved powerpc_vm_get_page_prot() near vm_get_page_prot() on powerpc - Moved arm64_vm_get_page_prot() near vm_get_page_prot() on arm64 - Moved sparc_vm_get_page_prot() near vm_get_page_prot() on sparc - Compacted vm_get_page_prot() switch cases on all platforms - _PAGE_CACHE040 inclusion is dependent on CPU_IS_040_OR_060 - VM_SHARED case should return PAGE_NONE (not PAGE_COPY) on SH platform - Reorganized VM_SHARED, VM_EXEC, VM_WRITE, VM_READ - Dropped the last patch [RFC V1 31/31] which added macros for vm_flags combinations https://lore.kernel.org/all/1643029028-12710-32-git-send-email-anshuman.khandual at arm.com/ Changes in RFC: https://lore.kernel.org/all/1643029028-12710-1-git-send-email-anshuman.khandual at arm.com/ Anshuman Khandual (29): mm/debug_vm_pgtable: Drop protection_map[] usage mm/mmap: Clarify protection_map[] indices mm/mmap: Add new config ARCH_HAS_VM_GET_PAGE_PROT powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sparc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mips/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop protection_map[] mm/mmap: Drop arch_filter_pgprot() mm/mmap: Drop arch_vm_get_page_pgprot() s390/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT riscv/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT alpha/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sh/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT xtensa/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT parisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT openrisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT um/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT microblaze/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nios2/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT hexagon/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nds32/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT ia64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop generic vm_get_page_prot() mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT Christoph Hellwig (1): x86/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arch/alpha/include/asm/pgtable.h | 17 ----- arch/alpha/mm/init.c | 37 +++++++++++ arch/arc/include/asm/pgtable-bits-arcv2.h | 17 ----- arch/arc/mm/mmap.c | 41 ++++++++++++ arch/arm/include/asm/pgtable.h | 20 +----- arch/arm/lib/uaccess_with_memcpy.c | 2 +- arch/arm/mm/mmu.c | 44 +++++++++++-- arch/arm64/Kconfig | 1 - arch/arm64/include/asm/memory.h | 3 +- arch/arm64/include/asm/mman.h | 24 ------- arch/arm64/include/asm/pgtable-prot.h | 18 ------ arch/arm64/include/asm/pgtable.h | 11 ---- arch/arm64/mm/mmap.c | 78 +++++++++++++++++++++++ arch/csky/include/asm/pgtable.h | 18 ------ arch/csky/mm/init.c | 32 ++++++++++ arch/hexagon/include/asm/pgtable.h | 24 ------- arch/hexagon/mm/init.c | 67 +++++++++++++++++++ arch/ia64/include/asm/pgtable.h | 17 ----- arch/ia64/mm/init.c | 41 +++++++++++- arch/m68k/include/asm/mcf_pgtable.h | 59 ----------------- arch/m68k/include/asm/motorola_pgtable.h | 29 --------- arch/m68k/include/asm/sun3_pgtable.h | 22 ------- arch/m68k/mm/mcfmmu.c | 59 +++++++++++++++++ arch/m68k/mm/motorola.c | 43 ++++++++++++- arch/m68k/mm/sun3mmu.c | 39 ++++++++++++ arch/microblaze/include/asm/pgtable.h | 17 ----- arch/microblaze/mm/init.c | 41 ++++++++++++ arch/mips/include/asm/pgtable.h | 22 ------- arch/mips/mm/cache.c | 60 +++++++++-------- arch/nds32/include/asm/pgtable.h | 17 ----- arch/nds32/mm/mmap.c | 37 +++++++++++ arch/nios2/include/asm/pgtable.h | 24 ------- arch/nios2/mm/init.c | 47 ++++++++++++++ arch/openrisc/include/asm/pgtable.h | 18 ------ arch/openrisc/mm/init.c | 41 ++++++++++++ arch/parisc/include/asm/pgtable.h | 20 ------ arch/parisc/mm/init.c | 40 ++++++++++++ arch/powerpc/include/asm/mman.h | 12 ---- arch/powerpc/include/asm/pgtable.h | 19 ------ arch/powerpc/mm/mmap.c | 59 +++++++++++++++++ arch/riscv/include/asm/pgtable.h | 16 ----- arch/riscv/mm/init.c | 42 ++++++++++++ arch/s390/include/asm/pgtable.h | 17 ----- arch/s390/mm/mmap.c | 33 ++++++++++ arch/sh/include/asm/pgtable.h | 17 ----- arch/sh/mm/mmap.c | 38 +++++++++++ arch/sparc/include/asm/mman.h | 6 -- arch/sparc/include/asm/pgtable_32.h | 19 ------ arch/sparc/include/asm/pgtable_64.h | 19 ------ arch/sparc/mm/init_32.c | 35 ++++++++++ arch/sparc/mm/init_64.c | 70 ++++++++++++++------ arch/um/include/asm/pgtable.h | 17 ----- arch/um/kernel/mem.c | 35 ++++++++++ arch/x86/Kconfig | 1 - arch/x86/include/asm/pgtable.h | 5 -- arch/x86/include/asm/pgtable_types.h | 19 ------ arch/x86/include/uapi/asm/mman.h | 14 ---- arch/x86/mm/Makefile | 2 +- arch/x86/mm/mem_encrypt_amd.c | 6 -- arch/x86/mm/pgprot.c | 71 +++++++++++++++++++++ arch/x86/um/mem_32.c | 2 +- arch/xtensa/include/asm/pgtable.h | 19 ------ arch/xtensa/mm/init.c | 35 ++++++++++ drivers/gpu/drm/drm_vm.c | 4 +- include/linux/mm.h | 6 -- include/linux/mman.h | 4 -- mm/Kconfig | 3 - mm/debug_vm_pgtable.c | 31 +++++---- mm/mmap.c | 44 +------------ 69 files changed, 1138 insertions(+), 729 deletions(-) create mode 100644 arch/x86/mm/pgprot.c -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anshuman Khandual Date: Mon, 28 Feb 2022 10:59:23 +0000 Subject: [PATCH V3 00/30] mm/mmap: Drop protection_map[] and platform's __SXXX/__PXXX requirements Message-Id: <1646045273-9343-1-git-send-email-anshuman.khandual@arm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, geert@linux-m68k.org, Anshuman Khandual , Christoph Hellwig , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linux-mips@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-s390@vger.kernel.org, linux-riscv@lists.infradead.org, linux-alpha@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-parisc@vger.kernel.org, openrisc@lists.librecores.org, linux-um@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-arch@vger.kernel.org protection_map[] is an array based construct that translates given vm_flags combination. This array contains page protection map, which is populated by the platform via [__S000 .. __S111] and [__P000 .. __P111] exported macros. Primary usage for protection_map[] is for vm_get_page_prot(), which is used to determine page protection value for a given vm_flags. vm_get_page_prot() implementation, could again call platform overrides arch_vm_get_page_prot() and arch_filter_pgprot(). Some platforms override protection_map[] that was originally built with __SXXX/__PXXX with different runtime values. Currently there are multiple layers of abstraction i.e __SXXX/__PXXX macros , protection_map[], arch_vm_get_page_prot() and arch_filter_pgprot() built between the platform and generic MM, finally defining vm_get_page_prot(). Hence this series proposes to drop all these abstraction levels and instead just move the responsibility of defining vm_get_page_prot() to the platform itself making it clean and simple. This first introduces ARCH_HAS_VM_GET_PAGE_PROT which enables the platforms to define custom vm_get_page_prot(). This starts converting platforms that either change protection_map[] or define the overrides arch_filter_pgprot() or arch_vm_get_page_prot() which enables for those constructs to be dropped off completely. This series then converts remaining platforms which enables for __SXXX/__PXXX constructs to be dropped off completely. Finally it drops the generic vm_get_page_prot() and then ARCH_HAS_VM_GET_PAGE_PROT as every platform now defines their own vm_get_page_prot(). The series has been inspired from an earlier discuss with Christoph Hellwig https://lore.kernel.org/all/1632712920-8171-1-git-send-email-anshuman.khandual@arm.com/ This series applies on 5.17-rc6 after the following patch. https://lore.kernel.org/all/1643004823-16441-1-git-send-email-anshuman.khandual@arm.com/ This series has been cross built for multiple platforms. - Anshuman Cc: Christoph Hellwig Cc: Andrew Morton Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: sparclinux@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-s390@vger.kernel.org Cc: linux-riscv@lists.infradead.org Cc: linux-alpha@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-csky@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: linux-parisc@vger.kernel.org Cc: openrisc@lists.librecores.org Cc: linux-um@lists.infradead.org Cc: linux-hexagon@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org Changes in V3: - Dropped variable 'i' from sme_early_init() on x86 platform - Moved CONFIG_COLDFIRE vm_get_page_prot() inside arch/m68k/mm/mcfmmu.c - Moved CONFIG_SUN3 vm_get_page_prot() inside arch/m68k/mm/sun3mmu.c - Dropped cachebits for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped PAGE_XXX_C definitions from arch/m68k/include/asm/motorola_pgtable.h - Used PAGE_XXX instead for vm_get_page_prot() inside arch/m68k/mm/motorola.c - Dropped all references to protection_map[] in the tree - Replaced s/extensa/xtensa/ on the patch title - Moved left over comments from pgtable.h into init.c on nios2 platform Changes in V2: https://lore.kernel.org/all/1645425519-9034-1-git-send-email-anshuman.khandual@arm.com/ - Dropped the entire comment block in [PATCH 30/30] per Geert - Replaced __P010 (although commented) with __PAGE_COPY on arm platform - Replaced __P101 with PAGE_READONLY on um platform Changes in V1: https://lore.kernel.org/all/1644805853-21338-1-git-send-email-anshuman.khandual@arm.com/ - Add white spaces around the | operators - Moved powerpc_vm_get_page_prot() near vm_get_page_prot() on powerpc - Moved arm64_vm_get_page_prot() near vm_get_page_prot() on arm64 - Moved sparc_vm_get_page_prot() near vm_get_page_prot() on sparc - Compacted vm_get_page_prot() switch cases on all platforms - _PAGE_CACHE040 inclusion is dependent on CPU_IS_040_OR_060 - VM_SHARED case should return PAGE_NONE (not PAGE_COPY) on SH platform - Reorganized VM_SHARED, VM_EXEC, VM_WRITE, VM_READ - Dropped the last patch [RFC V1 31/31] which added macros for vm_flags combinations https://lore.kernel.org/all/1643029028-12710-32-git-send-email-anshuman.khandual@arm.com/ Changes in RFC: https://lore.kernel.org/all/1643029028-12710-1-git-send-email-anshuman.khandual@arm.com/ Anshuman Khandual (29): mm/debug_vm_pgtable: Drop protection_map[] usage mm/mmap: Clarify protection_map[] indices mm/mmap: Add new config ARCH_HAS_VM_GET_PAGE_PROT powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sparc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mips/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop protection_map[] mm/mmap: Drop arch_filter_pgprot() mm/mmap: Drop arch_vm_get_page_pgprot() s390/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT riscv/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT alpha/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT sh/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT xtensa/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT parisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT openrisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT um/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT microblaze/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nios2/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT hexagon/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT nds32/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT ia64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT mm/mmap: Drop generic vm_get_page_prot() mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT Christoph Hellwig (1): x86/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT arch/alpha/include/asm/pgtable.h | 17 ----- arch/alpha/mm/init.c | 37 +++++++++++ arch/arc/include/asm/pgtable-bits-arcv2.h | 17 ----- arch/arc/mm/mmap.c | 41 ++++++++++++ arch/arm/include/asm/pgtable.h | 20 +----- arch/arm/lib/uaccess_with_memcpy.c | 2 +- arch/arm/mm/mmu.c | 44 +++++++++++-- arch/arm64/Kconfig | 1 - arch/arm64/include/asm/memory.h | 3 +- arch/arm64/include/asm/mman.h | 24 ------- arch/arm64/include/asm/pgtable-prot.h | 18 ------ arch/arm64/include/asm/pgtable.h | 11 ---- arch/arm64/mm/mmap.c | 78 +++++++++++++++++++++++ arch/csky/include/asm/pgtable.h | 18 ------ arch/csky/mm/init.c | 32 ++++++++++ arch/hexagon/include/asm/pgtable.h | 24 ------- arch/hexagon/mm/init.c | 67 +++++++++++++++++++ arch/ia64/include/asm/pgtable.h | 17 ----- arch/ia64/mm/init.c | 41 +++++++++++- arch/m68k/include/asm/mcf_pgtable.h | 59 ----------------- arch/m68k/include/asm/motorola_pgtable.h | 29 --------- arch/m68k/include/asm/sun3_pgtable.h | 22 ------- arch/m68k/mm/mcfmmu.c | 59 +++++++++++++++++ arch/m68k/mm/motorola.c | 43 ++++++++++++- arch/m68k/mm/sun3mmu.c | 39 ++++++++++++ arch/microblaze/include/asm/pgtable.h | 17 ----- arch/microblaze/mm/init.c | 41 ++++++++++++ arch/mips/include/asm/pgtable.h | 22 ------- arch/mips/mm/cache.c | 60 +++++++++-------- arch/nds32/include/asm/pgtable.h | 17 ----- arch/nds32/mm/mmap.c | 37 +++++++++++ arch/nios2/include/asm/pgtable.h | 24 ------- arch/nios2/mm/init.c | 47 ++++++++++++++ arch/openrisc/include/asm/pgtable.h | 18 ------ arch/openrisc/mm/init.c | 41 ++++++++++++ arch/parisc/include/asm/pgtable.h | 20 ------ arch/parisc/mm/init.c | 40 ++++++++++++ arch/powerpc/include/asm/mman.h | 12 ---- arch/powerpc/include/asm/pgtable.h | 19 ------ arch/powerpc/mm/mmap.c | 59 +++++++++++++++++ arch/riscv/include/asm/pgtable.h | 16 ----- arch/riscv/mm/init.c | 42 ++++++++++++ arch/s390/include/asm/pgtable.h | 17 ----- arch/s390/mm/mmap.c | 33 ++++++++++ arch/sh/include/asm/pgtable.h | 17 ----- arch/sh/mm/mmap.c | 38 +++++++++++ arch/sparc/include/asm/mman.h | 6 -- arch/sparc/include/asm/pgtable_32.h | 19 ------ arch/sparc/include/asm/pgtable_64.h | 19 ------ arch/sparc/mm/init_32.c | 35 ++++++++++ arch/sparc/mm/init_64.c | 70 ++++++++++++++------ arch/um/include/asm/pgtable.h | 17 ----- arch/um/kernel/mem.c | 35 ++++++++++ arch/x86/Kconfig | 1 - arch/x86/include/asm/pgtable.h | 5 -- arch/x86/include/asm/pgtable_types.h | 19 ------ arch/x86/include/uapi/asm/mman.h | 14 ---- arch/x86/mm/Makefile | 2 +- arch/x86/mm/mem_encrypt_amd.c | 6 -- arch/x86/mm/pgprot.c | 71 +++++++++++++++++++++ arch/x86/um/mem_32.c | 2 +- arch/xtensa/include/asm/pgtable.h | 19 ------ arch/xtensa/mm/init.c | 35 ++++++++++ drivers/gpu/drm/drm_vm.c | 4 +- include/linux/mm.h | 6 -- include/linux/mman.h | 4 -- mm/Kconfig | 3 - mm/debug_vm_pgtable.c | 31 +++++---- mm/mmap.c | 44 +------------ 69 files changed, 1138 insertions(+), 729 deletions(-) create mode 100644 arch/x86/mm/pgprot.c -- 2.25.1