]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/kexec: Fix kexec when using VMX optimised memcpy
authorAnton Blanchard <anton@au1.ibm.com>
Sun, 12 May 2013 15:04:53 +0000 (15:04 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 14 May 2013 04:36:23 +0000 (14:36 +1000)
commit0883b4c9329ebb19f4c489bd3821669ae162b524
tree2c3939dfec9ee8f3eeb8fb10d57252a364bf501e
parentf4bd661a2095caec6851c4bd1929253753d0d0be
powerpc/kexec: Fix kexec when using VMX optimised memcpy

commit 714629de2feb (powerpc: POWER7 optimised memcpy using VMX and
enhanced prefetch) uses VMX when it is safe to do so (ie not in
interrupt). It also looks at the task struct to decide if we have to
save the current tasks' VMX state.

kexec calls memcpy() at a point where the task struct may have been
overwritten by the new kexec segments. If it has been overwritten
then when memcpy -> enable_altivec looks up current->thread.regs->msr
we get a cryptic oops or lockup.

I also notice we aren't initialising thread_info->cpu, which means
smp_processor_id is broken. Fix that too.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@vger.kernel.org> # 3.6+
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/machine_kexec_64.c