[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFCv2 35/38] x86/hyperlaunch: add multidomain construction logic
Introduce the logic to loop over boot_info->domains and construct each valid entry in the array. Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx> --- xen/arch/x86/domain-builder/core.c | 30 ++++++++++++++++++++++++++++ xen/arch/x86/domain-builder/domain.c | 7 +++++-- xen/arch/x86/hvm/dom_build.c | 5 ++++- xen/arch/x86/setup.c | 3 ++- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/domain-builder/core.c b/xen/arch/x86/domain-builder/core.c index af79792b5316..367c0de33cfb 100644 --- a/xen/arch/x86/domain-builder/core.c +++ b/xen/arch/x86/domain-builder/core.c @@ -58,6 +58,7 @@ static int __init build_core_domains(struct boot_info *bi) unsigned int __init builder_create_domains(struct boot_info *bi) { unsigned int build_count = 0; + int i; if ( bi->nr_domains == 0 ) panic("%s: no domains defined\n", __func__); @@ -70,10 +71,39 @@ unsigned int __init builder_create_domains(struct boot_info *bi) bi->domains[0].constructed = true; build_count++; } + + goto out; } else build_count = build_core_domains(bi); + if ( !IS_ENABLED(CONFIG_MULTIDOMAIN_BUILDER) ) + goto out; + + for ( i = 0; i < bi->nr_domains; i++ ) + { + struct boot_domain *bd = &bi->domains[i]; + + if ( bd->constructed ) + continue; + + if ( bd->mode & BUILD_MODE_PARAVIRT ) + { + printk(XENLOG_WARNING "don't support PV DomU, skipping %d\n", i); + continue; + } + + arch_create_dom(bi, bd); + if ( bd->d ) + { + bd->constructed = true; + build_count++; + } + else + printk(XENLOG_WARNING "failed to construct build domain %d\n", i); + } + + out: arch_builder_finalize(bi); return build_count; diff --git a/xen/arch/x86/domain-builder/domain.c b/xen/arch/x86/domain-builder/domain.c index c453629700c1..9d9901fad505 100644 --- a/xen/arch/x86/domain-builder/domain.c +++ b/xen/arch/x86/domain-builder/domain.c @@ -326,8 +326,11 @@ struct domain *__init arch_create_dom( ((hvm_hap_supported() && !opt_dom0_shadow) ? XEN_DOMCTL_CDF_hap : 0)); - dom_cfg.arch.emulation_flags |= - XEN_X86_EMU_LAPIC | XEN_X86_EMU_IOAPIC | XEN_X86_EMU_VPCI; + if ( bd->capabilities & DOMAIN_CAPS_HARDWARE ) + dom_cfg.arch.emulation_flags |= + XEN_X86_EMU_LAPIC | XEN_X86_EMU_IOAPIC | XEN_X86_EMU_VPCI; + else + dom_cfg.arch.emulation_flags |= X86_EMU_LAPIC; } if ( iommu_enabled && (bd->capabilities & DOMAIN_CAPS_HARDWARE) ) diff --git a/xen/arch/x86/hvm/dom_build.c b/xen/arch/x86/hvm/dom_build.c index 170caac6716e..3118e3483e46 100644 --- a/xen/arch/x86/hvm/dom_build.c +++ b/xen/arch/x86/hvm/dom_build.c @@ -885,7 +885,10 @@ static int __init pvh_load_kernel( } start_info.magic = XEN_HVM_START_MAGIC_VALUE; - start_info.flags = SIF_PRIVILEGED | SIF_INITDOMAIN; + if ( is_control_domain(d) ) + start_info.flags = SIF_PRIVILEGED; + if ( is_hardware_domain(d) ) + start_info.flags = SIF_INITDOMAIN; rc = hvm_copy_to_guest_phys(last_addr, &start_info, sizeof(start_info), v); if ( rc ) { diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 36e6ba11ddcd..422fef7ce02a 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1331,7 +1331,8 @@ void asmlinkage __init noreturn __start_xen(void) xen->size = __2M_rwdata_end - _stext; } - arch_builder_headroom(&bi->domains[0]); + for ( i = 0; i < bi->nr_domains; i++ ) + arch_builder_headroom(&bi->domains[i]); #ifndef highmem_start /* Don't allow split below 4Gb. */ -- 2.30.2
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |