From e6094b9d61b99a3fdbd648d9cefb719436972f88 Mon Sep 17 00:00:00 2001 From: George Dunlap Date: Wed, 24 Jan 2018 17:58:39 +0000 Subject: [PATCH] x86/shim: Use d->is_pinned to pin the shim Rather than special-casing it inside dom0_setup_vcpu() Signed-off-by: George Dunlap --- xen/arch/x86/dom0_build.c | 14 +++----------- xen/common/domain.c | 6 +++++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index 555660b853..483cb6cee9 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -138,17 +138,9 @@ struct vcpu *__init dom0_setup_vcpu(struct domain *d, if ( v ) { - if ( pv_shim ) - { - __cpumask_set_cpu(vcpu_id, v->cpu_hard_affinity); - __cpumask_set_cpu(vcpu_id, v->cpu_soft_affinity); - } - else - { - if ( !d->is_pinned && !dom0_affinity_relaxed ) - cpumask_copy(v->cpu_hard_affinity, &dom0_cpus); - cpumask_copy(v->cpu_soft_affinity, &dom0_cpus); - } + if ( !d->is_pinned && !dom0_affinity_relaxed ) + cpumask_copy(v->cpu_hard_affinity, &dom0_cpus); + cpumask_copy(v->cpu_soft_affinity, &dom0_cpus); } return v; diff --git a/xen/common/domain.c b/xen/common/domain.c index 558318e852..4ce7980550 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -318,7 +318,11 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags, { if ( hardware_domid < 0 || hardware_domid >= DOMID_FIRST_RESERVED ) panic("The value of hardware_dom must be a valid domain ID"); - d->is_pinned = opt_dom0_vcpus_pin; + d->is_pinned = +#ifdef CONFIG_X86 + pv_shim ? true : +#endif + opt_dom0_vcpus_pin; d->disable_migrate = 1; old_hwdom = hardware_domain; hardware_domain = d; -- 2.15.1