cpumask: fix Powerpc panic() caused by cpumask:smp_call_function_many

Stephen Rothwell got this panic:

  Kernel panic - not syncing: bad return code qirr - rc = fffffffffffffffc
  ...
  [c0000000bce4b560] [c00000000005dcd8] .panic+0x88/0x1d0
  [c0000000bce4b610] [c000000000040e28] .smp_xics_message_pass+0xf8/0x230
  [c0000000bce4b6b0] [c00000000002b0f0] .arch_send_call_function_ipi+0x60/0xb0
  [c0000000bce4b740] [c00000000008d64c] .smp_call_function_many+0x20c/0x360
  [c0000000bce4b810] [c00000000008d7d8] .smp_call_function+0x38/0x50
  [c0000000bce4b890] [c000000000064e44] .on_each_cpu+0x24/0x90
  [c0000000bce4b930] [c0000000001230c4] .invalidate_bh_lrus+0x24/0x40
  [c0000000bce4b9b0] [c00000000012b3b4] .kill_bdev+0x34/0x60

  The rc = fffffffffffffffc is an error code from the hypervisor and means
  "bad parameter".

This is caused by PowerPC's arch_send_call_function_ipi using
for_each_cpu_mask(), which iterates to NR_CPUS not nr_cpu_ids, and the
upper bits of the cpumask are undefined (and eventually won't be allocated).

So we zero those bits explicitly until all the kernel iterators are
converted (which will be a while yet).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 kernel/smp.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/smp.c b/kernel/smp.c
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -329,6 +329,8 @@ void smp_call_function_many(const struct
 		data->csd.flags |= CSD_FLAG_WAIT;
 	data->csd.func = func;
 	data->csd.info = info;
+	/* FIXME: Make archs use new iterators and ignore bits >= nr_cpu_ids */
+	memset(to_cpumask(data->cpumask_bits), 0, cpumask_size());
 	cpumask_and(to_cpumask(data->cpumask_bits), mask, cpu_online_mask);
 	cpumask_clear_cpu(smp_processor_id(), to_cpumask(data->cpumask_bits));
 	data->refs = cpumask_weight(to_cpumask(data->cpumask_bits));
