]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/mmap: drop ARCH_HAS_VM_GET_PAGE_PROT
authorAnshuman Khandual <anshuman.khandual@arm.com>
Mon, 11 Jul 2022 07:06:00 +0000 (12:36 +0530)
committerakpm <akpm@linux-foundation.org>
Mon, 18 Jul 2022 00:14:41 +0000 (17:14 -0700)
Now all the platforms enable ARCH_HAS_GET_PAGE_PROT.  They define and
export own vm_get_page_prot() whether custom or standard
DECLARE_VM_GET_PAGE_PROT.  Hence there is no need for default generic
fallback for vm_get_page_prot().  Just drop this fallback and also
ARCH_HAS_GET_PAGE_PROT mechanism.

Link: https://lkml.kernel.org/r/20220711070600.2378316-27-anshuman.khandual@arm.com
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Brian Cain <bcain@quicinc.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: Will Deacon <will@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
25 files changed:
arch/alpha/Kconfig
arch/arc/Kconfig
arch/arm/Kconfig
arch/arm64/Kconfig
arch/csky/Kconfig
arch/hexagon/Kconfig
arch/ia64/Kconfig
arch/loongarch/Kconfig
arch/m68k/Kconfig
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/nios2/Kconfig
arch/openrisc/Kconfig
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/riscv/Kconfig
arch/s390/Kconfig
arch/sh/Kconfig
arch/sparc/Kconfig
arch/um/Kconfig
arch/x86/Kconfig
arch/xtensa/Kconfig
include/linux/mm.h
mm/Kconfig
mm/mmap.c

index db1c8b329461359d3788667432f0b5138bf6a35d..7d0d26b5b3f526effa72dff37ef09ed08334ec1f 100644 (file)
@@ -2,7 +2,6 @@
 config ALPHA
        bool
        default y
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_32BIT_USTAT_F_TINODE
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_MIGHT_HAVE_PC_SERIO
index 8be56a5d8a9bb46bbec24ab655e5c54468df065e..9e3653253ef20d5304ac8b2ce4c08f11edc7b88c 100644 (file)
@@ -13,7 +13,6 @@ config ARC
        select ARCH_HAS_SETUP_DMA_OPS
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC
        select ARCH_32BIT_OFF_T
        select BUILDTIME_TABLE_SORT
index e153b6d4fc5be2cae605459177b294b29191480d..7630ba9cb6ccc30cd75672c57e0aa248f5a298c9 100644 (file)
@@ -24,7 +24,6 @@ config ARM
        select ARCH_HAS_SYNC_DMA_FOR_CPU if SWIOTLB || !MMU
        select ARCH_HAS_TEARDOWN_DMA_OPS if MMU
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_HAVE_NMI_SAFE_CMPXCHG if CPU_V7 || CPU_V7M || CPU_V6K
        select ARCH_HAS_GCOV_PROFILE_ALL
index 1652a9800ebee645616948df2249e186e948baff..7030bf3f8d6f6248febd231c2984ced39d4ef1af 100644 (file)
@@ -45,7 +45,6 @@ config ARM64
        select ARCH_HAS_SYSCALL_WRAPPER
        select ARCH_HAS_TEARDOWN_DMA_OPS if IOMMU_SUPPORT
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HAS_ZONE_DMA_SET if EXPERT
        select ARCH_HAVE_ELF_PROT
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
index 588b8a9c68edef500e53be4a17416812edf4531f..21d72b078eefc95ac9277f203e07cc20029599ed 100644 (file)
@@ -6,7 +6,6 @@ config CSKY
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_USE_BUILTIN_BSWAP
        select ARCH_USE_QUEUED_RWLOCKS
        select ARCH_WANT_FRAME_POINTERS if !CPU_CK610 && $(cc-option,-mbacktrace)
index bc4ceecd0588c483a386c0eb947354e96e16c25f..54eadf26517868f8cd575a1d5b777be700e35354 100644 (file)
@@ -6,7 +6,6 @@ config HEXAGON
        def_bool y
        select ARCH_32BIT_OFF_T
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_NO_PREEMPT
        select DMA_GLOBAL_POOL
        # Other pending projects/to-do items.
index 0510a57377116b0b9a4f342bdc3b01fd9db87b7b..cb93769a9f2ad3d65000fd72a2feae946fc265f8 100644 (file)
@@ -12,7 +12,6 @@ config IA64
        select ARCH_HAS_DMA_MARK_CLEAN
        select ARCH_HAS_STRNCPY_FROM_USER
        select ARCH_HAS_STRNLEN_USER
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_MIGHT_HAVE_PC_SERIO
        select ACPI
index adf8cf6ec5d5a800d9d378518f0faeb778645217..db2838cf8c02fca44f04dc76017300a441e7e75a 100644 (file)
@@ -9,7 +9,6 @@ config LOONGARCH
        select ARCH_HAS_ACPI_TABLE_UPGRADE      if ACPI
        select ARCH_HAS_PHYS_TO_DMA
        select ARCH_HAS_PTE_SPECIAL
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_INLINE_READ_LOCK if !PREEMPTION
        select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
index 49aa0cf13e96acfea7609e46175cd4792e6adba7..936cce42ae9aa7541277c843e6d1fffc08856f07 100644 (file)
@@ -7,7 +7,6 @@ config M68K
        select ARCH_HAS_CURRENT_STACK_POINTER
        select ARCH_HAS_DMA_PREP_COHERENT if HAS_DMA && MMU && !COLDFIRE
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE if HAS_DMA
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
        select ARCH_MIGHT_HAVE_PC_PARPORT if ISA
        select ARCH_NO_PREEMPT if !COLDFIRE
index 15f91ba8a0c4c4f1b9da38b892494b3a9d9d5816..8cf429ad1c84fb19cf2ca41dd3b6a95a4b5e622e 100644 (file)
@@ -7,7 +7,6 @@ config MICROBLAZE
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_WANT_IPC_PARSE_VERSION
        select BUILDTIME_TABLE_SORT
index d0b7eb11ec81b57c7f1f78e976309a66ecf27afc..db09d45d59ec751486224f3af38524d0875ed3a0 100644 (file)
@@ -14,7 +14,6 @@ config MIPS
        select ARCH_HAS_STRNLEN_USER
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAS_UBSAN_SANITIZE_ALL
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_KEEP_MEMBLOCK
        select ARCH_SUPPORTS_UPROBES
index e0459dffd218929729cbe968373170a949706914..4167f1eb4cd83321333c4c5eea81dfce5646a995 100644 (file)
@@ -6,7 +6,6 @@ config NIOS2
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
        select ARCH_HAS_DMA_SET_UNCACHED
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_NO_SWAP
        select COMMON_CLK
        select TIMER_OF
index fe0dfb50eb867fa8d772082ed52a8286772293d5..e814df4c483ce1eb6949bc04a7245ef5d2bcfd0c 100644 (file)
@@ -10,7 +10,6 @@ config OPENRISC
        select ARCH_HAS_DMA_SET_UNCACHED
        select ARCH_HAS_DMA_CLEAR_UNCACHED
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select COMMON_CLK
        select OF
        select OF_EARLY_FLATTREE
index 891d823939576cebfad3cf0ffaf37937ed51a4ba..fa400055b2d5080f41090bfcbbf5fe35567eb06b 100644 (file)
@@ -12,7 +12,6 @@ config PARISC
        select ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_HAS_STRICT_MODULE_RWX
        select ARCH_HAS_UBSAN_SANITIZE_ALL
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_NO_SG_CHAIN
        select ARCH_SUPPORTS_HUGETLBFS if PA20
index 1035d172c7dd5c520b445dcf54554e2a2275f504..250b8658b2d4b341aedc1a1dc2529bb03971934b 100644 (file)
@@ -140,7 +140,6 @@ config PPC
        select ARCH_HAS_TICK_BROADCAST          if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAS_UACCESS_FLUSHCACHE
        select ARCH_HAS_UBSAN_SANITIZE_ALL
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select ARCH_KEEP_MEMBLOCK
        select ARCH_MIGHT_HAVE_PC_PARPORT
index 583389d4e43a502117ca7de14cb3896fdcb75a15..32ffef9f6e5b4f116034fb1c65388e80d082c361 100644 (file)
@@ -32,7 +32,6 @@ config RISCV
        select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAS_UBSAN_SANITIZE_ALL
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
        select ARCH_STACKWALK
index c4481377ca830d6851ffa32d60c91eb9f8707d2a..91c0b80a8bf04a6f3b1e0e3638291ef249a33a5a 100644 (file)
@@ -81,7 +81,6 @@ config S390
        select ARCH_HAS_SYSCALL_WRAPPER
        select ARCH_HAS_UBSAN_SANITIZE_ALL
        select ARCH_HAS_VDSO_DATA
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select ARCH_INLINE_READ_LOCK
        select ARCH_INLINE_READ_LOCK_BH
index 91f3ea325388f671ae5ca0dc98a6a33923a6133b..5f220e903e5abad8342e31125fbfd2a2f5c79811 100644 (file)
@@ -12,7 +12,6 @@ config SUPERH
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HIBERNATION_POSSIBLE if MMU
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_WANT_IPC_PARSE_VERSION
index 09f868613a4d2667d8dd83331b3a2d1192862d47..9c1cce74953a9429b50218daffeae7e529f41c26 100644 (file)
@@ -13,7 +13,6 @@ config 64BIT
 config SPARC
        bool
        default y
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI
        select ARCH_MIGHT_HAVE_PC_SERIO
        select DMA_OPS
index 7fb43654e5b5e40cfc20f160331219634bdfb029..4ec22e156a2e3f11ee35f4a69e5fafb3e1794c52 100644 (file)
@@ -10,7 +10,6 @@ config UML
        select ARCH_HAS_KCOV
        select ARCH_HAS_STRNCPY_FROM_USER
        select ARCH_HAS_STRNLEN_USER
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_NO_PREEMPT
        select HAVE_ARCH_AUDITSYSCALL
        select HAVE_ARCH_SECCOMP_FILTER
index be0b95e51df663f94a5c7e4c3fc3965179d26bdc..841e4843d0c489f7c4f4d3b8691dec57e9d51aae 100644 (file)
@@ -94,7 +94,6 @@ config X86
        select ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
        select ARCH_HAS_SYSCALL_WRAPPER
        select ARCH_HAS_UBSAN_SANITIZE_ALL
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_HAS_DEBUG_WX
        select ARCH_HAS_ZONE_DMA_SET if EXPERT
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
index 4c0d83520ff153d985874fbc6bcf2a1827ae31ab..0b0f0172cced55565d35c3b2201a9be1776e1e47 100644 (file)
@@ -11,7 +11,6 @@ config XTENSA
        select ARCH_HAS_DMA_SET_UNCACHED if MMU
        select ARCH_HAS_STRNCPY_FROM_USER if !KASAN
        select ARCH_HAS_STRNLEN_USER
-       select ARCH_HAS_VM_GET_PAGE_PROT
        select ARCH_USE_MEMTEST
        select ARCH_USE_QUEUED_RWLOCKS
        select ARCH_USE_QUEUED_SPINLOCKS
index 4b4dc93f9bc32d7ffb21edfc7d3a6ef3d887cc61..61e3101c44ea2c3a0cd2a086e50cf1b681cc4f9c 100644 (file)
@@ -425,9 +425,6 @@ extern unsigned int kobjsize(const void *objp);
  * mapping from the currently active vm_flags protection bits (the
  * low four bits) to a page protection mask..
  */
-#ifndef CONFIG_ARCH_HAS_VM_GET_PAGE_PROT
-extern pgprot_t protection_map[16];
-#endif
 
 /*
  * The default fault flags that should be used by most of the
index c1fa4993a56fe92614bbec2fd26178ea48c38cbd..56ca0e7c6f9a06c9148378c53e96f16c238c2683 100644 (file)
@@ -951,9 +951,6 @@ config ARCH_HAS_CURRENT_STACK_POINTER
          register alias named "current_stack_pointer", this config can be
          selected.
 
-config ARCH_HAS_VM_GET_PAGE_PROT
-       bool
-
 config ARCH_HAS_PTE_DEVMAP
        bool
 
index 2a58a9cd07523795d07e7c84fd6e1a30c31293b2..edf27a2789a20e113a4ff564f399af13885c67fc 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -81,28 +81,6 @@ static void unmap_region(struct mm_struct *mm,
                struct vm_area_struct *vma, struct vm_area_struct *prev,
                unsigned long start, unsigned long end);
 
-#ifndef CONFIG_ARCH_HAS_VM_GET_PAGE_PROT
-pgprot_t protection_map[16] __ro_after_init = {
-       [VM_NONE]                                       = __P000,
-       [VM_READ]                                       = __P001,
-       [VM_WRITE]                                      = __P010,
-       [VM_WRITE | VM_READ]                            = __P011,
-       [VM_EXEC]                                       = __P100,
-       [VM_EXEC | VM_READ]                             = __P101,
-       [VM_EXEC | VM_WRITE]                            = __P110,
-       [VM_EXEC | VM_WRITE | VM_READ]                  = __P111,
-       [VM_SHARED]                                     = __S000,
-       [VM_SHARED | VM_READ]                           = __S001,
-       [VM_SHARED | VM_WRITE]                          = __S010,
-       [VM_SHARED | VM_WRITE | VM_READ]                = __S011,
-       [VM_SHARED | VM_EXEC]                           = __S100,
-       [VM_SHARED | VM_EXEC | VM_READ]                 = __S101,
-       [VM_SHARED | VM_EXEC | VM_WRITE]                = __S110,
-       [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ]      = __S111
-};
-DECLARE_VM_GET_PAGE_PROT
-#endif /* CONFIG_ARCH_HAS_VM_GET_PAGE_PROT */
-
 static pgprot_t vm_pgprot_modify(pgprot_t oldprot, unsigned long vm_flags)
 {
        return pgprot_modify(oldprot, vm_get_page_prot(vm_flags));