Skip to content

Commit 2ae2713

Browse files
Steven Pricetorvalds
authored andcommitted
x86: mm: convert dump_pagetables to use walk_page_range
Make use of the new functionality in walk_page_range to remove the arch page walking code and use the generic code to walk the page tables. The effective permissions are passed down the chain using new fields in struct pg_state. The KASAN optimisation is implemented by setting action=CONTINUE in the callbacks to skip an entire tree of entries. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Price <[email protected]> Cc: Albert Ou <[email protected]> Cc: Alexandre Ghiti <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Dave Hansen <[email protected]> Cc: David S. Miller <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Hogan <[email protected]> Cc: James Morse <[email protected]> Cc: Jerome Glisse <[email protected]> Cc: "Liang, Kan" <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Paul Burton <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Russell King <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Will Deacon <[email protected]> Cc: Zong Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 30d621f commit 2ae2713

File tree

4 files changed

+70
-247
lines changed

4 files changed

+70
-247
lines changed

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ config X86
120120
select GENERIC_IRQ_RESERVATION_MODE
121121
select GENERIC_IRQ_SHOW
122122
select GENERIC_PENDING_IRQ if SMP
123+
select GENERIC_PTDUMP
123124
select GENERIC_SMP_IDLE_THREAD
124125
select GENERIC_STRNCPY_FROM_USER
125126
select GENERIC_STRNLEN_USER

arch/x86/Kconfig.debug

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,10 @@ config EARLY_PRINTK_USB_XDBC
6262
config MCSAFE_TEST
6363
def_bool n
6464

65-
config X86_PTDUMP_CORE
66-
def_bool n
67-
68-
config X86_PTDUMP
69-
tristate "Export kernel pagetable layout to userspace via debugfs"
70-
depends on DEBUG_KERNEL
71-
select DEBUG_FS
72-
select X86_PTDUMP_CORE
73-
---help---
74-
Say Y here if you want to show the kernel pagetable layout in a
75-
debugfs file. This information is only useful for kernel developers
76-
who are working in architecture specific areas of the kernel.
77-
It is probably not a good idea to enable this feature in a production
78-
kernel.
79-
If in doubt, say "N"
80-
8165
config EFI_PGT_DUMP
8266
bool "Dump the EFI pagetable"
8367
depends on EFI
84-
select X86_PTDUMP_CORE
68+
select PTDUMP_CORE
8569
---help---
8670
Enable this if you want to dump the EFI page table before
8771
enabling virtual mode. This can be used to debug miscellaneous
@@ -90,7 +74,7 @@ config EFI_PGT_DUMP
9074

9175
config DEBUG_WX
9276
bool "Warn on W+X mappings at boot"
93-
select X86_PTDUMP_CORE
77+
select PTDUMP_CORE
9478
---help---
9579
Generate a warning if any W+X mappings are found at boot.
9680

arch/x86/mm/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ CFLAGS_fault.o := -I $(srctree)/$(src)/../include/asm/trace
2828
obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o
2929

3030
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
31-
obj-$(CONFIG_X86_PTDUMP_CORE) += dump_pagetables.o
32-
obj-$(CONFIG_X86_PTDUMP) += debug_pagetables.o
31+
obj-$(CONFIG_PTDUMP_CORE) += dump_pagetables.o
32+
obj-$(CONFIG_PTDUMP_DEBUGFS) += debug_pagetables.o
3333

3434
obj-$(CONFIG_HIGHMEM) += highmem_32.o
3535

0 commit comments

Comments
 (0)