* Any Xen-heap pages that we will allow to be mapped will have
* their domain field set to dom_xen.
*/
- dom_xen = domain_create(DOMID_XEN, NULL);
+ dom_xen = domain_create(DOMID_XEN, NULL, false);
BUG_ON(IS_ERR(dom_xen));
/*
* This domain owns I/O pages that are within the range of the page_info
* array. Mappings occur at the priv of the caller.
*/
- dom_io = domain_create(DOMID_IO, NULL);
+ dom_io = domain_create(DOMID_IO, NULL, false);
BUG_ON(IS_ERR(dom_io));
/*
* Initialise our COW domain.
* This domain owns sharable pages.
*/
- dom_cow = domain_create(DOMID_COW, NULL);
+ dom_cow = domain_create(DOMID_COW, NULL, false);
BUG_ON(IS_ERR(dom_cow));
}
dom0_cfg.arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE;
dom0_cfg.arch.nr_spis = gic_number_lines() - 32;
- dom0 = domain_create(0, &dom0_cfg);
+ dom0 = domain_create(0, &dom0_cfg, true);
if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
panic("Error creating domain 0");
- dom0->is_privileged = 1;
- dom0->target = NULL;
-
if ( construct_dom0(dom0) != 0)
panic("Could not set up DOM0 guest OS");
* Hidden PCI devices will also be associated with this domain
* (but be [partly] controlled by Dom0 nevertheless).
*/
- dom_xen = domain_create(DOMID_XEN, NULL);
+ dom_xen = domain_create(DOMID_XEN, NULL, false);
BUG_ON(IS_ERR(dom_xen));
INIT_LIST_HEAD(&dom_xen->arch.pdev_list);
* This domain owns I/O pages that are within the range of the page_info
* array. Mappings occur at the priv of the caller.
*/
- dom_io = domain_create(DOMID_IO, NULL);
+ dom_io = domain_create(DOMID_IO, NULL, false);
BUG_ON(IS_ERR(dom_io));
/*
* Initialise our COW domain.
* This domain owns sharable pages.
*/
- dom_cow = domain_create(DOMID_COW, NULL);
+ dom_cow = domain_create(DOMID_COW, NULL, false);
BUG_ON(IS_ERR(dom_cow));
/*
}
/* Create initial domain 0. */
- dom0 = domain_create(get_initial_domain_id(), &dom0_cfg);
+ dom0 = domain_create(get_initial_domain_id(), &dom0_cfg, !pv_shim);
if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
panic("Error creating domain 0");
- if ( !pv_shim )
- dom0->is_privileged = 1;
- dom0->target = NULL;
-
/* Grab the DOM0 command line. */
cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL);
if ( (cmdline != NULL) || (kextra != NULL) )
custom_param("extra_guest_irqs", parse_extra_guest_irqs);
struct domain *domain_create(domid_t domid,
- struct xen_domctl_createdomain *config)
+ struct xen_domctl_createdomain *config,
+ bool is_priv)
{
struct domain *d, **pd, *old_hwdom = NULL;
enum { INIT_xsm = 1u<<0, INIT_watchdog = 1u<<1, INIT_rangeset = 1u<<2,
return ERR_PTR(-ENOMEM);
d->domain_id = domid;
+ d->is_privileged = is_priv;
/* Debug sanity. */
ASSERT(is_system_domain(d) ? config == NULL : config != NULL);
rover = dom;
}
- d = domain_create(dom, &op->u.createdomain);
+ d = domain_create(dom, &op->u.createdomain, false);
if ( IS_ERR(d) )
{
ret = PTR_ERR(d);
sched_ratelimit_us = SCHED_DEFAULT_RATELIMIT_US;
}
- idle_domain = domain_create(DOMID_IDLE, NULL);
+ idle_domain = domain_create(DOMID_IDLE, NULL, false);
BUG_ON(IS_ERR(idle_domain));
idle_domain->vcpu = idle_vcpu;
idle_domain->max_vcpus = nr_cpu_ids;
* (domid < DOMID_FIRST_RESERVED).
*/
struct domain *domain_create(domid_t domid,
- struct xen_domctl_createdomain *config);
+ struct xen_domctl_createdomain *config,
+ bool is_priv);
/*
* rcu_lock_domain_by_id() is more efficient than get_domain_by_id().