Sat Aug 29 06:49:53 2020 UTC ()
Cover the full kernel address range in KASAN


(skrll)
diff -r1.54 -r1.55 src/sys/arch/arm/include/arm32/vmparam.h

cvs diff -r1.54 -r1.55 src/sys/arch/arm/include/arm32/vmparam.h (expand / switch to unified diff)

--- src/sys/arch/arm/include/arm32/vmparam.h 2020/07/11 06:46:19 1.54
+++ src/sys/arch/arm/include/arm32/vmparam.h 2020/08/29 06:49:53 1.55
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vmparam.h,v 1.54 2020/07/11 06:46:19 skrll Exp $ */ 1/* $NetBSD: vmparam.h,v 1.55 2020/08/29 06:49:53 skrll Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -117,36 +117,37 @@ @@ -117,36 +117,37 @@
117 * 0xc000_0000 - 128MB (KASAN SHADOW MAP) 117 * 0xc000_0000 - 128MB (KASAN SHADOW MAP)
118 * 0xc800_0000 - 640MB (spare) 118 * 0xc800_0000 - 640MB (spare)
119 * 0xf000_0000 - 256MB IO 119 * 0xf000_0000 - 256MB IO
120 * 120 *
121 * kernel virtual space layout with direct map (1GB limited) 121 * kernel virtual space layout with direct map (1GB limited)
122 * 0x8000_0000 - 1024MB kernel text/data/bss and direct map start 122 * 0x8000_0000 - 1024MB kernel text/data/bss and direct map start
123 * 0xc000_0000 - 768MB Kernel VM Space 123 * 0xc000_0000 - 768MB Kernel VM Space
124 * 0xf000_0000 - 256MB IO 124 * 0xf000_0000 - 256MB IO
125 * 125 *
126 */ 126 */
127 127
128#ifdef KASAN 128#ifdef KASAN
129#define VM_KERNEL_KASAN_BASE 0xc0000000 129#define VM_KERNEL_KASAN_BASE 0xc0000000
130#define VM_KERNEL_KASAN_SIZE (VM_KERNEL_VM_SIZE >> KASAN_SHADOW_SCALE_SHIFT) 130#define VM_KERNEL_KASAN_SIZE (VM_KERNEL_ADDR_SIZE >> KASAN_SHADOW_SCALE_SHIFT)
131#define VM_KERNEL_KASAN_END (VM_KERNEL_KASAN_BASE + VM_KERNEL_KASAN_SIZE) 131#define VM_KERNEL_KASAN_END (VM_KERNEL_KASAN_BASE + VM_KERNEL_KASAN_SIZE)
132#define VM_KERNEL_VM_END VM_KERNEL_KASAN_BASE 132#define VM_KERNEL_VM_END VM_KERNEL_KASAN_BASE
133#else 133#else
134#define VM_KERNEL_VM_END VM_KERNEL_IO_ADDRESS 134#define VM_KERNEL_VM_END VM_KERNEL_IO_ADDRESS
135#endif 135#endif
136 136
137#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS 137#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
138#ifdef KASAN 138#ifdef KASAN
139#error KASAN and __HAVE_MM_MD_DIRECT_MAPPED_PHYS is unsupported 139#error KASAN and __HAVE_MM_MD_DIRECT_MAPPED_PHYS is unsupported
140#endif 140#endif
141#define VM_KERNEL_VM_BASE 0xc0000000 141#define VM_KERNEL_VM_BASE 0xc0000000
142#else 142#else
143#define VM_KERNEL_VM_BASE 0x90000000 143#define VM_KERNEL_VM_BASE 0x90000000
144#endif 144#endif
145 145
 146#define VM_KERNEL_ADDR_SIZE (VM_KERNEL_VM_END - KERNEL_BASE)
146#define VM_KERNEL_VM_SIZE (VM_KERNEL_VM_END - VM_KERNEL_VM_BASE) 147#define VM_KERNEL_VM_SIZE (VM_KERNEL_VM_END - VM_KERNEL_VM_BASE)
147 148
148#define VM_KERNEL_IO_ADDRESS 0xf0000000 149#define VM_KERNEL_IO_ADDRESS 0xf0000000
149#define VM_KERNEL_IO_SIZE (VM_MAX_KERNEL_ADDRESS - VM_KERNEL_IO_ADDRESS) 150#define VM_KERNEL_IO_SIZE (VM_MAX_KERNEL_ADDRESS - VM_KERNEL_IO_ADDRESS)
150#endif 151#endif
151 152
152#endif /* _ARM_ARM32_VMPARAM_H_ */ 153#endif /* _ARM_ARM32_VMPARAM_H_ */