diff options
author | Scott Wood <scottwood@freescale.com> | 2014-05-22 17:10:35 -0400 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-06-20 19:48:30 -0400 |
commit | 1cb4ed92f6a5a8961b122d11e651870ba741245b (patch) | |
tree | fef4fb40f49ff85d449410711a6c434a3d35b236 | |
parent | bbd08c72c6b3344a230e15264d6cd444ed76b958 (diff) |
powerpc/e6500: hw tablewalk: fix recursive tlb lock on cpu 0
Commit 82d86de25b9c99db546e17c6f7ebf9a691da557e "TLB lock recursive"
introduced a bug whereby cpu 0 uses the same value for "lock held" as
is used to indicate that the lock is free. This means that cpu 1 can
acquire the lock whenever it wants, regardless of whether cpu 0 has it
locked, which in turn means we can get duplicate TLB entries.
Add one to the CPU value to ensure we do not use zero as a "lock held"
value.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Reported-by: Ed Swarthout <ed.swarthout@freescale.com>
-rw-r--r-- | arch/powerpc/mm/tlb_low_64e.S | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S index 3298d1039e80..131f1f412bdd 100644 --- a/arch/powerpc/mm/tlb_low_64e.S +++ b/arch/powerpc/mm/tlb_low_64e.S | |||
@@ -296,7 +296,7 @@ itlb_miss_fault_bolted: | |||
296 | * r14 = page table base | 296 | * r14 = page table base |
297 | * r13 = PACA | 297 | * r13 = PACA |
298 | * r11 = tlb_per_core ptr | 298 | * r11 = tlb_per_core ptr |
299 | * r10 = cpu number | 299 | * r10 = crap (free to use) |
300 | */ | 300 | */ |
301 | tlb_miss_common_e6500: | 301 | tlb_miss_common_e6500: |
302 | /* | 302 | /* |
@@ -309,6 +309,7 @@ tlb_miss_common_e6500: | |||
309 | lhz r10,PACAPACAINDEX(r13) | 309 | lhz r10,PACAPACAINDEX(r13) |
310 | cmpdi r15,0 | 310 | cmpdi r15,0 |
311 | cmpdi cr1,r15,1 /* set cr1.eq = 0 for non-recursive */ | 311 | cmpdi cr1,r15,1 /* set cr1.eq = 0 for non-recursive */ |
312 | addi r10,r10,1 | ||
312 | bne 2f | 313 | bne 2f |
313 | stbcx. r10,0,r11 | 314 | stbcx. r10,0,r11 |
314 | bne 1b | 315 | bne 1b |