diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-02-17 17:58:02 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:13:32 -0500 |
commit | 6c8927c9634e8a1bc95d5291c55205707f9fa40a (patch) | |
tree | e59db7dca9ab26808703ee3c20ad59c3425024fa /arch/sparc64/kernel/sun4v_tlb_miss.S | |
parent | 12e126ad229abc718d05600027fcd5794c1e31e5 (diff) |
[SPARC64]: Fix some SUN4V TLB handling bugs.
1) Add error return checking for TLB load hypervisor
calls.
2) Don't fallthru to dtlb tsb miss handler from itlb tsb
miss handler, oops.
3) On window fixups, propagate fault information to fixup
handler correctly.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/sun4v_tlb_miss.S')
-rw-r--r-- | arch/sparc64/kernel/sun4v_tlb_miss.S | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/sun4v_tlb_miss.S b/arch/sparc64/kernel/sun4v_tlb_miss.S index df65d712dcc6..244d50de8499 100644 --- a/arch/sparc64/kernel/sun4v_tlb_miss.S +++ b/arch/sparc64/kernel/sun4v_tlb_miss.S | |||
@@ -84,8 +84,9 @@ sun4v_itlb_load: | |||
84 | mov %g3, %o2 ! PTE | 84 | mov %g3, %o2 ! PTE |
85 | mov HV_MMU_IMMU, %o3 ! flags | 85 | mov HV_MMU_IMMU, %o3 ! flags |
86 | ta HV_MMU_MAP_ADDR_TRAP | 86 | ta HV_MMU_MAP_ADDR_TRAP |
87 | brnz,pn %o0, sun4v_itlb_error | ||
88 | mov %g2, %o1 ! restore %o1 | ||
87 | mov %g1, %o0 ! restore %o0 | 89 | mov %g1, %o0 ! restore %o0 |
88 | mov %g2, %o1 ! restore %o1 | ||
89 | mov %g5, %o2 ! restore %o2 | 90 | mov %g5, %o2 ! restore %o2 |
90 | mov %g7, %o3 ! restore %o3 | 91 | mov %g7, %o3 ! restore %o3 |
91 | 92 | ||
@@ -126,8 +127,9 @@ sun4v_dtlb_load: | |||
126 | mov %g3, %o2 ! PTE | 127 | mov %g3, %o2 ! PTE |
127 | mov HV_MMU_DMMU, %o3 ! flags | 128 | mov HV_MMU_DMMU, %o3 ! flags |
128 | ta HV_MMU_MAP_ADDR_TRAP | 129 | ta HV_MMU_MAP_ADDR_TRAP |
130 | brnz,pn %o0, sun4v_dtlb_error | ||
131 | mov %g2, %o1 ! restore %o1 | ||
129 | mov %g1, %o0 ! restore %o0 | 132 | mov %g1, %o0 ! restore %o0 |
130 | mov %g2, %o1 ! restore %o1 | ||
131 | mov %g5, %o2 ! restore %o2 | 133 | mov %g5, %o2 ! restore %o2 |
132 | mov %g7, %o3 ! restore %o3 | 134 | mov %g7, %o3 ! restore %o3 |
133 | 135 | ||
@@ -154,6 +156,7 @@ sun4v_itsb_miss: | |||
154 | ldxa [%g1] ASI_SCRATCHPAD, %g1 | 156 | ldxa [%g1] ASI_SCRATCHPAD, %g1 |
155 | brz,pn %g5, kvmap_itlb_4v | 157 | brz,pn %g5, kvmap_itlb_4v |
156 | mov FAULT_CODE_ITLB, %g3 | 158 | mov FAULT_CODE_ITLB, %g3 |
159 | ba,a,pt %xcc, sun4v_tsb_miss_common | ||
157 | 160 | ||
158 | /* Called from trap table with TAG TARGET placed into | 161 | /* Called from trap table with TAG TARGET placed into |
159 | * %g6 and SCRATCHPAD_UTSBREG1 contents in %g1. | 162 | * %g6 and SCRATCHPAD_UTSBREG1 contents in %g1. |
@@ -182,6 +185,56 @@ sun4v_tsb_miss_common: | |||
182 | ba,pt %xcc, tsb_miss_page_table_walk_sun4v_fastpath | 185 | ba,pt %xcc, tsb_miss_page_table_walk_sun4v_fastpath |
183 | ldx [%g2 + TRAP_PER_CPU_PGD_PADDR], %g7 | 186 | ldx [%g2 + TRAP_PER_CPU_PGD_PADDR], %g7 |
184 | 187 | ||
188 | sun4v_itlb_error: | ||
189 | sethi %hi(sun4v_err_itlb_vaddr), %g1 | ||
190 | stx %g4, [%g1 + %lo(sun4v_err_itlb_vaddr)] | ||
191 | sethi %hi(sun4v_err_itlb_ctx), %g1 | ||
192 | srlx %g6, 48, %o1 ! ctx | ||
193 | stx %o1, [%g1 + %lo(sun4v_err_itlb_ctx)] | ||
194 | sethi %hi(sun4v_err_itlb_pte), %g1 | ||
195 | stx %g3, [%g1 + %lo(sun4v_err_itlb_pte)] | ||
196 | sethi %hi(sun4v_err_itlb_error), %g1 | ||
197 | stx %o0, [%g1 + %lo(sun4v_err_itlb_error)] | ||
198 | |||
199 | rdpr %tl, %g4 | ||
200 | cmp %g4, 1 | ||
201 | ble,pt %icc, 1f | ||
202 | sethi %hi(2f), %g7 | ||
203 | ba,pt %xcc, etraptl1 | ||
204 | or %g7, %lo(2f), %g7 | ||
205 | |||
206 | 1: ba,pt %xcc, etrap | ||
207 | 2: or %g7, %lo(2b), %g7 | ||
208 | call sun4v_itlb_error_report | ||
209 | add %sp, PTREGS_OFF, %o0 | ||
210 | |||
211 | /* NOTREACHED */ | ||
212 | |||
213 | sun4v_dtlb_error: | ||
214 | sethi %hi(sun4v_err_dtlb_vaddr), %g1 | ||
215 | stx %g4, [%g1 + %lo(sun4v_err_dtlb_vaddr)] | ||
216 | sethi %hi(sun4v_err_dtlb_ctx), %g1 | ||
217 | srlx %g6, 48, %o1 ! ctx | ||
218 | stx %o1, [%g1 + %lo(sun4v_err_dtlb_ctx)] | ||
219 | sethi %hi(sun4v_err_dtlb_pte), %g1 | ||
220 | stx %g3, [%g1 + %lo(sun4v_err_dtlb_pte)] | ||
221 | sethi %hi(sun4v_err_dtlb_error), %g1 | ||
222 | stx %o0, [%g1 + %lo(sun4v_err_dtlb_error)] | ||
223 | |||
224 | rdpr %tl, %g4 | ||
225 | cmp %g4, 1 | ||
226 | ble,pt %icc, 1f | ||
227 | sethi %hi(2f), %g7 | ||
228 | ba,pt %xcc, etraptl1 | ||
229 | or %g7, %lo(2f), %g7 | ||
230 | |||
231 | 1: ba,pt %xcc, etrap | ||
232 | 2: or %g7, %lo(2b), %g7 | ||
233 | call sun4v_dtlb_error_report | ||
234 | add %sp, PTREGS_OFF, %o0 | ||
235 | |||
236 | /* NOTREACHED */ | ||
237 | |||
185 | /* Instruction Access Exception, tl0. */ | 238 | /* Instruction Access Exception, tl0. */ |
186 | sun4v_iacc: | 239 | sun4v_iacc: |
187 | ldxa [%g0] ASI_SCRATCHPAD, %g2 | 240 | ldxa [%g0] ASI_SCRATCHPAD, %g2 |