Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64 change kernel vm base address to use more t...



details:   https://anonhg.NetBSD.org/src/rev/833a51dd56fc
branches:  trunk
changeset: 1007922:833a51dd56fc
user:      ryo <ryo%NetBSD.org@localhost>
date:      Wed Mar 04 19:28:04 2020 +0000

description:
change kernel vm base address to use more than 256GB of memory. (up to 64TB)

also enlarge KSEG(direct map) region from 512GB to 64TB.
KASAN works ok.

Note: -fasan-shadow-offset=
      KASAN_SHADOW_START - (CANONICAL_BASE >> 3) =
      0xFFFF400000000000 - (0xFFFF000000000000 >> 3) =
      0xDFFF600000000000

diffstat:

 sys/arch/aarch64/conf/Makefile.aarch64 |   6 +++---
 sys/arch/aarch64/include/vmparam.h     |  17 ++++++++++++-----
 2 files changed, 15 insertions(+), 8 deletions(-)

diffs (66 lines):

diff -r 0dfe07cc4cbc -r 833a51dd56fc sys/arch/aarch64/conf/Makefile.aarch64
--- a/sys/arch/aarch64/conf/Makefile.aarch64    Wed Mar 04 17:32:27 2020 +0000
+++ b/sys/arch/aarch64/conf/Makefile.aarch64    Wed Mar 04 19:28:04 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.aarch64,v 1.16 2019/12/04 11:24:31 jmcneill Exp $
+#      $NetBSD: Makefile.aarch64,v 1.17 2020/03/04 19:28:04 ryo Exp $
 
 # Makefile for NetBSD
 #
@@ -43,7 +43,7 @@
 KASANFLAGS=    -fsanitize=kernel-address \
                --param asan-globals=1 --param asan-stack=1 \
                -fsanitize-address-use-after-scope \
-               -fasan-shadow-offset=0xDFFF208000000000
+               -fasan-shadow-offset=0xDFFF600000000000
 .for f in subr_asan.c
 KASANFLAGS.${f}=       # empty
 .endfor
@@ -74,7 +74,7 @@
 ## (5) link settings
 ##
 KERNLDSCRIPT?= ${ARM}/conf/kern.ldscript
-LOADADDRESS?=  0xffffffc000000000
+LOADADDRESS?=  0xffffc00000000000
 LINKFLAGS_NORMAL=      -X
 
 # Strip AArch64 mapping symbols from the kernel image, as they interfere
diff -r 0dfe07cc4cbc -r 833a51dd56fc sys/arch/aarch64/include/vmparam.h
--- a/sys/arch/aarch64/include/vmparam.h        Wed Mar 04 17:32:27 2020 +0000
+++ b/sys/arch/aarch64/include/vmparam.h        Wed Mar 04 19:28:04 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.10 2020/01/22 16:59:38 ad Exp $ */
+/* $NetBSD: vmparam.h,v 1.11 2020/03/04 19:28:04 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -130,10 +130,17 @@
 #define VM_MAXUSER_ADDRESS32   ((vaddr_t) 0xfffff000)
 
 /*
- * Give ourselves 64GB of mappable kernel space.  That leaves the rest
- * to be user for directly mapped (block addressable) addresses.
+ * kernel virtual space layout:
+ *   0xffff000000000000-   64T KSEG(direct mapping)
+ *   0xffff400000000000-   32T (KASAN SHADOW MAP)
+ *   0xffff600000000000-   32T (not used)
+ *   0xffff800000000000-    1G EFI_RUNTIME
+ *   0xffff800040000000-   64T (not used)
+ *   0xffffc00000000000-   64T KERNEL VM Space (including kernel text/data/bss)
+ *   0xfffffffff0000000-  254M KERNEL_IO for pmap_devmap
+ *   0xffffffffffe00000-    2M RESERVED
  */
-#define VM_MIN_KERNEL_ADDRESS  ((vaddr_t) 0xffffffc000000000L)
+#define VM_MIN_KERNEL_ADDRESS  ((vaddr_t) 0xffffc00000000000L)
 #define VM_MAX_KERNEL_ADDRESS  ((vaddr_t) 0xffffffffffe00000L)
 
 /*
@@ -164,7 +171,7 @@
  * using block page table entries.
  */
 #define AARCH64_KSEG_MASK      ((vaddr_t) 0xffff000000000000L)
-#define AARCH64_KSEG_SIZE      (1UL << 39)     /* 512GB */
+#define AARCH64_KSEG_SIZE      (1UL << 46)     /* 64TB */
 #define AARCH64_KSEG_START     AARCH64_KSEG_MASK
 #define AARCH64_KSEG_END       (AARCH64_KSEG_START + AARCH64_KSEG_SIZE)
 #define AARCH64_KMEMORY_BASE   AARCH64_KSEG_MASK



Home | Main Index | Thread Index | Old Index