| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.245 2017/03/24 10:58:06 maxv Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.245.6.1 2017/07/05 20:23:08 snj Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Andrew Doran, and by Maxime Villard. | | 8 | * by Andrew Doran, and by Maxime Villard. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -161,27 +161,27 @@ | | | @@ -161,27 +161,27 @@ |
161 | * Hibler/Jolitz pmap, as modified for FreeBSD by John S. Dyson | | 161 | * Hibler/Jolitz pmap, as modified for FreeBSD by John S. Dyson |
162 | * and David Greenman. | | 162 | * and David Greenman. |
163 | * | | 163 | * |
164 | * [3] the Mach pmap. this pmap, from CMU, seems to have migrated | | 164 | * [3] the Mach pmap. this pmap, from CMU, seems to have migrated |
165 | * between several processors. the VAX version was done by | | 165 | * between several processors. the VAX version was done by |
166 | * Avadis Tevanian, Jr., and Michael Wayne Young. the i386 | | 166 | * Avadis Tevanian, Jr., and Michael Wayne Young. the i386 |
167 | * version was done by Lance Berc, Mike Kupfer, Bob Baron, | | 167 | * version was done by Lance Berc, Mike Kupfer, Bob Baron, |
168 | * David Golub, and Richard Draves. the alpha version was | | 168 | * David Golub, and Richard Draves. the alpha version was |
169 | * done by Alessandro Forin (CMU/Mach) and Chris Demetriou | | 169 | * done by Alessandro Forin (CMU/Mach) and Chris Demetriou |
170 | * (NetBSD/alpha). | | 170 | * (NetBSD/alpha). |
171 | */ | | 171 | */ |
172 | | | 172 | |
173 | #include <sys/cdefs.h> | | 173 | #include <sys/cdefs.h> |
174 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.245 2017/03/24 10:58:06 maxv Exp $"); | | 174 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.245.6.1 2017/07/05 20:23:08 snj Exp $"); |
175 | | | 175 | |
176 | #include "opt_user_ldt.h" | | 176 | #include "opt_user_ldt.h" |
177 | #include "opt_lockdebug.h" | | 177 | #include "opt_lockdebug.h" |
178 | #include "opt_multiprocessor.h" | | 178 | #include "opt_multiprocessor.h" |
179 | #include "opt_xen.h" | | 179 | #include "opt_xen.h" |
180 | | | 180 | |
181 | #include <sys/param.h> | | 181 | #include <sys/param.h> |
182 | #include <sys/systm.h> | | 182 | #include <sys/systm.h> |
183 | #include <sys/proc.h> | | 183 | #include <sys/proc.h> |
184 | #include <sys/pool.h> | | 184 | #include <sys/pool.h> |
185 | #include <sys/kernel.h> | | 185 | #include <sys/kernel.h> |
186 | #include <sys/atomic.h> | | 186 | #include <sys/atomic.h> |
187 | #include <sys/cpu.h> | | 187 | #include <sys/cpu.h> |
| @@ -1136,34 +1136,33 @@ pmap_kremove1(vaddr_t sva, vsize_t len, | | | @@ -1136,34 +1136,33 @@ pmap_kremove1(vaddr_t sva, vsize_t len, |
1136 | kpreempt_enable(); | | 1136 | kpreempt_enable(); |
1137 | } | | 1137 | } |
1138 | | | 1138 | |
1139 | void | | 1139 | void |
1140 | pmap_kremove(vaddr_t sva, vsize_t len) | | 1140 | pmap_kremove(vaddr_t sva, vsize_t len) |
1141 | { | | 1141 | { |
1142 | | | 1142 | |
1143 | pmap_kremove1(sva, len, false); | | 1143 | pmap_kremove1(sva, len, false); |
1144 | } | | 1144 | } |
1145 | | | 1145 | |
1146 | /* | | 1146 | /* |
1147 | * pmap_kremove_local: like pmap_kremove(), but only worry about | | 1147 | * pmap_kremove_local: like pmap_kremove(), but only worry about |
1148 | * TLB invalidations on the current CPU. this is only intended | | 1148 | * TLB invalidations on the current CPU. this is only intended |
1149 | * for use while writing kernel crash dumps. | | 1149 | * for use while writing kernel crash dumps, either after panic |
| | | 1150 | * or via reboot -d. |
1150 | */ | | 1151 | */ |
1151 | | | 1152 | |
1152 | void | | 1153 | void |
1153 | pmap_kremove_local(vaddr_t sva, vsize_t len) | | 1154 | pmap_kremove_local(vaddr_t sva, vsize_t len) |
1154 | { | | 1155 | { |
1155 | | | | |
1156 | KASSERT(panicstr != NULL); | | | |
1157 | pmap_kremove1(sva, len, true); | | 1156 | pmap_kremove1(sva, len, true); |
1158 | } | | 1157 | } |
1159 | | | 1158 | |
1160 | /* | | 1159 | /* |
1161 | * p m a p i n i t f u n c t i o n s | | 1160 | * p m a p i n i t f u n c t i o n s |
1162 | * | | 1161 | * |
1163 | * pmap_bootstrap and pmap_init are called during system startup | | 1162 | * pmap_bootstrap and pmap_init are called during system startup |
1164 | * to init the pmap module. pmap_bootstrap() does a low level | | 1163 | * to init the pmap module. pmap_bootstrap() does a low level |
1165 | * init just to get things rolling. pmap_init() finishes the job. | | 1164 | * init just to get things rolling. pmap_init() finishes the job. |
1166 | */ | | 1165 | */ |
1167 | | | 1166 | |
1168 | /* | | 1167 | /* |
1169 | * pmap_bootstrap_valloc: allocate a virtual address in the bootstrap area. | | 1168 | * pmap_bootstrap_valloc: allocate a virtual address in the bootstrap area. |