* [PATCH v2] powerpc/e6500: hw tablewalk: fix recursive tlb lock on cpu 0
@ 2014-05-29 23:10 Scott Wood
0 siblings, 0 replies; only message in thread
From: Scott Wood @ 2014-05-29 23:10 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood
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>
---
v2: The comment on r10 was wrong before (since we don't set r10
until after entry), and it's even more wrong now that we add one
to the cpu number. Also added Reported-by.
arch/powerpc/mm/tlb_low_64e.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S
index 3298d10..131f1f4 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:
* r14 = page table base
* r13 = PACA
* r11 = tlb_per_core ptr
- * r10 = cpu number
+ * r10 = crap (free to use)
*/
tlb_miss_common_e6500:
/*
@@ -309,6 +309,7 @@ tlb_miss_common_e6500:
lhz r10,PACAPACAINDEX(r13)
cmpdi r15,0
cmpdi cr1,r15,1 /* set cr1.eq = 0 for non-recursive */
+ addi r10,r10,1
bne 2f
stbcx. r10,0,r11
bne 1b
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-05-29 23:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-29 23:10 [PATCH v2] powerpc/e6500: hw tablewalk: fix recursive tlb lock on cpu 0 Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox