powerpc/xmon: Use cpumask iterator to avoid warning
authorAnton Blanchard <anton@samba.org>
Thu, 28 Jun 2012 19:28:57 +0000 (19:28 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Jul 2012 03:32:04 +0000 (04:32 +0100)
commit6ff38e97bd02e4b975f2217a64482749f1b487b0
tree2b44d3de93e2f0d51e217527819c258789e47923
parent5440ea00d6cc186b509e4585f6f9a04029b62232
powerpc/xmon: Use cpumask iterator to avoid warning

commit bc1d7702910c7c7e88eb60b58429dbfe293683ce upstream.

We have a bug report where the kernel hits a warning in the cpumask
code:

WARNING: at include/linux/cpumask.h:107

Which is:
        WARN_ON_ONCE(cpu >= nr_cpumask_bits);

The backtrace is:
        cpu_cmd
        cmds
        xmon_core
        xmon
        die

xmon is iterating through 0 to NR_CPUS. I'm not sure why we are still
open coding this but iterating above nr_cpu_ids is definitely a bug.

This patch iterates through all possible cpus, in case we issue a
system reset and CPUs in an offline state call in.

Perhaps the old code was trying to handle CPUs that were in the
partition but were never started (eg kexec into a kernel with an
nr_cpus= boot option). They are going to die way before we get into
xmon since we haven't set any kernel state up for them.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/powerpc/xmon/xmon.c