xen: fix for_each_cpu when NR_CPUS=1
authorDario Faggioli <dfaggioli@suse.com>
Thu, 18 Mar 2021 14:02:43 +0000 (15:02 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 18 Mar 2021 14:02:43 +0000 (15:02 +0100)
commit1d6fa27b6b003e3589e6cae2b6d2fc3f842e0a6d
tree1ee3b27ac476b604e0358582b097e6c34e5d3ff1
parent57ced58d26b2131e61b0b1b7c22de1e8ff712861
xen: fix for_each_cpu when NR_CPUS=1

When running an hypervisor build with NR_CPUS=1 for_each_cpu does not
take into account whether the bit of the CPU is set or not in the
provided mask.

This means that whatever we have in the bodies of these loops is always
done once, even if the mask was empty and it should never be done. This
is clearly a bug and was in fact causing an assert to trigger in credit2
code.

Removing the special casing of NR_CPUS == 1 makes things work again.

Reported-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: aa50f45332f17e8d6308b996d890d3e83748a1a5
master date: 2021-03-12 17:02:47 +0100
xen/include/xen/cpumask.h