[PATCH 3/3] riscv/mm: Add pkmap in print_vm_layout()

Eric Lin
2020-03-31T09:50:00Z

When enabling CONFIG_HIGHMEM, lowmem will before pkmap
region and the memory layout will be like as below:

Virtual kernel memory layout:
lowmem : 0xc0000000 - 0xf5400000 ( 852 MB)
pkmap : 0xf5600000 - 0xf5800000 ( 2 MB)
fixmap : 0xf5800000 - 0xf5c00000 (4096 kB)
pci io : 0xf5c00000 - 0xf6c00000 ( 16 MB)
vmemmap : 0xf6c00000 - 0xf7bfffff ( 15 MB)
vmalloc : 0xf7c00000 - 0xffc00000 ( 128 MB)

Signed-off-by: Eric Lin <tesheng@andestech.com>
Cc: Alan Kao <alankao@andestech.com>
---
arch/riscv/mm/init.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 59afb479176a..b32d558e3f99 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -80,6 +80,12 @@ static inline void print_mlm(char *name, unsigned long b, unsigned long t)
static void print_vm_layout(void)
{
pr_notice("Virtual kernel memory layout:\n");
+#ifdef CONFIG_HIGHMEM
+ print_mlm("lowmem", (unsigned long)PAGE_OFFSET,
+ (unsigned long)high_memory);
+ print_mlm("pkmap", (unsigned long)PKMAP_BASE,
+ (unsigned long)FIXADDR_START);
+#endif
print_mlk("fixmap", (unsigned long)FIXADDR_START,
(unsigned long)FIXADDR_TOP);
print_mlm("pci io", (unsigned long)PCI_IO_START,
@@ -88,8 +94,10 @@ static void print_vm_layout(void)
(unsigned long)VMEMMAP_END);
print_mlm("vmalloc", (unsigned long)VMALLOC_START,
(unsigned long)VMALLOC_END);
+#ifndef CONFIG_HIGHMEM
print_mlm("lowmem", (unsigned long)PAGE_OFFSET,
(unsigned long)high_memory);
+#endif
}
#else
static void print_vm_layout(void) { }
--
2.17.0