mm: consolidate pte_index() and pte_offset_*() definitions
All architectures define pte_index() as (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1) and all architectures define pte_offset_kernel() as an entry in the array of PTEs indexed by the pte_index(). For the most architectures the pte_offset_kernel() implementation relies on the availability of pmd_page_vaddr() that converts a PMD entry value to the virtual address of the page containing PTEs array. Let's move x86 definitions of the PTE accessors to the generic place in <linux/pgtable.h> and then simply drop the respective definitions from the other architectures. The architectures that didn't provide pmd_page_vaddr() are updated to have that defined. The generic implementation of pte_offset_kernel() can be overridden by an architecture and alpha makes use of this because it has special ordering requirements for its version of pte_offset_kernel(). [rppt@linux.ibm.com: v2] Link: http://lkml.kernel.org/r/20200514170327.31389-11-rppt@kernel.org ...
Showing
- arch/alpha/include/asm/pgtable.h 2 additions, 12 deletionsarch/alpha/include/asm/pgtable.h
- arch/arc/include/asm/pgtable.h 0 additions, 22 deletionsarch/arc/include/asm/pgtable.h
- arch/arm/include/asm/pgtable-2level.h 1 addition, 0 deletionsarch/arm/include/asm/pgtable-2level.h
- arch/arm/include/asm/pgtable-3level.h 0 additions, 7 deletionsarch/arm/include/asm/pgtable-3level.h
- arch/arm/include/asm/pgtable-nommu.h 0 additions, 1 deletionarch/arm/include/asm/pgtable-nommu.h
- arch/arm/include/asm/pgtable.h 0 additions, 23 deletionsarch/arm/include/asm/pgtable.h
- arch/arm64/include/asm/pgtable.h 14 additions, 22 deletionsarch/arm64/include/asm/pgtable.h
- arch/arm64/kernel/hibernate.c 2 additions, 2 deletionsarch/arm64/kernel/hibernate.c
- arch/arm64/mm/kasan_init.c 1 addition, 1 deletionarch/arm64/mm/kasan_init.c
- arch/arm64/mm/mmu.c 4 additions, 4 deletionsarch/arm64/mm/mmu.c
- arch/c6x/include/asm/pgtable.h 0 additions, 1 deletionarch/c6x/include/asm/pgtable.h
- arch/csky/include/asm/pgtable.h 0 additions, 30 deletionsarch/csky/include/asm/pgtable.h
- arch/hexagon/include/asm/pgtable.h 4 additions, 48 deletionsarch/hexagon/include/asm/pgtable.h
- arch/ia64/include/asm/pgtable.h 1 addition, 32 deletionsarch/ia64/include/asm/pgtable.h
- arch/m68k/include/asm/mcf_pgtable.h 1 addition, 22 deletionsarch/m68k/include/asm/mcf_pgtable.h
- arch/m68k/include/asm/motorola_pgalloc.h 1 addition, 1 deletionarch/m68k/include/asm/motorola_pgalloc.h
- arch/m68k/include/asm/motorola_pgtable.h 1 addition, 33 deletionsarch/m68k/include/asm/motorola_pgtable.h
- arch/m68k/include/asm/sun3_pgtable.h 6 additions, 18 deletionsarch/m68k/include/asm/sun3_pgtable.h
- arch/m68k/mm/init.c 1 addition, 1 deletionarch/m68k/mm/init.c
- arch/microblaze/include/asm/pgtable.h 4 additions, 17 deletionsarch/microblaze/include/asm/pgtable.h
Please register or sign in to comment