mm: remove arch_unmap()
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 12 Aug 2024 08:26:04 +0000 (18:26 +1000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:53:13 +0000 (17:53 -0700)
Now that powerpc no longer uses arch_unmap() to handle VDSO unmapping,
there are no meaningful implementions left.  Drop support for it entirely,
and update comments which refer to it.

Link: https://lkml.kernel.org/r/20240812082605.743814-3-mpe@ellerman.id.au
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Jeff Xu <jeffxu@google.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/include/asm/mmu_context.h
arch/x86/include/asm/mmu_context.h
include/asm-generic/mm_hooks.h
mm/mmap.c
mm/vma.c

index 9b8c1555744e66ae37652270a842637b0df6ac7f..a334a1368848c8d11731452cd86d487a1f1bc3e4 100644 (file)
@@ -260,11 +260,6 @@ static inline void enter_lazy_tlb(struct mm_struct *mm,
 
 extern void arch_exit_mmap(struct mm_struct *mm);
 
-static inline void arch_unmap(struct mm_struct *mm,
-                             unsigned long start, unsigned long end)
-{
-}
-
 #ifdef CONFIG_PPC_MEM_KEYS
 bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write,
                               bool execute, bool foreign);
index 8dac45a2c7fcf236708272ac7379d3d706c13493..80f2a3187aa663c9702a6d80920e9f34c7c36e43 100644 (file)
@@ -232,11 +232,6 @@ static inline bool is_64bit_mm(struct mm_struct *mm)
 }
 #endif
 
-static inline void arch_unmap(struct mm_struct *mm, unsigned long start,
-                             unsigned long end)
-{
-}
-
 /*
  * We only want to enforce protection keys on the current process
  * because we effectively have no access to PKRU for other
index 4dbb177d115010f36e1d0797aca1183dfb62c548..6eea3b3c1e6594085d8c61c1e7a3dd349e6bb998 100644 (file)
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Define generic no-op hooks for arch_dup_mmap, arch_exit_mmap
- * and arch_unmap to be included in asm-FOO/mmu_context.h for any
- * arch FOO which doesn't need to hook these.
+ * Define generic no-op hooks for arch_dup_mmap and arch_exit_mmap
+ * to be included in asm-FOO/mmu_context.h for any arch FOO which
+ * doesn't need to hook these.
  */
 #ifndef _ASM_GENERIC_MM_HOOKS_H
 #define _ASM_GENERIC_MM_HOOKS_H
@@ -17,11 +17,6 @@ static inline void arch_exit_mmap(struct mm_struct *mm)
 {
 }
 
-static inline void arch_unmap(struct mm_struct *mm,
-                       unsigned long start, unsigned long end)
-{
-}
-
 static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
                bool write, bool execute, bool foreign)
 {
index 933fdc1491a7501cd9cf5a2e5b9e1da8e107ae68..3af256bacef3ffe01d40e9c1877eea6792358d95 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1743,14 +1743,12 @@ int do_vma_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma,
        struct mm_struct *mm = vma->vm_mm;
 
        /*
-        * Check if memory is sealed before arch_unmap.
-        * Prevent unmapping a sealed VMA.
+        * Check if memory is sealed, prevent unmapping a sealed VMA.
         * can_modify_mm assumes we have acquired the lock on MM.
         */
        if (unlikely(!can_modify_mm(mm, start, end)))
                return -EPERM;
 
-       arch_unmap(mm, start, end);
        return do_vmi_align_munmap(vmi, vma, mm, start, end, uf, unlock);
 }
 
index bf0546fe6eabf5e30e4779659c34c4b198fe7ed9..84965f2cd5800d335a44f00e7eab1dc52d627b08 100644 (file)
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -841,7 +841,7 @@ map_count_exceeded:
  *
  * This function takes a @mas that is either pointing to the previous VMA or set
  * to MA_START and sets it up to remove the mapping(s).  The @len will be
- * aligned and any arch_unmap work will be preformed.
+ * aligned.
  *
  * Return: 0 on success and drops the lock if so directed, error and leaves the
  * lock held otherwise.
@@ -861,16 +861,12 @@ int do_vmi_munmap(struct vma_iterator *vmi, struct mm_struct *mm,
                return -EINVAL;
 
        /*
-        * Check if memory is sealed before arch_unmap.
-        * Prevent unmapping a sealed VMA.
+        * Check if memory is sealed, prevent unmapping a sealed VMA.
         * can_modify_mm assumes we have acquired the lock on MM.
         */
        if (unlikely(!can_modify_mm(mm, start, end)))
                return -EPERM;
 
-        /* arch_unmap() might do unmaps itself.  */
-       arch_unmap(mm, start, end);
-
        /* Find the first overlapping VMA */
        vma = vma_find(vmi, end);
        if (!vma) {