From: Peng Fan <peng....@nxp.com> When migrating domain between different cpupools, need to check whether the domain is compatible with the cpupool.
Signed-off-by: Peng Fan <peng....@nxp.com> Cc: Stefano Stabellini <sstabell...@kernel.org> Cc: Julien Grall <julien.gr...@arm.com> --- xen/arch/arm/cpupool.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/cpupool.c b/xen/arch/arm/cpupool.c index 74a5ef3..6c1c092 100644 --- a/xen/arch/arm/cpupool.c +++ b/xen/arch/arm/cpupool.c @@ -41,5 +41,20 @@ int arch_cpupool_cpu_add(struct cpupool *c, unsigned int cpu) bool_t arch_domain_cpupool_compatible(struct domain *d, struct cpupool *c) { - return true; + if ( !d->vcpu || !d->vcpu[0] ) + { + /* + * We are in process of domain creation, vcpu not constructed or + * initialiszed, ok to move domain from cpupool0 to other pool + */ + return true; + } + else if ( d->vcpu[0] ) + { + return !!( d->vcpu[0]->arch.vpidr == c->info.midr ); + } + else + { + return false; + } } -- 2.6.6 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel