diff options
-rw-r--r-- | tools/python/xen/xend/XendDomainInfo.py | 2 | ||||
-rw-r--r-- | xen/arch/x86/domain.c | 3 | ||||
-rw-r--r-- | xen/arch/x86/domctl.c | 18 | ||||
-rw-r--r-- | xen/common/domain.c | 7 | ||||
-rw-r--r-- | xen/common/domctl.c | 13 | ||||
-rw-r--r-- | xen/include/asm-x86/domain.h | 3 | ||||
-rw-r--r-- | xen/include/xen/sched.h | 3 |
7 files changed, 22 insertions, 27 deletions
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 1675cbd760..70bd704a77 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -2466,7 +2466,7 @@ class XendDomainInfo: # If nomigrate is set, disable migration nomigrate = self.info["platform"].get("nomigrate") - if arch.type == "x86" and nomigrate is not None and long(nomigrate) != 0: + if nomigrate is not None and long(nomigrate) != 0: xc.domain_disable_migrate(self.domid) # Optionally enable virtual HPET diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 8b414a4ac7..82ce975457 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -522,9 +522,6 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags) spin_lock_init(&d->arch.vtsc_lock); - if ( d->domain_id == 0 ) - d->disable_migrate = 1; - return 0; fail: diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 011e2d7112..581fcb3295 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1100,24 +1100,6 @@ long arch_do_domctl( } break; - case XEN_DOMCTL_disable_migrate: - { - struct domain *d; - - ret = -ESRCH; - d = rcu_lock_domain_by_id(domctl->domain); - if ( d == NULL ) - break; - - domain_pause(d); - d->arch.disable_migrate = domctl->u.disable_migrate.disable; - domain_unpause(d); - - rcu_unlock_domain(d); - ret = 0; - } - break; - case XEN_DOMCTL_suppress_spurious_page_faults: { struct domain *d; diff --git a/xen/common/domain.c b/xen/common/domain.c index 465aa00a44..ab3c5bb745 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -239,8 +239,11 @@ struct domain *domain_create( if ( domcr_flags & DOMCRF_hvm ) d->is_hvm = 1; - if ( (domid == 0) && opt_dom0_vcpus_pin ) - d->is_pinned = 1; + if ( domid == 0 ) + { + d->is_pinned = opt_dom0_vcpus_pin; + d->disable_migrate = 1; + } if ( domcr_flags & DOMCRF_dummy ) return d; diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 44a18ab1ec..0b9ad758dd 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -948,6 +948,19 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl) } break; + case XEN_DOMCTL_disable_migrate: + { + struct domain *d; + ret = -ESRCH; + if ( (d = rcu_lock_domain_by_id(op->domain)) != NULL ) + { + d->disable_migrate = op->u.disable_migrate.disable; + rcu_unlock_domain(d); + ret = 0; + } + } + break; + default: ret = arch_do_domctl(op, u_domctl); break; diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h index 851a71208d..08f2696ba9 100644 --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -304,9 +304,6 @@ struct arch_domain spinlock_t vtsc_lock; uint64_t vtsc_kerncount; /* for hvm, counts all vtsc */ uint64_t vtsc_usercount; /* not used for hvm */ - - /* mark domain as non-migratable and non-restoreable */ - bool_t disable_migrate; } __cacheline_aligned; #define has_arch_pdevs(d) (!list_empty(&(d)->arch.pdev_list)) diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index a8fe8de126..03907f7b4c 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -278,6 +278,9 @@ struct domain void *tmem; struct lock_profile_qhead profile_head; + + /* Non-migratable and non-restoreable? */ + bool_t disable_migrate; }; struct domain_setup_info |