aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/sun4v_tlb_miss.S
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-02-11 15:21:20 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 04:12:23 -0500
commit459b6e621e0e15315c25bac47fa7113e5818d45d (patch)
tree4bbff0ec1dafb7fba8b247c84ad708f54cc687fe /arch/sparc64/kernel/sun4v_tlb_miss.S
parentfd05068d7b22b64211f9202aa67ad44b51d44242 (diff)
[SPARC64]: Fix some SUN4V TLB miss bugs.
Code patching did not sign extend negative branch offsets correctly. Kernel TLB miss path needs patching and %g4 register preservation in order to handle SUN4V 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.S14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/sun4v_tlb_miss.S b/arch/sparc64/kernel/sun4v_tlb_miss.S
index f7129137f9a..597359ced23 100644
--- a/arch/sparc64/kernel/sun4v_tlb_miss.S
+++ b/arch/sparc64/kernel/sun4v_tlb_miss.S
@@ -96,7 +96,7 @@ sun4v_dtlb_miss:
96 96
97 /* Load UTSB reg into %g1. */ 97 /* Load UTSB reg into %g1. */
98 mov SCRATCHPAD_UTSBREG1, %g1 98 mov SCRATCHPAD_UTSBREG1, %g1
99 ldxa [%g1 + %g1] ASI_SCRATCHPAD, %g1 99 ldxa [%g1] ASI_SCRATCHPAD, %g1
100 100
101 LOAD_DTLB_INFO(%g2, %g4, %g5) 101 LOAD_DTLB_INFO(%g2, %g4, %g5)
102 COMPUTE_TAG_TARGET(%g6, %g4, %g5, %g3, kvmap_dtlb_4v) 102 COMPUTE_TAG_TARGET(%g6, %g4, %g5, %g3, kvmap_dtlb_4v)
@@ -149,14 +149,19 @@ sun4v_dtlb_prot:
149 * SCRATCHPAD_MMU_MISS contents in %g2. 149 * SCRATCHPAD_MMU_MISS contents in %g2.
150 */ 150 */
151sun4v_itsb_miss: 151sun4v_itsb_miss:
152 ba,pt %xcc, sun4v_tsb_miss_common 152 mov SCRATCHPAD_UTSBREG1, %g1
153 ldxa [%g1] ASI_SCRATCHPAD, %g1
154 brz,pn %g5, kvmap_itlb_4v
153 mov FAULT_CODE_ITLB, %g3 155 mov FAULT_CODE_ITLB, %g3
154 156
155 /* Called from trap table with TAG TARGET placed into 157 /* Called from trap table with TAG TARGET placed into
156 * %g6 and SCRATCHPAD_UTSBREG1 contents in %g1. 158 * %g6 and SCRATCHPAD_UTSBREG1 contents in %g1.
157 */ 159 */
158sun4v_dtsb_miss: 160sun4v_dtsb_miss:
159 mov FAULT_CODE_DTLB, %g3 161 mov SCRATCHPAD_UTSBREG1, %g1
162 ldxa [%g1] ASI_SCRATCHPAD, %g1
163 brz,pn %g5, kvmap_dtlb_4v
164 mov FAULT_CODE_DTLB, %g3
160 165
161 /* Create TSB pointer into %g1. This is something like: 166 /* Create TSB pointer into %g1. This is something like:
162 * 167 *
@@ -312,7 +317,8 @@ sun4v_stdfmna:
312 or %g2, %lo(OLD), %g2; \ 317 or %g2, %lo(OLD), %g2; \
313 sub %g1, %g2, %g1; \ 318 sub %g1, %g2, %g1; \
314 sethi %hi(BRANCH_ALWAYS), %g3; \ 319 sethi %hi(BRANCH_ALWAYS), %g3; \
315 srl %g1, 2, %g1; \ 320 sll %g1, 11, %g1; \
321 srl %g1, 11 + 2, %g1; \
316 or %g3, %lo(BRANCH_ALWAYS), %g3; \ 322 or %g3, %lo(BRANCH_ALWAYS), %g3; \
317 or %g3, %g1, %g3; \ 323 or %g3, %g1, %g3; \
318 stw %g3, [%g2]; \ 324 stw %g3, [%g2]; \