提交 4bea3418 编写于 作者: M Matt Fleming 提交者: Paul Mundt

sh: Enable the mmu in start_secondary()

For the boot, enable_mmu() is called from setup_arch() but we don't call
setup_arch() for any of the other cpus. So turn on the non-boot cpu's
mmu inside of start_secondary().

I noticed this bug on an SMP board when trying to map I/O memory
(smsc911x registers) into the kernel address space. Since the Address
Translation bit in MMUCR wasn't set, accessing the virtual address where
the smsc911x registers were supposedly mapped actually performed a
physical address access.
Signed-off-by: NMatt Fleming <matt@console-pimps.org>
Cc: stable@kernel.org
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 d5ab7803
...@@ -69,6 +69,7 @@ asmlinkage void __cpuinit start_secondary(void) ...@@ -69,6 +69,7 @@ asmlinkage void __cpuinit start_secondary(void)
unsigned int cpu; unsigned int cpu;
struct mm_struct *mm = &init_mm; struct mm_struct *mm = &init_mm;
enable_mmu();
atomic_inc(&mm->mm_count); atomic_inc(&mm->mm_count);
atomic_inc(&mm->mm_users); atomic_inc(&mm->mm_users);
current->active_mm = mm; current->active_mm = mm;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册