@@ -160,6 +160,7 @@ config PPC
select HAVE_ARCH_SECCOMP_FILTER
select ARCH_HAS_UBSAN_SANITIZE_ALL
select ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT
+ select ARCH_WANT_VDSO_MAP
config GENERIC_CSUM
def_bool CPU_LITTLE_ENDIAN
@@ -8,6 +8,7 @@
#include <linux/spinlock.h>
#include <asm/mmu.h>
#include <asm/cputable.h>
+#include <asm-generic/mm_hooks.h>
#include <asm/cputhreads.h>
/*
@@ -126,39 +127,5 @@ static inline void enter_lazy_tlb(struct mm_struct *mm,
#endif
}
-static inline void arch_dup_mmap(struct mm_struct *oldmm,
- struct mm_struct *mm)
-{
-}
-
-static inline void arch_exit_mmap(struct mm_struct *mm)
-{
-}
-
-static inline void arch_unmap(struct mm_struct *mm,
- struct vm_area_struct *vma,
- unsigned long start, unsigned long end)
-{
- if (start <= mm->context.vdso && mm->context.vdso < end)
- mm->context.vdso = 0;
-}
-
-static inline void arch_bprm_mm_init(struct mm_struct *mm,
- struct vm_area_struct *vma)
-{
-}
-
-static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
- bool write, bool execute, bool foreign)
-{
- /* by default, allow everything */
- return true;
-}
-
-static inline bool arch_pte_access_permitted(pte_t pte, bool write)
-{
- /* by default, allow everything */
- return true;
-}
#endif /* __KERNEL__ */
#endif /* __ASM_POWERPC_MMU_CONTEXT_H */
@@ -19,6 +19,10 @@ static inline void arch_unmap(struct mm_struct *mm,
struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
+#ifdef CONFIG_ARCH_WANT_VDSO_MAP
+ if (start <= mm->context.vdso && mm->context.vdso < end)
+ mm->context.vdso = 0;
+#endif /* CONFIG_ARCH_WANT_VDSO_MAP */
}
static inline void arch_bprm_mm_init(struct mm_struct *mm,
In order to support unmapping the VDSO on additional architectures, move the unmap code out from arch/powerpc. Architectures that wish to use the generic logic must have an unsigned long vdso in mm->context and can opt in by selecting CONFIG_ARCH_WANT_VDSO_MAP. This allows PowerPC to go back to using the generic MM hooks, instead of carrying its own. Signed-off-by: Christopher Covington <cov@codeaurora.org> --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/mmu_context.h | 35 +--------------------------------- include/asm-generic/mm_hooks.h | 4 ++++ 3 files changed, 6 insertions(+), 34 deletions(-)