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

mm/gup: Drop the arch_pte_access_permitted() MMU callback

The only arch that defines it to something meaningful is x86.
But x86 doesn't use the generic GUP_fast() implementation -- the
only place where the callback is called.

Let's drop it.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Aneesh Kumar K . V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dann Frazier <dann.frazier@canonical.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Steve Capper <steve.capper@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arch@vger.kernel.org
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20170316152655.37789-2-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Kirill A. Shutemov and committed by
Ingo Molnar
9a804fec f991376e

-37
-6
arch/powerpc/include/asm/mmu_context.h
··· 163 163 /* by default, allow everything */ 164 164 return true; 165 165 } 166 - 167 - static inline bool arch_pte_access_permitted(pte_t pte, bool write) 168 - { 169 - /* by default, allow everything */ 170 - return true; 171 - } 172 166 #endif /* __KERNEL__ */ 173 167 #endif /* __ASM_POWERPC_MMU_CONTEXT_H */
-6
arch/s390/include/asm/mmu_context.h
··· 156 156 /* by default, allow everything */ 157 157 return true; 158 158 } 159 - 160 - static inline bool arch_pte_access_permitted(pte_t pte, bool write) 161 - { 162 - /* by default, allow everything */ 163 - return true; 164 - } 165 159 #endif /* __S390_MMU_CONTEXT_H */
-6
arch/um/include/asm/mmu_context.h
··· 37 37 return true; 38 38 } 39 39 40 - static inline bool arch_pte_access_permitted(pte_t pte, bool write) 41 - { 42 - /* by default, allow everything */ 43 - return true; 44 - } 45 - 46 40 /* 47 41 * end asm-generic/mm_hooks.h functions 48 42 */
-6
arch/unicore32/include/asm/mmu_context.h
··· 103 103 /* by default, allow everything */ 104 104 return true; 105 105 } 106 - 107 - static inline bool arch_pte_access_permitted(pte_t pte, bool write) 108 - { 109 - /* by default, allow everything */ 110 - return true; 111 - } 112 106 #endif
-4
arch/x86/include/asm/mmu_context.h
··· 268 268 return __pkru_allows_pkey(vma_pkey(vma), write); 269 269 } 270 270 271 - static inline bool arch_pte_access_permitted(pte_t pte, bool write) 272 - { 273 - return __pkru_allows_pkey(pte_flags_pkey(pte_flags(pte)), write); 274 - } 275 271 #endif /* _ASM_X86_MMU_CONTEXT_H */
-6
include/asm-generic/mm_hooks.h
··· 32 32 /* by default, allow everything */ 33 33 return true; 34 34 } 35 - 36 - static inline bool arch_pte_access_permitted(pte_t pte, bool write) 37 - { 38 - /* by default, allow everything */ 39 - return true; 40 - } 41 35 #endif /* _ASM_GENERIC_MM_HOOKS_H */
-3
mm/gup.c
··· 1216 1216 pte_protnone(pte) || (write && !pte_write(pte))) 1217 1217 goto pte_unmap; 1218 1218 1219 - if (!arch_pte_access_permitted(pte, write)) 1220 - goto pte_unmap; 1221 - 1222 1219 VM_BUG_ON(!pfn_valid(pte_pfn(pte))); 1223 1220 page = pte_page(pte); 1224 1221 head = compound_head(page);