aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2014-03-07 15:48:35 -0500
committerScott Wood <scottwood@freescale.com>2014-03-19 20:57:13 -0400
commit82d86de25b9c99db546e17c6f7ebf9a691da557e (patch)
tree3d977f76fa266367c7faa95567bc72e199a73db5 /arch/powerpc/mm
parentc4787d1ecfefce86971c1360ed5cef36af6182db (diff)
powerpc/e6500: Make TLB lock recursive
Once special level interrupts are supported, we may take nested TLB misses -- so allow the same thread to acquire the lock recursively. The lock will not be effective against the nested TLB miss handler trying to write the same entry as the interrupted TLB miss handler, but that's also a problem on non-threaded CPUs that lack TLB write conditional. This will be addressed in the patch that enables crit/mc support by invalidating the TLB on return from level exceptions. Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/tlb_low_64e.S19
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S
index 6bf50507a4b5..1e50249e900b 100644
--- a/arch/powerpc/mm/tlb_low_64e.S
+++ b/arch/powerpc/mm/tlb_low_64e.S
@@ -284,7 +284,7 @@ itlb_miss_fault_bolted:
284 * r14 = page table base 284 * r14 = page table base
285 * r13 = PACA 285 * r13 = PACA
286 * r11 = tlb_per_core ptr 286 * r11 = tlb_per_core ptr
287 * r10 = crap (free to use) 287 * r10 = cpu number
288 */ 288 */
289tlb_miss_common_e6500: 289tlb_miss_common_e6500:
290 /* 290 /*
@@ -293,15 +293,18 @@ tlb_miss_common_e6500:
293 * 293 *
294 * MAS6:IND should be already set based on MAS4 294 * MAS6:IND should be already set based on MAS4
295 */ 295 */
296 addi r10,r11,TCD_LOCK 2961: lbarx r15,0,r11
2971: lbarx r15,0,r10 297 lhz r10,PACAPACAINDEX(r13)
298 cmpdi r15,0 298 cmpdi r15,0
299 cmpdi cr1,r15,1 /* set cr1.eq = 0 for non-recursive */
299 bne 2f 300 bne 2f
300 li r15,1 301 stbcx. r10,0,r11
301 stbcx. r15,0,r10
302 bne 1b 302 bne 1b
3033:
303 .subsection 1 304 .subsection 1
3042: lbz r15,0(r10) 3052: cmpd cr1,r15,r10 /* recursive lock due to mcheck/crit/etc? */
306 beq cr1,3b /* unlock will happen if cr1.eq = 0 */
307 lbz r15,0(r11)
305 cmpdi r15,0 308 cmpdi r15,0
306 bne 2b 309 bne 2b
307 b 1b 310 b 1b
@@ -379,9 +382,11 @@ tlb_miss_common_e6500:
379 382
380tlb_miss_done_e6500: 383tlb_miss_done_e6500:
381 .macro tlb_unlock_e6500 384 .macro tlb_unlock_e6500
385 beq cr1,1f /* no unlock if lock was recursively grabbed */
382 li r15,0 386 li r15,0
383 isync 387 isync
384 stb r15,TCD_LOCK(r11) 388 stb r15,0(r11)
3891:
385 .endm 390 .endm
386 391
387 tlb_unlock_e6500 392 tlb_unlock_e6500