Skip to contentSkip to conversation

powerpc/fsl-booke: Fix problem with _tlbil_va being interrupted

PATCH In review Kumar Gala 2 participants 2 messages Dec 13, 2008 – Dec 14, 2008 PowerPC

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 powerpc/fsl-booke: Fix problem with _tlbil_va being interrupted

An example calling sequence which we did see:

copy_user_highpage -> kmap_atomic -> flush_tlb_page -> _tlbil_va

We got interrupted after setting up the MAS registers before the tlbwe and the interrupt handler that caused the interrupt also did a kmap_atomic (ide code) and thus on returning from the interrupt the MAS registers no longer contained the proper values.

Since we dont save/restore MAS registers for normal interrupts we need to disable interrupts in _tlbil_va to ensure atomicity.

---
 arch/powerpc/kernel/misc_32.S |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/powerpc/kernel/misc_32.S +3 -0
index bdc8b0e..d108715 100644
@@ -479,6 +479,8 @@ _GLOBAL(_tlbil_pid)
  * (no broadcast)
  */
 _GLOBAL(_tlbil_va)
+	mfmsr	r10
+	wrteei	0
 	slwi	r4,r4,16
 	mtspr	SPRN_MAS6,r4		/* assume AS=0 for now */
 	tlbsx	0,r3
@@ -490,6 +492,7 @@ _GLOBAL(_tlbil_va)
 	tlbwe
 	msync
 	isync
+	wrtee	r10
 	blr
 #endif /* CONFIG_FSL_BOOKE */
 
Signature · 1 line
1.5.6.5
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Kumar Gala

An example calling sequence which we did see:

copy_user_highpage -> kmap_atomic -> flush_tlb_page -> _tlbil_va

We got interrupted after setting up the MAS registers before the tlbwe and the interrupt handler that caused the interrupt also did a kmap_atomic (ide code) and thus on returning from the interrupt the MAS registers no longer contained the proper values.

Quoted 4 lines

Since we dont save/restore MAS registers for normal interrupts we need to disable interrupts in _tlbil_va to ensure atomicity.

---

Paul, this is a 2.6.28 regression, it should probably go to Linus in case he hasn't released yet :-)

Cheers,
Ben.