[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFCv2 15/38] x86/boot: move and rename sched_setup_dom0_vcpus
Relocated the function sched_setup_dom0_vcpus(), which was protected by an ifdef CONFIG_X86, from common/sched to the hyperlaunch domain builder. Rename it to alloc_dom_vcpus() to better reflect the purpose of the function. Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx> --- xen/arch/x86/domain-builder/domain.c | 10 ++++++++++ xen/arch/x86/hvm/dom0_build.c | 3 ++- xen/arch/x86/pv/dom0_build.c | 3 ++- xen/common/sched/core.c | 12 ------------ xen/include/xen/domain-builder.h | 2 ++ xen/include/xen/sched.h | 1 - 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/xen/arch/x86/domain-builder/domain.c b/xen/arch/x86/domain-builder/domain.c index 258f777cd9ee..d934b240229f 100644 --- a/xen/arch/x86/domain-builder/domain.c +++ b/xen/arch/x86/domain-builder/domain.c @@ -45,6 +45,16 @@ struct vcpu *__init domain_vcpu0_create(struct boot_domain *bd) return vcpu_create(bd->d, 0); } +void __init domain_vcpus_create(struct domain *d) +{ + unsigned int i; + + for ( i = 1; i < d->max_vcpus; i++ ) + vcpu_create(d, i); + + domain_update_node_affinity(d); +} + unsigned long __init dom_paging_pages( const struct boot_domain *bd, unsigned long nr_pages) { diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c index 6990c1d3a882..a900138b0311 100644 --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -8,6 +8,7 @@ */ #include <xen/acpi.h> +#include <xen/domain-builder.h> #include <xen/init.h> #include <xen/libelf.h> #include <xen/multiboot.h> @@ -833,7 +834,7 @@ static int __init pvh_setup_cpus(struct domain *d, paddr_t entry, .cpu_regs.x86_32.tr_ar = 0x8b, }; - sched_setup_dom0_vcpus(d); + domain_vcpus_create(d); rc = arch_set_info_hvm_guest(v, &cpu_ctx); if ( rc ) diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index ad4d1cc3520c..195c0902d5a1 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -5,6 +5,7 @@ */ #include <xen/domain.h> +#include <xen/domain-builder.h> #include <xen/domain_page.h> #include <xen/init.h> #include <xen/libelf.h> @@ -827,7 +828,7 @@ static int __init dom0_construct(struct boot_domain *bd) printk("Dom%u has maximum %u VCPUs\n", d->domain_id, d->max_vcpus); - sched_setup_dom0_vcpus(d); + domain_vcpus_create(d); d->arch.paging.mode = 0; diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 9043414290a8..d679d766a4b6 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -3479,18 +3479,6 @@ void wait(void) schedule(); } -#ifdef CONFIG_X86 -void __init sched_setup_dom0_vcpus(struct domain *d) -{ - unsigned int i; - - for ( i = 1; i < d->max_vcpus; i++ ) - vcpu_create(d, i); - - domain_update_node_affinity(d); -} -#endif - #ifdef CONFIG_COMPAT #include "compat.c" #endif diff --git a/xen/include/xen/domain-builder.h b/xen/include/xen/domain-builder.h index d3390d368afb..79e4c50ddf85 100644 --- a/xen/include/xen/domain-builder.h +++ b/xen/include/xen/domain-builder.h @@ -6,6 +6,7 @@ struct boot_info; struct boot_domain; +struct domain; /* Return status of builder_init(). Shows which boot mechanism was detected */ enum fdt_kind @@ -37,5 +38,6 @@ int builder_get_cmdline(const struct boot_info *bi, int offset, unsigned int dom_max_vcpus(struct boot_domain *bd); struct vcpu *domain_vcpu0_create(struct boot_domain *bd); +void domain_vcpus_create(struct domain *d); #endif /* __XEN_DOMAIN_BUILDER_H__ */ diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 559d201e0c7e..4f184cd76206 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -1084,7 +1084,6 @@ static inline bool sched_has_urgent_vcpu(void) } void vcpu_set_periodic_timer(struct vcpu *v, s_time_t value); -void sched_setup_dom0_vcpus(struct domain *d); int vcpu_temporary_affinity(struct vcpu *v, unsigned int cpu, uint8_t reason); int vcpu_set_hard_affinity(struct vcpu *v, const cpumask_t *affinity); int vcpu_affinity_domctl(struct domain *d, uint32_t cmd, -- 2.30.2
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |