sched: dom0_vcpus_pin should only affect dom0
authorDario Faggioli <dfaggioli@suse.com>
Wed, 3 Aug 2022 10:14:01 +0000 (12:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 3 Aug 2022 10:14:01 +0000 (12:14 +0200)
If dom0_vcpus_pin is used, make sure the pinning is only done for
dom0 vcpus, instead of for the hardware domain (which might not be
dom0 at all!).

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/sched/core.c

index f689b55783f7159270053ed02448a1738f9594de..a066c629cb46a9587e54c9fd9634300b657b1580 100644 (file)
@@ -575,7 +575,7 @@ int sched_init_vcpu(struct vcpu *v)
      * Initialize affinity settings. The idler, and potentially
      * domain-0 VCPUs, are pinned onto their respective physical CPUs.
      */
-    if ( is_idle_domain(d) || (is_hardware_domain(d) && opt_dom0_vcpus_pin) )
+    if ( is_idle_domain(d) || (d->domain_id == 0 && opt_dom0_vcpus_pin) )
         sched_set_affinity(unit, cpumask_of(processor), &cpumask_all);
     else
         sched_set_affinity(unit, &cpumask_all, &cpumask_all);