s390/mm,ptdump: add couple of additional markers
authorVasily Gorbik <gor@linux.ibm.com>
Fri, 11 Sep 2020 10:51:59 +0000 (12:51 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 14 Sep 2020 09:38:35 +0000 (11:38 +0200)
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
[hca@linux.ibm.com: add more markers, rename some markers]
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/pgtable.h
arch/s390/kernel/setup.c
arch/s390/mm/dump_pagetables.c

index e9244b9fb50476a521e091c5c32152dd49cb9818..d87b83a77aff434e3485cdf4d00ce5a6e4d3627f 100644 (file)
@@ -89,6 +89,7 @@ extern unsigned long VMALLOC_START;
 extern unsigned long VMALLOC_END;
 #define VMALLOC_DEFAULT_SIZE   ((128UL << 30) - MODULES_LEN)
 extern struct page *vmemmap;
+extern unsigned long vmemmap_size;
 
 #define VMEM_MAX_PHYS ((unsigned long) vmemmap)
 
index efd12221ecb4daa93b6edd07afeffa17337e9c03..f04252cb6004ce9bc53392663c627f62b39b3dea 100644 (file)
@@ -119,6 +119,7 @@ EXPORT_SYMBOL(VMALLOC_END);
 
 struct page *vmemmap;
 EXPORT_SYMBOL(vmemmap);
+unsigned long vmemmap_size;
 
 unsigned long MODULES_VADDR;
 unsigned long MODULES_END;
@@ -589,6 +590,7 @@ static void __init setup_memory_end(void)
        memory_end = min(memory_end, KASAN_SHADOW_START);
        vmemmap = max(vmemmap, (struct page *)KASAN_SHADOW_END);
 #endif
+       vmemmap_size = SECTION_ALIGN_UP(memory_end / PAGE_SIZE) * sizeof(struct page);
        max_pfn = max_low_pfn = PFN_DOWN(memory_end);
        memblock_remove(memory_end, ULONG_MAX);
 
index 4b27c1a533de84840231edcf9748b46583477630..052223c92fb1dbd8cabe894492a6a34becec1a6e 100644 (file)
@@ -17,29 +17,41 @@ struct addr_marker {
 };
 
 enum address_markers_idx {
-       IDENTITY_NR = 0,
+       IDENTITY_BEFORE_NR = 0,
+       IDENTITY_BEFORE_END_NR,
        KERNEL_START_NR,
        KERNEL_END_NR,
+       IDENTITY_AFTER_NR,
+       IDENTITY_AFTER_END_NR,
 #ifdef CONFIG_KASAN
        KASAN_SHADOW_START_NR,
        KASAN_SHADOW_END_NR,
 #endif
        VMEMMAP_NR,
+       VMEMMAP_END_NR,
        VMALLOC_NR,
+       VMALLOC_END_NR,
        MODULES_NR,
+       MODULES_END_NR,
 };
 
 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_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
        [KASAN_SHADOW_START_NR] = {KASAN_SHADOW_START, "Kasan Shadow Start"},
        [KASAN_SHADOW_END_NR]   = {KASAN_SHADOW_END, "Kasan Shadow End"},
 #endif
-       [VMEMMAP_NR]            = {0, "vmemmap Area"},
-       [VMALLOC_NR]            = {0, "vmalloc Area"},
-       [MODULES_NR]            = {0, "Modules Area"},
+       [VMEMMAP_NR]            = {0, "vmemmap Area Start"},
+       [VMEMMAP_END_NR]        = {0, "vmemmap Area End"},
+       [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 }
 };
 
@@ -225,9 +237,13 @@ static int pt_dump_init(void)
         */
        max_addr = (S390_lowcore.kernel_asce & _REGION_ENTRY_TYPE_MASK) >> 2;
        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_END_NR].start_address = MODULES_END;
        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_END_NR].start_address = VMALLOC_END;
        if (IS_ENABLED(CONFIG_PTDUMP_DEBUGFS))
                debugfs_create_file("kernel_page_tables", 0400, NULL, NULL, &ptdump_fops);
        return 0;