aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm/dump.c
diff options
context:
space:
mode:
authorSteve Capper <steve.capper@arm.com>2019-08-07 11:55:16 -0400
committerWill Deacon <will@kernel.org>2019-08-09 06:17:16 -0400
commit99426e5e8c9f11b9de65e7c1200868e8a9ceaa47 (patch)
tree5f9ef0c9fee87dd575826e74722fc52326ac2140 /arch/arm64/mm/dump.c
parent6bd1d0be0e97936d15cdacc71f5c232fbf71293e (diff)
arm64: dump: De-constify VA_START and KASAN_SHADOW_START
The kernel page table dumper assumes that the placement of VA regions is constant and determined at compile time. As we are about to introduce variable VA logic, we need to be able to determine certain regions at boot time. Specifically the VA_START and KASAN_SHADOW_START will depend on whether or not the system is booted with 52-bit kernel VAs. This patch adds logic to the kernel page table dumper s.t. these regions can be computed at boot time. Signed-off-by: Steve Capper <steve.capper@arm.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/mm/dump.c')
-rw-r--r--arch/arm64/mm/dump.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c
index beec87488e97..6ec75305828e 100644
--- a/arch/arm64/mm/dump.c
+++ b/arch/arm64/mm/dump.c
@@ -25,11 +25,20 @@
25#include <asm/pgtable-hwdef.h> 25#include <asm/pgtable-hwdef.h>
26#include <asm/ptdump.h> 26#include <asm/ptdump.h>
27 27
28static const struct addr_marker address_markers[] = { 28
29enum address_markers_idx {
30 PAGE_OFFSET_NR = 0,
31 VA_START_NR,
32#ifdef CONFIG_KASAN
33 KASAN_START_NR,
34#endif
35};
36
37static struct addr_marker address_markers[] = {
29 { PAGE_OFFSET, "Linear Mapping start" }, 38 { PAGE_OFFSET, "Linear Mapping start" },
30 { VA_START, "Linear Mapping end" }, 39 { 0 /* VA_START */, "Linear Mapping end" },
31#ifdef CONFIG_KASAN 40#ifdef CONFIG_KASAN
32 { KASAN_SHADOW_START, "Kasan shadow start" }, 41 { 0 /* KASAN_SHADOW_START */, "Kasan shadow start" },
33 { KASAN_SHADOW_END, "Kasan shadow end" }, 42 { KASAN_SHADOW_END, "Kasan shadow end" },
34#endif 43#endif
35 { MODULES_VADDR, "Modules start" }, 44 { MODULES_VADDR, "Modules start" },
@@ -402,6 +411,10 @@ void ptdump_check_wx(void)
402 411
403static int ptdump_init(void) 412static int ptdump_init(void)
404{ 413{
414 address_markers[VA_START_NR].start_address = VA_START;
415#ifdef CONFIG_KASAN
416 address_markers[KASAN_START_NR].start_address = KASAN_SHADOW_START;
417#endif
405 ptdump_initialize(); 418 ptdump_initialize();
406 ptdump_debugfs_register(&kernel_ptdump_info, "kernel_page_tables"); 419 ptdump_debugfs_register(&kernel_ptdump_info, "kernel_page_tables");
407 return 0; 420 return 0;