]> bbs.cooldavid.org Git - net-next-2.6.git/commit
powerpc/kdump: CPUs assume the context of the oopsing CPU
authorAnton Blanchard <anton@samba.org>
Mon, 10 May 2010 16:25:51 +0000 (16:25 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 21 May 2010 07:31:10 +0000 (17:31 +1000)
commit0644079410065567e3bb31fcb8e6441f2b7685a9
tree86063190ee8b84cb4f892454c0905a760cdcec01
parent426b6cb478e60352a463a0d1ec75c1c9fab30b13
powerpc/kdump: CPUs assume the context of the oopsing CPU

We wrap the crash_shutdown_handles[] calls with longjmp/setjmp, so if any
of them fault we can recover. The problem is we add a hook to the debugger
fault handler hook which calls longjmp unconditionally.

This first part of kdump is run before we marshall the other CPUs, so there
is a very good chance some CPU on the box is going to page fault. And when
it does it hits the longjmp code and assumes the context of the oopsing CPU.
The machine gets very confused when it has 10 CPUs all with the same stack,
all thinking they have the same CPU id. I get even more confused trying
to debug it.

The patch below adds crash_shutdown_cpu and uses it to specify which cpu is
in the protected region. Since it can only be -1 or the oopsing CPU, we don't
need to use memory barriers since it is only valid on the local CPU - no other
CPU will ever see a value that matches it's local CPU id.

Eventually we should switch the order and marshall all CPUs before doing the
crash_shutdown_handles[] calls, but that is a bigger fix.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/crash.c