]> xenbits.xensource.com Git - xen.git/commit
xen: fix for_each_cpu when NR_CPUS=1
authorDario Faggioli <dfaggioli@suse.com>
Fri, 12 Mar 2021 16:02:47 +0000 (17:02 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 12 Mar 2021 16:02:47 +0000 (17:02 +0100)
commitaa50f45332f17e8d6308b996d890d3e83748a1a5
tree99b81d1a95d2b95598f3b0f75e904aadf366fb34
parent04181c6fb543db01f635227c7681ced4073109ba
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>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
xen/include/xen/cpumask.h