Skip to contentSkip to conversation

MIPS: Hibernate: flush TLB entries in swsusp_arch_resume()

PATCH New Huacai Chen 1 participant 1 message Mar 22, 2014 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Hibernate: flush TLB entries in swsusp_arch_resume()

The original MIPS hibernate code flushes cache and TLB entries in swsusp_arch_resume(). But they are removed in Commit 44eeab67416711 (MIPS: Hibernation: Remove SMP TLB and cacheflushing code.). A cross- CPU flush is surely unnecessary because all but the local CPU have already been disabled. But a local flush (at least the TLB flush) is needed. When we do hibernation on Loongson-3 with an E1000E NIC, it is very easy to produce a kernel panic (kernel page fault, or unaligned access). The root cause is E1000E driver use vzalloc_node() to allocate pages, the stale TLB entries of the booting kernel will be misused by the resumed target kernel.

---
 arch/mips/power/hibernate.S |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/mips/power/hibernate.S +1 -0
index 7e0277a..32a7c82 100644
@@ -43,6 +43,7 @@ LEAF(swsusp_arch_resume)
 	bne t1, t3, 1b
 	PTR_L t0, PBE_NEXT(t0)
 	bnez t0, 0b
+	jal local_flush_tlb_all /* Avoid TLB mismatch after kernel resume */
 	PTR_LA t0, saved_regs
 	PTR_L ra, PT_R31(t0)
 	PTR_L sp, PT_R29(t0)
Signature · 1 line
1.7.7.3