[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFCv2 27/38] x86/hyperlaunch: introduce arch builder finalize
This commit introduces a per arch builder finalize method where all post-construction finalization and cleanup can be handled. The call to discard boot modules relocated from inside the two x86 domain construction paths to the x86 domain builder finalize method. This will ensure modules are not discarded until after all domains have been constructed. Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx> --- Changes since RFC v1: - reworked the commit to introduce builder finalize - renamed the commit to refelect builder finalize --- xen/arch/x86/domain-builder/core.c | 2 ++ xen/arch/x86/domain-builder/domain.c | 8 ++++++++ xen/arch/x86/hvm/dom_build.c | 3 --- xen/arch/x86/pv/dom0_build.c | 3 --- xen/include/xen/domain-builder.h | 2 ++ 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/domain-builder/core.c b/xen/arch/x86/domain-builder/core.c index 3b315e59b188..4eaf3a111208 100644 --- a/xen/arch/x86/domain-builder/core.c +++ b/xen/arch/x86/domain-builder/core.c @@ -22,6 +22,8 @@ unsigned int __init builder_create_domains(struct boot_info *bi) if ( bd->d ) build_count++; + 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 2c01705ebe4f..5b03e3dce228 100644 --- a/xen/arch/x86/domain-builder/domain.c +++ b/xen/arch/x86/domain-builder/domain.c @@ -326,6 +326,14 @@ struct domain *__init arch_create_dom( return d; } +int __init arch_builder_finalize(struct boot_info *bi) +{ + /* Free temporary buffers. */ + free_boot_modules(); + + return 0; +} + /* * Local variables: * mode: C diff --git a/xen/arch/x86/hvm/dom_build.c b/xen/arch/x86/hvm/dom_build.c index e73a3950b30e..58fc40916df5 100644 --- a/xen/arch/x86/hvm/dom_build.c +++ b/xen/arch/x86/hvm/dom_build.c @@ -853,9 +853,6 @@ static int __init pvh_load_kernel( last_addr = ROUNDUP(last_addr, PAGE_SIZE); } - /* Free temporary buffers. */ - free_boot_modules(); - rc = hvm_copy_to_guest_phys(last_addr, bd->cmdline, cmdline_len, v); if ( rc ) { diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index 195c0902d5a1..21cb0b11748e 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -866,9 +866,6 @@ static int __init dom0_construct(struct boot_domain *bd) init_hypercall_page(d, _p(parms.virt_hypercall)); } - /* Free temporary buffers. */ - free_boot_modules(); - /* Set up start info area. */ si = (start_info_t *)vstartinfo_start; clear_page(si); diff --git a/xen/include/xen/domain-builder.h b/xen/include/xen/domain-builder.h index c26f670d4f66..ca9d9032b35b 100644 --- a/xen/include/xen/domain-builder.h +++ b/xen/include/xen/domain-builder.h @@ -43,6 +43,8 @@ void domain_vcpus_create(struct domain *d); struct domain *arch_create_dom( struct boot_info *bi, struct boot_domain *bd); +int arch_builder_finalize(struct boot_info *bi); + unsigned int builder_create_domains(struct boot_info *bi); #endif /* __XEN_DOMAIN_BUILDER_H__ */ -- 2.30.2
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |