提交 4676f935 编写于 作者: L Leonid Yegoshin 提交者: Ralf Baechle

MIPS: mm: c-r4k: Flush scache to avoid cache aliases

There is a chance for the secondary cache to have memory
aliases. This can happen if the bootloader is in a non-EVA mode
(or even in EVA mode but with different mapping from the kernel)
and the kernel switching to EVA afterwards. It's best to flush
the icache to avoid having the secondary CPUs fetching stale
data from it.
Signed-off-by: NLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
上级 80ca69f4
......@@ -640,6 +640,17 @@ static inline void local_r4k_flush_icache_range(unsigned long start, unsigned lo
break;
}
}
#ifdef CONFIG_EVA
/*
* Due to all possible segment mappings, there might cache aliases
* caused by the bootloader being in non-EVA mode, and the CPU switching
* to EVA during early kernel init. It's best to flush the scache
* to avoid having secondary cores fetching stale data and lead to
* kernel crashes.
*/
bc_wback_inv(start, (end - start));
__sync();
#endif
}
static inline void local_r4k_flush_icache_range_ipi(void *args)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册