linux/arch/mips/kernel
Maksim Rayskiy 5c20019713 MIPS: ASID conflict after CPU hotplug
I am running SMP Linux 2.6.37-rc1 on BMIPS5000 (single core dual thread)
and observe some abnormalities when doing system suspend/resume which I
narrowed down to cpu hotplugging. The suspend brings the second thread
processor down and then restarts it, after which I see memory corruption
in userspace. I started digging and found out that problem occurs because
while doing execve() the child process is getting the same ASID as the
parent, which obviously corrupts parent's address space.

Further digging showed that activate_mm() calls get_new_mmu_context() to
get a new ASID, but at this time ASID field in entryHi is 1, and
asid_cache(cpu) is 0x100 (it was just reset to ASID_FIRST_VERSION when
the secondary TP was booting).

So, get_new_mmu_context() increments the asid_cache(cpu) value to
0x101, and thus puts 0x01 into entryHi. The result - ASID field does
not get changed as it was supposed to.

My solution is very simple - do not reset asid_cache(cpu) on TP warm
restart.

Patchwork: https://patchwork.linux-mips.org/patch/1797/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-11-10 17:59:45 +00:00
..
cpufreq MIPS: errloongson2_clock: Fix build error by including linux/module.h 2011-11-10 17:59:45 +00:00
.gitignore
8250-platform.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
asm-offsets.c
binfmt_elfn32.c
binfmt_elfo32.c
branch.c
cevt-bcm1480.c
cevt-ds1287.c
cevt-gt641xx.c
cevt-r4k.c MIPS: Kernel hangs occasionally during boot. 2011-11-08 17:59:22 +00:00
cevt-sb1250.c
cevt-smtc.c
cevt-txx9.c
cpu-bugs64.c
cpu-probe.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
csrc-bcm1480.c
csrc-ioasic.c
csrc-powertv.c
csrc-r4k.c
csrc-sb1250.c
early_printk.c
entry.S MIPS: Split do_syscall_trace into two functions. 2011-05-19 09:55:44 +01:00
ftrace.c MIPS: Ftrace: Fix the CONFIG_DYNAMIC_FTRACE=n compile 2011-09-21 17:52:04 +02:00
genex.S
gpio_txx9.c
head.S
i8253.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
i8259.c MIPS: i8259: Mark cascade interrupt non-threaded 2011-09-21 17:52:28 +02:00
init_task.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
irq-gic.c
irq-gt641xx.c
irq-msc01.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
irq-rm7000.c
irq-rm9000.c
irq.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
irq_cpu.c MIPS: Install handlers for software IRQs 2011-07-25 17:26:54 +01:00
irq_txx9.c
jump_label.c
kgdb.c
kprobes.c
kspd.c
linux32.c MIPS: Compat: Use 32-bit wrapper for compat_sys_futex. 2011-09-21 17:53:44 +02:00
machine_kexec.c
Makefile MIPS: perf: Reorganize contents of perf support files. 2011-10-24 23:34:26 +01:00
mcount.S
mips-mt-fpaff.c
mips-mt.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
mips_ksyms.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
mips_machine.c
module.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
octeon_switch.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
perf_event.c MIPS: perf: Reorganize contents of perf support files. 2011-10-24 23:34:26 +01:00
perf_event_mipsxx.c MIPS: perf: Add Octeon support for hardware perf. 2011-10-24 23:34:27 +01:00
proc.c
process.c mips: add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:30:57 -04:00
prom.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
ptrace.c MIPS: Split do_syscall_trace into two functions. 2011-05-19 09:55:44 +01:00
ptrace32.c
r4k_fpu.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
r4k_switch.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
r2300_fpu.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
r2300_switch.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
r6000_fpu.S update David Miller's old email address 2011-04-06 06:19:38 -07:00
relocate_kernel.S
reset.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
rtlx.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
scall32-o32.S MIPS: Hook up process_vm_readv and process_vm_writev system calls. 2011-11-09 00:07:56 +00:00
scall64-64.S MIPS: Hook up process_vm_readv and process_vm_writev system calls. 2011-11-09 00:07:56 +00:00
scall64-n32.S MIPS: Hook up process_vm_readv and process_vm_writev system calls. 2011-11-09 00:07:56 +00:00
scall64-o32.S MIPS: Hook up process_vm_readv and process_vm_writev system calls. 2011-11-09 00:07:56 +00:00
setup.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
signal-common.h
signal.c MIPS: Handle __put_user() sleeping. 2011-09-21 17:52:38 +02:00
signal32.c
signal_n32.c
smp-cmp.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
smp-mt.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
smp-up.c
smp.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
smtc-asm.S
smtc-proc.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
smtc.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
spinlock_test.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
spram.c
stacktrace.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
sync-r4k.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
syscall.c MIPS: Move arch_get_unmapped_area and gang to new file. 2011-05-19 09:55:49 +01:00
time.c mips: migrate core kernel file from module.h --> export.h 2011-10-31 19:30:56 -04:00
topology.c
traps.c MIPS: ASID conflict after CPU hotplug 2011-11-10 17:59:45 +00:00
unaligned.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
vdso.c
vmlinux.lds.S Merge branch 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2011-05-24 11:53:42 -07:00
vpe.c mips: remove needless include of module.h from core kernel files. 2011-10-31 19:30:57 -04:00
watch.c