linux/arch/powerpc
Milton Miller 768d18ad6d powerpc: Don't search for paca in freed memory
Starting with 1426d5a3bd (powerpc:
Dynamically allocate pacas) we free the memory for pacas beyond
cpu_possible, but we failed to update the loop the secondary cpus use
to find their paca.  If the system has running cpu threads for which
the kernel did not allocate a paca for they will search the memory that
was freed.  For instance this could happen when the device tree for
a kdump kernel was not updated after a cpu hotplug, or the kernel is
running with more cpus than the kernel was configured.

Since c1854e0072 (powerpc: Set nr_cpu_ids
early and use it to free PACAs) we set nr_cpu_ids before telling the
cpus to advance, so use that to limit the search.

We can't reference nr_cpu_ids without CONFIG_SMP because it is defined
as 1 instead of a memory location, but any extra threads should be sent
to kexec_wait in that case anyways, so make that explicit and remove
the search loop for UP.

Note to stable: The fix also requires
c1854e0072 (powerpc: Set
nr_cpu_ids early and use it to free PACAs) to function.  Also
9d07bc841c (Properly handshake CPUs going
out of boot spin loop) affects the second chunk, specifically the branch
target was 3b before and is 4b after that patch, and there was a blank
line before the #ifdef CONFIG_SMP that was removed

Cc: <stable@kernel.org> # .34.x: c1854e0072 powerpc: Set nr_cpu_ids early
Cc: <stable@kernel.org> # .34.x
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2011-05-19 14:30:43 +10:00
..
boot powerpc: Use the deterministic mode of ar 2011-05-19 14:30:40 +10:00
configs powerpc/pseries: Enable iSCSI support for a number of cards 2011-05-19 14:30:41 +10:00
include/asm powerpc: Remove ioremap_flags 2011-05-19 14:30:43 +10:00
kernel powerpc: Don't search for paca in freed memory 2011-05-19 14:30:43 +10:00
kvm powerpc: Always use SPRN_SPRG_HSCRATCH0 when running in HV mode 2011-04-20 11:03:23 +10:00
lib powerpc: Remove ioremap_flags 2011-05-19 14:30:43 +10:00
math-emu powerpc/85xx: Fix SPE float to integer conversion failure 2011-03-15 13:48:15 -05:00
mm powerpc: Remove ioremap_flags 2011-05-19 14:30:43 +10:00
oprofile Fix common misspellings 2011-03-31 11:26:23 -03:00
platforms powerpc/pseries: Print corrupt r3 in FWNMI code 2011-05-19 14:30:43 +10:00
sysdev powerpc: Remove ioremap_flags 2011-05-19 14:30:43 +10:00
xmon powerpc: Convert old cpumask API into new one 2011-05-04 15:22:59 +10:00
Kconfig powerpc/boot: Add an ePAPR compliant boot wrapper 2011-04-20 16:59:21 +10:00
Kconfig.debug powerpc: Add early debug for WSP platforms 2011-05-06 13:32:41 +10:00
Makefile powerpc: Fix typo in uImage target 2010-08-24 15:26:32 +10:00
relocs_check.pl powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00