aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/sun4v_tlb_miss.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/sun4v_tlb_miss.S')
-rw-r--r--arch/sparc64/kernel/sun4v_tlb_miss.S42
1 files changed, 29 insertions, 13 deletions
diff --git a/arch/sparc64/kernel/sun4v_tlb_miss.S b/arch/sparc64/kernel/sun4v_tlb_miss.S
index 57ccdaec7ccb..654244a3b048 100644
--- a/arch/sparc64/kernel/sun4v_tlb_miss.S
+++ b/arch/sparc64/kernel/sun4v_tlb_miss.S
@@ -137,7 +137,7 @@ sun4v_dtlb_load:
137sun4v_dtlb_prot: 137sun4v_dtlb_prot:
138 SET_GL(1) 138 SET_GL(1)
139 139
140 /* Load MMU Miss base into %g2. */ 140 /* Load MMU Miss base into %g5. */
141 ldxa [%g0] ASI_SCRATCHPAD, %g5 141 ldxa [%g0] ASI_SCRATCHPAD, %g5
142 142
143 ldx [%g5 + HV_FAULT_D_ADDR_OFFSET], %g5 143 ldx [%g5 + HV_FAULT_D_ADDR_OFFSET], %g5
@@ -148,9 +148,10 @@ sun4v_dtlb_prot:
148 ba,pt %xcc, sparc64_realfault_common 148 ba,pt %xcc, sparc64_realfault_common
149 mov FAULT_CODE_DTLB | FAULT_CODE_WRITE, %g4 149 mov FAULT_CODE_DTLB | FAULT_CODE_WRITE, %g4
150 150
151 /* Called from trap table with TAG TARGET placed into 151 /* Called from trap table:
152 * %g6, SCRATCHPAD_UTSBREG1 contents in %g1, and 152 * %g4: vaddr
153 * SCRATCHPAD_MMU_MISS contents in %g2. 153 * %g5: context
154 * %g6: TAG TARGET
154 */ 155 */
155sun4v_itsb_miss: 156sun4v_itsb_miss:
156 mov SCRATCHPAD_UTSBREG1, %g1 157 mov SCRATCHPAD_UTSBREG1, %g1
@@ -159,8 +160,10 @@ sun4v_itsb_miss:
159 mov FAULT_CODE_ITLB, %g3 160 mov FAULT_CODE_ITLB, %g3
160 ba,a,pt %xcc, sun4v_tsb_miss_common 161 ba,a,pt %xcc, sun4v_tsb_miss_common
161 162
162 /* Called from trap table with TAG TARGET placed into 163 /* Called from trap table:
163 * %g6 and SCRATCHPAD_UTSBREG1 contents in %g1. 164 * %g4: vaddr
165 * %g5: context
166 * %g6: TAG TARGET
164 */ 167 */
165sun4v_dtsb_miss: 168sun4v_dtsb_miss:
166 mov SCRATCHPAD_UTSBREG1, %g1 169 mov SCRATCHPAD_UTSBREG1, %g1
@@ -168,6 +171,8 @@ sun4v_dtsb_miss:
168 brz,pn %g5, kvmap_dtlb_4v 171 brz,pn %g5, kvmap_dtlb_4v
169 mov FAULT_CODE_DTLB, %g3 172 mov FAULT_CODE_DTLB, %g3
170 173
174 /* fallthrough */
175
171 /* Create TSB pointer into %g1. This is something like: 176 /* Create TSB pointer into %g1. This is something like:
172 * 177 *
173 * index_mask = (512 << (tsb_reg & 0x7UL)) - 1UL; 178 * index_mask = (512 << (tsb_reg & 0x7UL)) - 1UL;
@@ -304,19 +309,30 @@ sun4v_dacc_tl1:
304 309
305 /* Memory Address Unaligned. */ 310 /* Memory Address Unaligned. */
306sun4v_mna: 311sun4v_mna:
307 ldxa [%g0] ASI_SCRATCHPAD, %g2 312 /* Window fixup? */
313 rdpr %tl, %g2
314 cmp %g2, 1
315 ble,pt %icc, 1f
316 nop
317
318 SET_GL(1)
319 ldxa [%g0] ASI_SCRATCHPAD, %g5
320 ldx [%g5 + HV_FAULT_D_ADDR_OFFSET], %g5
321 mov HV_FAULT_TYPE_UNALIGNED, %g3
322 ldx [%g5 + HV_FAULT_D_CTX_OFFSET], %g4
323 sllx %g3, 16, %g3
324 or %g4, %g3, %g4
325 ba,pt %xcc, winfix_mna
326 rdpr %tpc, %g3
327 /* not reached */
328
3291: ldxa [%g0] ASI_SCRATCHPAD, %g2
308 mov HV_FAULT_TYPE_UNALIGNED, %g3 330 mov HV_FAULT_TYPE_UNALIGNED, %g3
309 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4 331 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4
310 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5 332 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5
311 sllx %g3, 16, %g3 333 sllx %g3, 16, %g3
312 or %g5, %g3, %g5 334 or %g5, %g3, %g5
313 335
314 /* Window fixup? */
315 rdpr %tl, %g2
316 cmp %g2, 1
317 bgu,pn %icc, winfix_mna
318 rdpr %tpc, %g3
319
320 ba,pt %xcc, etrap 336 ba,pt %xcc, etrap
321 rd %pc, %g7 337 rd %pc, %g7
322 mov %l4, %o1 338 mov %l4, %o1