lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200331093241.3728-4-tesheng@andestech.com>
Date:   Tue, 31 Mar 2020 17:32:41 +0800
From:   Eric Lin <tesheng@...estech.com>
To:     <linux-riscv@...ts.infradead.org>
CC:     <linux-kernel@...r.kernel.org>, <paul.walmsley@...ive.com>,
        <palmer@...belt.com>, <aou@...s.berkeley.edu>,
        <green.hu@...il.com>, <Anup.Patel@....com>,
        <akpm@...ux-foundation.org>, <logang@...tatee.com>,
        <david.abdurachmanov@...il.com>, <atish.patra@....com>,
        <tglx@...utronix.de>, <bp@...e.de>, <yash.shah@...ive.com>,
        <alex@...ti.fr>, <zong.li@...ive.com>, <gary@...yguo.net>,
        <rppt@...ux.ibm.com>, <steven.price@....com>,
        Eric Lin <tesheng@...estech.com>,
        Alan Kao <alankao@...estech.com>
Subject: [PATCH 3/3] riscv/mm: Add pkmap in print_vm_layout()

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@...estech.com>
Cc: Alan Kao <alankao@...estech.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ