Commit e670e64a authored by Vasily Gorbik's avatar Vasily Gorbik

s390/mm,ptdump: add couple of additional markers

Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
[hca@linux.ibm.com: add more markers, rename some markers]
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent d411e3c6
...@@ -89,6 +89,7 @@ extern unsigned long VMALLOC_START; ...@@ -89,6 +89,7 @@ extern unsigned long VMALLOC_START;
extern unsigned long VMALLOC_END; extern unsigned long VMALLOC_END;
#define VMALLOC_DEFAULT_SIZE ((128UL << 30) - MODULES_LEN) #define VMALLOC_DEFAULT_SIZE ((128UL << 30) - MODULES_LEN)
extern struct page *vmemmap; extern struct page *vmemmap;
extern unsigned long vmemmap_size;
#define VMEM_MAX_PHYS ((unsigned long) vmemmap) #define VMEM_MAX_PHYS ((unsigned long) vmemmap)
......
...@@ -119,6 +119,7 @@ EXPORT_SYMBOL(VMALLOC_END); ...@@ -119,6 +119,7 @@ EXPORT_SYMBOL(VMALLOC_END);
struct page *vmemmap; struct page *vmemmap;
EXPORT_SYMBOL(vmemmap); EXPORT_SYMBOL(vmemmap);
unsigned long vmemmap_size;
unsigned long MODULES_VADDR; unsigned long MODULES_VADDR;
unsigned long MODULES_END; unsigned long MODULES_END;
...@@ -589,6 +590,7 @@ static void __init setup_memory_end(void) ...@@ -589,6 +590,7 @@ static void __init setup_memory_end(void)
memory_end = min(memory_end, KASAN_SHADOW_START); memory_end = min(memory_end, KASAN_SHADOW_START);
vmemmap = max(vmemmap, (struct page *)KASAN_SHADOW_END); vmemmap = max(vmemmap, (struct page *)KASAN_SHADOW_END);
#endif #endif
vmemmap_size = SECTION_ALIGN_UP(memory_end / PAGE_SIZE) * sizeof(struct page);
max_pfn = max_low_pfn = PFN_DOWN(memory_end); max_pfn = max_low_pfn = PFN_DOWN(memory_end);
memblock_remove(memory_end, ULONG_MAX); memblock_remove(memory_end, ULONG_MAX);
......
...@@ -17,29 +17,41 @@ struct addr_marker { ...@@ -17,29 +17,41 @@ struct addr_marker {
}; };
enum address_markers_idx { enum address_markers_idx {
IDENTITY_NR = 0, IDENTITY_BEFORE_NR = 0,
IDENTITY_BEFORE_END_NR,
KERNEL_START_NR, KERNEL_START_NR,
KERNEL_END_NR, KERNEL_END_NR,
IDENTITY_AFTER_NR,
IDENTITY_AFTER_END_NR,
#ifdef CONFIG_KASAN #ifdef CONFIG_KASAN
KASAN_SHADOW_START_NR, KASAN_SHADOW_START_NR,
KASAN_SHADOW_END_NR, KASAN_SHADOW_END_NR,
#endif #endif
VMEMMAP_NR, VMEMMAP_NR,
VMEMMAP_END_NR,
VMALLOC_NR, VMALLOC_NR,
VMALLOC_END_NR,
MODULES_NR, MODULES_NR,
MODULES_END_NR,
}; };
static struct addr_marker address_markers[] = { static struct addr_marker address_markers[] = {
[IDENTITY_NR] = {0, "Identity Mapping"}, [IDENTITY_BEFORE_NR] = {0, "Identity Mapping Start"},
[IDENTITY_BEFORE_END_NR] = {(unsigned long)_stext, "Identity Mapping End"},
[KERNEL_START_NR] = {(unsigned long)_stext, "Kernel Image Start"}, [KERNEL_START_NR] = {(unsigned long)_stext, "Kernel Image Start"},
[KERNEL_END_NR] = {(unsigned long)_end, "Kernel Image End"}, [KERNEL_END_NR] = {(unsigned long)_end, "Kernel Image End"},
[IDENTITY_AFTER_NR] = {(unsigned long)_end, "Identity Mapping Start"},
[IDENTITY_AFTER_END_NR] = {0, "Identity Mapping End"},
#ifdef CONFIG_KASAN #ifdef CONFIG_KASAN
[KASAN_SHADOW_START_NR] = {KASAN_SHADOW_START, "Kasan Shadow Start"}, [KASAN_SHADOW_START_NR] = {KASAN_SHADOW_START, "Kasan Shadow Start"},
[KASAN_SHADOW_END_NR] = {KASAN_SHADOW_END, "Kasan Shadow End"}, [KASAN_SHADOW_END_NR] = {KASAN_SHADOW_END, "Kasan Shadow End"},
#endif #endif
[VMEMMAP_NR] = {0, "vmemmap Area"}, [VMEMMAP_NR] = {0, "vmemmap Area Start"},
[VMALLOC_NR] = {0, "vmalloc Area"}, [VMEMMAP_END_NR] = {0, "vmemmap Area End"},
[MODULES_NR] = {0, "Modules Area"}, [VMALLOC_NR] = {0, "vmalloc Area Start"},
[VMALLOC_END_NR] = {0, "vmalloc Area End"},
[MODULES_NR] = {0, "Modules Area Start"},
[MODULES_END_NR] = {0, "Modules Area End"},
{ -1, NULL } { -1, NULL }
}; };
...@@ -225,9 +237,13 @@ static int pt_dump_init(void) ...@@ -225,9 +237,13 @@ static int pt_dump_init(void)
*/ */
max_addr = (S390_lowcore.kernel_asce & _REGION_ENTRY_TYPE_MASK) >> 2; max_addr = (S390_lowcore.kernel_asce & _REGION_ENTRY_TYPE_MASK) >> 2;
max_addr = 1UL << (max_addr * 11 + 31); max_addr = 1UL << (max_addr * 11 + 31);
address_markers[IDENTITY_AFTER_END_NR].start_address = memory_end;
address_markers[MODULES_NR].start_address = MODULES_VADDR; address_markers[MODULES_NR].start_address = MODULES_VADDR;
address_markers[MODULES_END_NR].start_address = MODULES_END;
address_markers[VMEMMAP_NR].start_address = (unsigned long) vmemmap; address_markers[VMEMMAP_NR].start_address = (unsigned long) vmemmap;
address_markers[VMEMMAP_END_NR].start_address = (unsigned long)vmemmap + vmemmap_size;
address_markers[VMALLOC_NR].start_address = VMALLOC_START; address_markers[VMALLOC_NR].start_address = VMALLOC_START;
address_markers[VMALLOC_END_NR].start_address = VMALLOC_END;
if (IS_ENABLED(CONFIG_PTDUMP_DEBUGFS)) if (IS_ENABLED(CONFIG_PTDUMP_DEBUGFS))
debugfs_create_file("kernel_page_tables", 0400, NULL, NULL, &ptdump_fops); debugfs_create_file("kernel_page_tables", 0400, NULL, NULL, &ptdump_fops);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment