Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Matt Fleming <matt@console-pimps.org>
Cc: stable@kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Matt Fleming and committed by
Paul Mundt
4bea3418 d5ab7803

+1
+1
arch/sh/kernel/smp.c
··· 69 69 unsigned int cpu; 70 70 struct mm_struct *mm = &init_mm; 71 71 72 + enable_mmu(); 72 73 atomic_inc(&mm->mm_count); 73 74 atomic_inc(&mm->mm_users); 74 75 current->active_mm = mm;