提交 ebb9d30a 编写于 作者: C chenhui zhao 提交者: Scott Wood

powerpc/mm: any thread in one core can be the first to setup TLB1

On e6500, in the case of cpu hotplug, either thread in one core
may be the first thread initilzing the TLB1. The subsequent threads
must not setup it again.

The code is derived from the comment of Scott Wood.
Signed-off-by: NChenhui Zhao <chenhui.zhao@freescale.com>
Signed-off-by: NScott Wood <oss@buserror.net>
上级 d64716ca
...@@ -94,6 +94,14 @@ static inline int cpu_last_thread_sibling(int cpu) ...@@ -94,6 +94,14 @@ static inline int cpu_last_thread_sibling(int cpu)
return cpu | (threads_per_core - 1); return cpu | (threads_per_core - 1);
} }
static inline u32 get_tensr(void)
{
#ifdef CONFIG_BOOKE
if (cpu_has_feature(CPU_FTR_SMT))
return mfspr(SPRN_TENSR);
#endif
return 1;
}
#endif /* _ASM_POWERPC_CPUTHREADS_H */ #endif /* _ASM_POWERPC_CPUTHREADS_H */
......
...@@ -640,9 +640,7 @@ static void early_init_this_mmu(void) ...@@ -640,9 +640,7 @@ static void early_init_this_mmu(void)
* transient mapping would cause problems. * transient mapping would cause problems.
*/ */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
if (cpu != boot_cpuid && if (hweight32(get_tensr()) > 1)
(cpu != cpu_first_thread_sibling(cpu) ||
cpu == cpu_first_thread_sibling(boot_cpuid)))
map = false; map = false;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册