| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: trap.c,v 1.159 2020/07/06 11:08:21 rin Exp $ */ | | 1 | /* $NetBSD: trap.c,v 1.160 2020/07/06 11:23:59 rin Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (C) 1995, 1996 Wolfgang Solfrank. | | 4 | * Copyright (C) 1995, 1996 Wolfgang Solfrank. |
5 | * Copyright (C) 1995, 1996 TooLs GmbH. | | 5 | * Copyright (C) 1995, 1996 TooLs GmbH. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -25,27 +25,27 @@ | | | @@ -25,27 +25,27 @@ |
25 | * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | | 25 | * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | | 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
27 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | | 27 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
28 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | | 28 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | | 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
30 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | | 30 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
31 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 31 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
32 | */ | | 32 | */ |
33 | | | 33 | |
34 | #define __UFETCHSTORE_PRIVATE | | 34 | #define __UFETCHSTORE_PRIVATE |
35 | #define __UCAS_PRIVATE | | 35 | #define __UCAS_PRIVATE |
36 | | | 36 | |
37 | #include <sys/cdefs.h> | | 37 | #include <sys/cdefs.h> |
38 | __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.159 2020/07/06 11:08:21 rin Exp $"); | | 38 | __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.160 2020/07/06 11:23:59 rin Exp $"); |
39 | | | 39 | |
40 | #ifdef _KERNEL_OPT | | 40 | #ifdef _KERNEL_OPT |
41 | #include "opt_altivec.h" | | 41 | #include "opt_altivec.h" |
42 | #include "opt_ddb.h" | | 42 | #include "opt_ddb.h" |
43 | #include "opt_ppcarch.h" | | 43 | #include "opt_ppcarch.h" |
44 | #endif | | 44 | #endif |
45 | | | 45 | |
46 | #include <sys/param.h> | | 46 | #include <sys/param.h> |
47 | | | 47 | |
48 | #include <sys/proc.h> | | 48 | #include <sys/proc.h> |
49 | #include <sys/ras.h> | | 49 | #include <sys/ras.h> |
50 | #include <sys/reboot.h> | | 50 | #include <sys/reboot.h> |
51 | #include <sys/systm.h> | | 51 | #include <sys/systm.h> |
| @@ -150,27 +150,27 @@ trap(struct trapframe *tf) | | | @@ -150,27 +150,27 @@ trap(struct trapframe *tf) |
150 | vm_map_pmap(map)->pm_ste_evictions > 0 && | | 150 | vm_map_pmap(map)->pm_ste_evictions > 0 && |
151 | pmap_ste_spill(vm_map_pmap(map), | | 151 | pmap_ste_spill(vm_map_pmap(map), |
152 | trunc_page(va), false)) { | | 152 | trunc_page(va), false)) { |
153 | return; | | 153 | return; |
154 | } | | 154 | } |
155 | #endif | | 155 | #endif |
156 | | | 156 | |
157 | if ((tf->tf_dsisr & DSISR_NOTFOUND) && | | 157 | if ((tf->tf_dsisr & DSISR_NOTFOUND) && |
158 | vm_map_pmap(map)->pm_evictions > 0 && | | 158 | vm_map_pmap(map)->pm_evictions > 0 && |
159 | pmap_pte_spill(vm_map_pmap(map), | | 159 | pmap_pte_spill(vm_map_pmap(map), |
160 | trunc_page(va), false)) { | | 160 | trunc_page(va), false)) { |
161 | return; | | 161 | return; |
162 | } | | 162 | } |
163 | #if defined(DIAGNOSTIC) && !defined(PPC_OEA64) && !defined (PPC_IBM4XX) | | 163 | #if defined(DIAGNOSTIC) && !defined(PPC_OEA64) |
164 | } else if ((va >> ADDR_SR_SHFT) == USER_SR) { | | 164 | } else if ((va >> ADDR_SR_SHFT) == USER_SR) { |
165 | printf("trap: kernel %s DSI trap @ %#lx by %#lx" | | 165 | printf("trap: kernel %s DSI trap @ %#lx by %#lx" |
166 | " (DSISR %#x): USER_SR unset\n", | | 166 | " (DSISR %#x): USER_SR unset\n", |
167 | (tf->tf_dsisr & DSISR_STORE) | | 167 | (tf->tf_dsisr & DSISR_STORE) |
168 | ? "write" : "read", | | 168 | ? "write" : "read", |
169 | va, tf->tf_srr0, tf->tf_dsisr); | | 169 | va, tf->tf_srr0, tf->tf_dsisr); |
170 | goto brain_damage2; | | 170 | goto brain_damage2; |
171 | #endif | | 171 | #endif |
172 | } else { | | 172 | } else { |
173 | map = kernel_map; | | 173 | map = kernel_map; |
174 | } | | 174 | } |
175 | | | 175 | |
176 | if (tf->tf_dsisr & DSISR_STORE) | | 176 | if (tf->tf_dsisr & DSISR_STORE) |