Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: remove arch_unmap()

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>

authored by

Michael Ellerman and committed by
Andrew Morton
40b88644 5463bafa

+6 -27
-5
arch/powerpc/include/asm/mmu_context.h
··· 260 260 261 261 extern void arch_exit_mmap(struct mm_struct *mm); 262 262 263 - static inline void arch_unmap(struct mm_struct *mm, 264 - unsigned long start, unsigned long end) 265 - { 266 - } 267 - 268 263 #ifdef CONFIG_PPC_MEM_KEYS 269 264 bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, 270 265 bool execute, bool foreign);
-5
arch/x86/include/asm/mmu_context.h
··· 232 232 } 233 233 #endif 234 234 235 - static inline void arch_unmap(struct mm_struct *mm, unsigned long start, 236 - unsigned long end) 237 - { 238 - } 239 - 240 235 /* 241 236 * We only want to enforce protection keys on the current process 242 237 * because we effectively have no access to PKRU for other
+3 -8
include/asm-generic/mm_hooks.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* 3 - * Define generic no-op hooks for arch_dup_mmap, arch_exit_mmap 4 - * and arch_unmap to be included in asm-FOO/mmu_context.h for any 5 - * arch FOO which doesn't need to hook these. 3 + * Define generic no-op hooks for arch_dup_mmap and arch_exit_mmap 4 + * to be included in asm-FOO/mmu_context.h for any arch FOO which 5 + * doesn't need to hook these. 6 6 */ 7 7 #ifndef _ASM_GENERIC_MM_HOOKS_H 8 8 #define _ASM_GENERIC_MM_HOOKS_H ··· 14 14 } 15 15 16 16 static inline void arch_exit_mmap(struct mm_struct *mm) 17 - { 18 - } 19 - 20 - static inline void arch_unmap(struct mm_struct *mm, 21 - unsigned long start, unsigned long end) 22 17 { 23 18 } 24 19
+1 -3
mm/mmap.c
··· 1743 1743 struct mm_struct *mm = vma->vm_mm; 1744 1744 1745 1745 /* 1746 - * Check if memory is sealed before arch_unmap. 1747 - * Prevent unmapping a sealed VMA. 1746 + * Check if memory is sealed, prevent unmapping a sealed VMA. 1748 1747 * can_modify_mm assumes we have acquired the lock on MM. 1749 1748 */ 1750 1749 if (unlikely(!can_modify_mm(mm, start, end))) 1751 1750 return -EPERM; 1752 1751 1753 - arch_unmap(mm, start, end); 1754 1752 return do_vmi_align_munmap(vmi, vma, mm, start, end, uf, unlock); 1755 1753 } 1756 1754
+2 -6
mm/vma.c
··· 841 841 * 842 842 * This function takes a @mas that is either pointing to the previous VMA or set 843 843 * to MA_START and sets it up to remove the mapping(s). The @len will be 844 - * aligned and any arch_unmap work will be preformed. 844 + * aligned. 845 845 * 846 846 * Return: 0 on success and drops the lock if so directed, error and leaves the 847 847 * lock held otherwise. ··· 861 861 return -EINVAL; 862 862 863 863 /* 864 - * Check if memory is sealed before arch_unmap. 865 - * Prevent unmapping a sealed VMA. 864 + * Check if memory is sealed, prevent unmapping a sealed VMA. 866 865 * can_modify_mm assumes we have acquired the lock on MM. 867 866 */ 868 867 if (unlikely(!can_modify_mm(mm, start, end))) 869 868 return -EPERM; 870 - 871 - /* arch_unmap() might do unmaps itself. */ 872 - arch_unmap(mm, start, end); 873 869 874 870 /* Find the first overlapping VMA */ 875 871 vma = vma_find(vmi, end);