}
int arch_domain_create(struct domain *d,
- struct xen_domctl_createdomain *config)
+ struct xen_domctl_createdomain *config,
+ struct xen_dom_flags *flags)
{
int rc, count = 0;
.max_grant_frames = 64,
.max_maptrack_frames = 1024,
};
+ struct xen_dom_flags flags = { false };
if ( !dt_device_is_compatible(node, "xen,domain") )
continue;
GUEST_VPL011_SPI - 32 + 1);
}
- d = domain_create(++max_init_domid, &d_cfg, false);
+ d = domain_create(++max_init_domid, &d_cfg, &flags);
if ( IS_ERR(d) )
panic("Error creating domain %s\n", dt_node_name(node));
.max_maptrack_frames = -1,
};
int rc;
+ struct xen_dom_flags flags = { true };
dcache_line_bytes = read_dcache_line_bytes();
if ( iommu_enabled )
dom0_cfg.flags |= XEN_DOMCTL_CDF_iommu;
- dom0 = domain_create(0, &dom0_cfg, true);
+ dom0 = domain_create(0, &dom0_cfg, &flags);
if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
panic("Error creating domain 0\n");
}
int arch_domain_create(struct domain *d,
- struct xen_domctl_createdomain *config)
+ struct xen_domctl_createdomain *config,
+ struct xen_dom_flags *flags)
{
bool paging_initialised = false;
uint32_t emflags;
.max_maptrack_frames = -1,
};
const char *hypervisor_name;
+ struct xen_dom_flags flags = { !pv_shim };
/* Critical region without IDT or TSS. Any fault is deadly! */
dom0_cfg.flags |= XEN_DOMCTL_CDF_iommu;
/* Create initial domain 0. */
- dom0 = domain_create(get_initial_domain_id(), &dom0_cfg, !pv_shim);
+ dom0 = domain_create(get_initial_domain_id(), &dom0_cfg, &flags);
if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
panic("Error creating domain 0\n");
struct domain *domain_create(domid_t domid,
struct xen_domctl_createdomain *config,
- bool is_priv)
+ struct xen_dom_flags *flags)
{
struct domain *d, **pd, *old_hwdom = NULL;
enum { INIT_watchdog = 1u<<1,
ASSERT(is_system_domain(d) ? config == NULL : config != NULL);
/* Sort out our idea of is_control_domain(). */
- d->is_privileged = is_priv;
+ d->is_privileged = flags ? flags->is_priv : false;
/* Sort out our idea of is_hardware_domain(). */
if ( domid == 0 || domid == hardware_domid )
radix_tree_init(&d->pirq_tree);
}
- if ( (err = arch_domain_create(d, config)) != 0 )
+ if ( (err = arch_domain_create(d, config, flags)) != 0 )
goto fail;
init_status |= INIT_arch;
void __init setup_system_domains(void)
{
+ struct xen_dom_flags flags = { false };
/*
* Initialise our DOMID_XEN domain.
* Any Xen-heap pages that we will allow to be mapped will have
* Hidden PCI devices will also be associated with this domain
* (but be [partly] controlled by Dom0 nevertheless).
*/
- dom_xen = domain_create(DOMID_XEN, NULL, false);
+ dom_xen = domain_create(DOMID_XEN, NULL, &flags);
if ( IS_ERR(dom_xen) )
panic("Failed to create d[XEN]: %ld\n", PTR_ERR(dom_xen));
* array. Mappings occur at the priv of the caller.
* Quarantined PCI devices will be associated with this domain.
*/
- dom_io = domain_create(DOMID_IO, NULL, false);
+ dom_io = domain_create(DOMID_IO, NULL, &flags);
if ( IS_ERR(dom_io) )
panic("Failed to create d[IO]: %ld\n", PTR_ERR(dom_io));
* Initialise our COW domain.
* This domain owns sharable pages.
*/
- dom_cow = domain_create(DOMID_COW, NULL, false);
+ dom_cow = domain_create(DOMID_COW, NULL, &flags);
if ( IS_ERR(dom_cow) )
panic("Failed to create d[COW]: %ld\n", PTR_ERR(dom_cow));
#endif
bool_t copyback = 0;
struct xen_domctl curop, *op = &curop;
struct domain *d;
+ struct xen_dom_flags flags ={ false };
if ( copy_from_guest(op, u_domctl, 1) )
return -EFAULT;
rover = dom;
}
- d = domain_create(dom, &op->u.createdomain, false);
+ d = domain_create(dom, &op->u.createdomain, &flags);
if ( IS_ERR(d) )
{
ret = PTR_ERR(d);
{
struct domain *idle_domain;
int i;
+ struct xen_dom_flags flags = { false };
scheduler_enable();
sched_ratelimit_us = SCHED_DEFAULT_RATELIMIT_US;
}
- idle_domain = domain_create(DOMID_IDLE, NULL, false);
+ idle_domain = domain_create(DOMID_IDLE, NULL, &flags);
BUG_ON(IS_ERR(idle_domain));
BUG_ON(nr_cpu_ids > ARRAY_SIZE(idle_vcpu));
idle_domain->vcpu = idle_vcpu;
int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset);
void unmap_vcpu_info(struct vcpu *v);
+struct xen_dom_flags {
+ bool is_priv;
+};
+
int arch_domain_create(struct domain *d,
- struct xen_domctl_createdomain *config);
+ struct xen_domctl_createdomain *config,
+ struct xen_dom_flags *flags);
void arch_domain_destroy(struct domain *d);
*/
struct domain *domain_create(domid_t domid,
struct xen_domctl_createdomain *config,
- bool is_priv);
+ struct xen_dom_flags *flags);
/*
* rcu_lock_domain_by_id() is more efficient than get_domain_by_id().