diff options
Diffstat (limited to 'arch/sparc64/mm/ultra.S')
-rw-r--r-- | arch/sparc64/mm/ultra.S | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S index 363770893797..b2ee9b53227f 100644 --- a/arch/sparc64/mm/ultra.S +++ b/arch/sparc64/mm/ultra.S | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <asm/page.h> | 10 | #include <asm/page.h> |
11 | #include <asm/spitfire.h> | 11 | #include <asm/spitfire.h> |
12 | #include <asm/mmu_context.h> | 12 | #include <asm/mmu_context.h> |
13 | #include <asm/mmu.h> | ||
13 | #include <asm/pil.h> | 14 | #include <asm/pil.h> |
14 | #include <asm/head.h> | 15 | #include <asm/head.h> |
15 | #include <asm/thread_info.h> | 16 | #include <asm/thread_info.h> |
@@ -45,6 +46,8 @@ __flush_tlb_mm: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=SECONDARY_CONTEXT */ | |||
45 | nop | 46 | nop |
46 | nop | 47 | nop |
47 | nop | 48 | nop |
49 | nop | ||
50 | nop | ||
48 | 51 | ||
49 | .align 32 | 52 | .align 32 |
50 | .globl __flush_tlb_pending | 53 | .globl __flush_tlb_pending |
@@ -73,6 +76,9 @@ __flush_tlb_pending: | |||
73 | retl | 76 | retl |
74 | wrpr %g7, 0x0, %pstate | 77 | wrpr %g7, 0x0, %pstate |
75 | nop | 78 | nop |
79 | nop | ||
80 | nop | ||
81 | nop | ||
76 | 82 | ||
77 | .align 32 | 83 | .align 32 |
78 | .globl __flush_tlb_kernel_range | 84 | .globl __flush_tlb_kernel_range |
@@ -113,6 +119,7 @@ __spitfire_flush_tlb_mm_slow: | |||
113 | #else | 119 | #else |
114 | #error unsupported PAGE_SIZE | 120 | #error unsupported PAGE_SIZE |
115 | #endif | 121 | #endif |
122 | .section .kprobes.text, "ax" | ||
116 | .align 32 | 123 | .align 32 |
117 | .globl __flush_icache_page | 124 | .globl __flush_icache_page |
118 | __flush_icache_page: /* %o0 = phys_page */ | 125 | __flush_icache_page: /* %o0 = phys_page */ |
@@ -195,6 +202,7 @@ dflush4:stxa %g0, [%o4] ASI_DCACHE_TAG | |||
195 | nop | 202 | nop |
196 | #endif /* DCACHE_ALIASING_POSSIBLE */ | 203 | #endif /* DCACHE_ALIASING_POSSIBLE */ |
197 | 204 | ||
205 | .previous .text | ||
198 | .align 32 | 206 | .align 32 |
199 | __prefill_dtlb: | 207 | __prefill_dtlb: |
200 | rdpr %pstate, %g7 | 208 | rdpr %pstate, %g7 |
@@ -224,16 +232,8 @@ __update_mmu_cache: /* %o0=hw_context, %o1=address, %o2=pte, %o3=fault_code */ | |||
224 | or %o5, %o0, %o5 | 232 | or %o5, %o0, %o5 |
225 | ba,a,pt %xcc, __prefill_itlb | 233 | ba,a,pt %xcc, __prefill_itlb |
226 | 234 | ||
227 | /* Cheetah specific versions, patched at boot time. | 235 | /* Cheetah specific versions, patched at boot time. */ |
228 | * | 236 | __cheetah_flush_tlb_mm: /* 18 insns */ |
229 | * This writes of the PRIMARY_CONTEXT register in this file are | ||
230 | * safe even on Cheetah+ and later wrt. the page size fields. | ||
231 | * The nucleus page size fields do not matter because we make | ||
232 | * no data references, and these instructions execute out of a | ||
233 | * locked I-TLB entry sitting in the fully assosciative I-TLB. | ||
234 | * This sequence should also never trap. | ||
235 | */ | ||
236 | __cheetah_flush_tlb_mm: /* 15 insns */ | ||
237 | rdpr %pstate, %g7 | 237 | rdpr %pstate, %g7 |
238 | andn %g7, PSTATE_IE, %g2 | 238 | andn %g7, PSTATE_IE, %g2 |
239 | wrpr %g2, 0x0, %pstate | 239 | wrpr %g2, 0x0, %pstate |
@@ -241,6 +241,9 @@ __cheetah_flush_tlb_mm: /* 15 insns */ | |||
241 | mov PRIMARY_CONTEXT, %o2 | 241 | mov PRIMARY_CONTEXT, %o2 |
242 | mov 0x40, %g3 | 242 | mov 0x40, %g3 |
243 | ldxa [%o2] ASI_DMMU, %g2 | 243 | ldxa [%o2] ASI_DMMU, %g2 |
244 | srlx %g2, CTX_PGSZ1_NUC_SHIFT, %o1 | ||
245 | sllx %o1, CTX_PGSZ1_NUC_SHIFT, %o1 | ||
246 | or %o0, %o1, %o0 /* Preserve nucleus page size fields */ | ||
244 | stxa %o0, [%o2] ASI_DMMU | 247 | stxa %o0, [%o2] ASI_DMMU |
245 | stxa %g0, [%g3] ASI_DMMU_DEMAP | 248 | stxa %g0, [%g3] ASI_DMMU_DEMAP |
246 | stxa %g0, [%g3] ASI_IMMU_DEMAP | 249 | stxa %g0, [%g3] ASI_IMMU_DEMAP |
@@ -250,7 +253,7 @@ __cheetah_flush_tlb_mm: /* 15 insns */ | |||
250 | retl | 253 | retl |
251 | wrpr %g7, 0x0, %pstate | 254 | wrpr %g7, 0x0, %pstate |
252 | 255 | ||
253 | __cheetah_flush_tlb_pending: /* 23 insns */ | 256 | __cheetah_flush_tlb_pending: /* 26 insns */ |
254 | /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */ | 257 | /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */ |
255 | rdpr %pstate, %g7 | 258 | rdpr %pstate, %g7 |
256 | sllx %o1, 3, %o1 | 259 | sllx %o1, 3, %o1 |
@@ -259,6 +262,9 @@ __cheetah_flush_tlb_pending: /* 23 insns */ | |||
259 | wrpr %g0, 1, %tl | 262 | wrpr %g0, 1, %tl |
260 | mov PRIMARY_CONTEXT, %o4 | 263 | mov PRIMARY_CONTEXT, %o4 |
261 | ldxa [%o4] ASI_DMMU, %g2 | 264 | ldxa [%o4] ASI_DMMU, %g2 |
265 | srlx %g2, CTX_PGSZ1_NUC_SHIFT, %o3 | ||
266 | sllx %o3, CTX_PGSZ1_NUC_SHIFT, %o3 | ||
267 | or %o0, %o3, %o0 /* Preserve nucleus page size fields */ | ||
262 | stxa %o0, [%o4] ASI_DMMU | 268 | stxa %o0, [%o4] ASI_DMMU |
263 | 1: sub %o1, (1 << 3), %o1 | 269 | 1: sub %o1, (1 << 3), %o1 |
264 | ldx [%o2 + %o1], %o3 | 270 | ldx [%o2 + %o1], %o3 |
@@ -311,14 +317,14 @@ cheetah_patch_cachetlbops: | |||
311 | sethi %hi(__cheetah_flush_tlb_mm), %o1 | 317 | sethi %hi(__cheetah_flush_tlb_mm), %o1 |
312 | or %o1, %lo(__cheetah_flush_tlb_mm), %o1 | 318 | or %o1, %lo(__cheetah_flush_tlb_mm), %o1 |
313 | call cheetah_patch_one | 319 | call cheetah_patch_one |
314 | mov 15, %o2 | 320 | mov 18, %o2 |
315 | 321 | ||
316 | sethi %hi(__flush_tlb_pending), %o0 | 322 | sethi %hi(__flush_tlb_pending), %o0 |
317 | or %o0, %lo(__flush_tlb_pending), %o0 | 323 | or %o0, %lo(__flush_tlb_pending), %o0 |
318 | sethi %hi(__cheetah_flush_tlb_pending), %o1 | 324 | sethi %hi(__cheetah_flush_tlb_pending), %o1 |
319 | or %o1, %lo(__cheetah_flush_tlb_pending), %o1 | 325 | or %o1, %lo(__cheetah_flush_tlb_pending), %o1 |
320 | call cheetah_patch_one | 326 | call cheetah_patch_one |
321 | mov 23, %o2 | 327 | mov 26, %o2 |
322 | 328 | ||
323 | #ifdef DCACHE_ALIASING_POSSIBLE | 329 | #ifdef DCACHE_ALIASING_POSSIBLE |
324 | sethi %hi(__flush_dcache_page), %o0 | 330 | sethi %hi(__flush_dcache_page), %o0 |
@@ -352,9 +358,12 @@ cheetah_patch_cachetlbops: | |||
352 | .globl xcall_flush_tlb_mm | 358 | .globl xcall_flush_tlb_mm |
353 | xcall_flush_tlb_mm: | 359 | xcall_flush_tlb_mm: |
354 | mov PRIMARY_CONTEXT, %g2 | 360 | mov PRIMARY_CONTEXT, %g2 |
355 | mov 0x40, %g4 | ||
356 | ldxa [%g2] ASI_DMMU, %g3 | 361 | ldxa [%g2] ASI_DMMU, %g3 |
362 | srlx %g3, CTX_PGSZ1_NUC_SHIFT, %g4 | ||
363 | sllx %g4, CTX_PGSZ1_NUC_SHIFT, %g4 | ||
364 | or %g5, %g4, %g5 /* Preserve nucleus page size fields */ | ||
357 | stxa %g5, [%g2] ASI_DMMU | 365 | stxa %g5, [%g2] ASI_DMMU |
366 | mov 0x40, %g4 | ||
358 | stxa %g0, [%g4] ASI_DMMU_DEMAP | 367 | stxa %g0, [%g4] ASI_DMMU_DEMAP |
359 | stxa %g0, [%g4] ASI_IMMU_DEMAP | 368 | stxa %g0, [%g4] ASI_IMMU_DEMAP |
360 | stxa %g3, [%g2] ASI_DMMU | 369 | stxa %g3, [%g2] ASI_DMMU |
@@ -366,6 +375,10 @@ xcall_flush_tlb_pending: | |||
366 | sllx %g1, 3, %g1 | 375 | sllx %g1, 3, %g1 |
367 | mov PRIMARY_CONTEXT, %g4 | 376 | mov PRIMARY_CONTEXT, %g4 |
368 | ldxa [%g4] ASI_DMMU, %g2 | 377 | ldxa [%g4] ASI_DMMU, %g2 |
378 | srlx %g2, CTX_PGSZ1_NUC_SHIFT, %g4 | ||
379 | sllx %g4, CTX_PGSZ1_NUC_SHIFT, %g4 | ||
380 | or %g5, %g4, %g5 | ||
381 | mov PRIMARY_CONTEXT, %g4 | ||
369 | stxa %g5, [%g4] ASI_DMMU | 382 | stxa %g5, [%g4] ASI_DMMU |
370 | 1: sub %g1, (1 << 3), %g1 | 383 | 1: sub %g1, (1 << 3), %g1 |
371 | ldx [%g7 + %g1], %g5 | 384 | ldx [%g7 + %g1], %g5 |