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

This change “powerpc/fsl-booke: Fix problem with _tlbil_va being interrupted” (commit e5e774d) in Linux kernel is authored by Kumar Gala <galak [at] kernel.crashing.org> on Sat Dec 13 17:01:37 2008 -0600.

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

The change “powerpc/fsl-booke: Fix problem with _tlbil_va being interrupted” introduces changes as follows.

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.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Linux kernel releases containing commit e5e774d

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "powerpc/fsl-booke: Fix problem with _tlbil_va being interrupted"

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 arch/powerpc/kernel/misc_32.S | 3 +++
 1 file changed, 3 insertions(+)
 
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index bdc8b0e860e5..d108715129e2 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -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 */
 

The commit for this change in Linux stable tree is e5e774d (patch).

Last modified: 2020/02/10