[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFC 26/38] x86/hyperlaunch: remove dom0-isms from arch_create_dom
Removes the dom0 naming from variables and isolates control/hardware domain specific logic behind capabilities check. Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx> --- xen/arch/x86/domain-builder/domain.c | 47 +++++++++++++++------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/xen/arch/x86/domain-builder/domain.c b/xen/arch/x86/domain-builder/domain.c index a82c02250b4c..13f99111a3a9 100644 --- a/xen/arch/x86/domain-builder/domain.c +++ b/xen/arch/x86/domain-builder/domain.c @@ -216,7 +216,7 @@ struct domain *__init arch_create_dom( char *cmdline = NULL; size_t cmdline_size; unsigned int create_flags = 0; - struct xen_domctl_createdomain dom0_cfg = { + struct xen_domctl_createdomain dom_cfg = { .flags = IS_ENABLED(CONFIG_TBOOT) ? XEN_DOMCTL_CDF_s3_integrity : 0, .max_evtchn_port = -1, .max_grant_frames = -1, @@ -232,11 +232,11 @@ struct domain *__init arch_create_dom( if ( opt_dom0_pvh || (bi->hyperlaunch_enabled && !(bd->mode & BUILD_MODE_PARAVIRT)) ) { - dom0_cfg.flags |= (XEN_DOMCTL_CDF_hvm | + dom_cfg.flags |= (XEN_DOMCTL_CDF_hvm | ((hvm_hap_supported() && !opt_dom0_shadow) ? XEN_DOMCTL_CDF_hap : 0)); - dom0_cfg.arch.emulation_flags |= + dom_cfg.arch.emulation_flags |= XEN_X86_EMU_LAPIC | XEN_X86_EMU_IOAPIC | XEN_X86_EMU_VPCI; } @@ -244,7 +244,7 @@ struct domain *__init arch_create_dom( { create_flags |= CDF_hardware; if ( iommu_enabled ) - dom0_cfg.flags |= XEN_DOMCTL_CDF_iommu; + dom_cfg.flags |= XEN_DOMCTL_CDF_iommu; } if ( bd->domid == DOMID_INVALID ) @@ -252,7 +252,7 @@ struct domain *__init arch_create_dom( bd->domid = get_initial_domain_id(); if ( bd->capabilities & BUILD_CAPS_CONTROL ) create_flags |= CDF_privileged | CDF_hardware; - d = domain_create(bd->domid, &dom0_cfg, + d = domain_create(bd->domid, &dom_cfg, pv_shim ? 0 : create_flags); if ( IS_ERR(d) ) panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d)); @@ -279,25 +279,30 @@ struct domain *__init arch_create_dom( cmdline_cook(__va(bd->kernel->cmdline_pa),bi->loader), cmdline_size); - if ( bi->kextra ) - /* kextra always includes exactly one leading space. */ - strlcat(cmdline, bi->kextra, cmdline_size); - - /* Append any extra parameters. */ - if ( skip_ioapic_setup && !strstr(cmdline, "noapic") ) - strlcat(cmdline, " noapic", cmdline_size); - - if ( (strlen(acpi_param) == 0) && acpi_disabled ) + /* Params from Xen cmd line apply only to control/hardware doms */ + if ( bd->capabilities & (BUILD_CAPS_CONTROL | BUILD_CAPS_HARDWARE) ) { - printk("ACPI is disabled, notifying Domain 0 (acpi=off)\n"); - safe_strcpy(acpi_param, "off"); + if ( bi->kextra ) + /* kextra always includes exactly one leading space. */ + strlcat(cmdline, bi->kextra, cmdline_size); + + /* Append any extra parameters. */ + if ( skip_ioapic_setup && !strstr(cmdline, "noapic") ) + strlcat(cmdline, " noapic", cmdline_size); + + if ( (strlen(acpi_param) == 0) && acpi_disabled ) + { + printk("ACPI is disabled, notifying Domain 0 (acpi=off)\n"); + safe_strcpy(acpi_param, "off"); + } + + if ( (strlen(acpi_param) != 0) && !strstr(cmdline, "acpi=") ) + { + strlcat(cmdline, " acpi=", cmdline_size); + strlcat(cmdline, acpi_param, cmdline_size); + } } - if ( (strlen(acpi_param) != 0) && !strstr(cmdline, "acpi=") ) - { - strlcat(cmdline, " acpi=", cmdline_size); - strlcat(cmdline, acpi_param, cmdline_size); - } bd->kernel->cmdline_pa = 0; bd->cmdline = cmdline; } -- 2.30.2
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |