@@ -51,7 +51,7 @@ define(`create_domain_common', `
getaffinity setaffinity setvcpuextstate };
allow $1 $2:domain2 { set_cpuid settsc setscheduler setclaim
set_max_evtchn set_vnumainfo get_vnumainfo cacheflush
- psr_cmt_op configure_domain };
+ psr_cmt_op };
allow $1 $2:security check_context;
allow $1 $2:shadow enable;
allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op updatemp };
@@ -477,18 +477,20 @@ typedef union
} start_info_any_t;
#endif
+
+typedef struct xen_arch_domainconfig xc_domain_configuration_t;
+int xc_domain_create_config(xc_interface *xch,
+ uint32_t ssidref,
+ xen_domain_handle_t handle,
+ uint32_t flags,
+ uint32_t *pdomid,
+ xc_domain_configuration_t *config);
int xc_domain_create(xc_interface *xch,
uint32_t ssidref,
xen_domain_handle_t handle,
uint32_t flags,
uint32_t *pdomid);
-#if defined(__arm__) || defined(__aarch64__)
-typedef xen_domctl_arm_configuredomain_t xc_domain_configuration_t;
-
-int xc_domain_configure(xc_interface *xch, uint32_t domid,
- xc_domain_configuration_t *config);
-#endif
/* Functions to produce a dump of a given domain
* xc_domain_dumpcore - produces a dump to a specified file
@@ -27,11 +27,12 @@
#include <xen/memory.h>
#include <xen/hvm/hvm_op.h>
-int xc_domain_create(xc_interface *xch,
- uint32_t ssidref,
- xen_domain_handle_t handle,
- uint32_t flags,
- uint32_t *pdomid)
+int xc_domain_create_config(xc_interface *xch,
+ uint32_t ssidref,
+ xen_domain_handle_t handle,
+ uint32_t flags,
+ uint32_t *pdomid,
+ xc_domain_configuration_t *config)
{
int err;
DECLARE_DOMCTL;
@@ -41,32 +42,39 @@ int xc_domain_create(xc_interface *xch,
domctl.u.createdomain.ssidref = ssidref;
domctl.u.createdomain.flags = flags;
memcpy(domctl.u.createdomain.handle, handle, sizeof(xen_domain_handle_t));
+ /* xc_domain_configure_t is an alias of arch_domainconfig_t */
+ memcpy(&domctl.u.createdomain.config, config, sizeof(*config));
if ( (err = do_domctl(xch, &domctl)) != 0 )
return err;
*pdomid = (uint16_t)domctl.domain;
+ memcpy(config, &domctl.u.createdomain.config, sizeof(*config));
+
return 0;
}
-#if defined(__arm__) || defined(__aarch64__)
-int xc_domain_configure(xc_interface *xch, uint32_t domid,
- xc_domain_configuration_t *config)
+int xc_domain_create(xc_interface *xch,
+ uint32_t ssidref,
+ xen_domain_handle_t handle,
+ uint32_t flags,
+ uint32_t *pdomid)
{
- int rc;
- DECLARE_DOMCTL;
+ xc_domain_configuration_t config;
- domctl.cmd = XEN_DOMCTL_arm_configure_domain;
- domctl.domain = (domid_t)domid;
- /* xc_domain_configure_t is an alias of xen_domctl_arm_configuredomain */
- memcpy(&domctl.u.configuredomain, config, sizeof(*config));
+ memset(&config, 0, sizeof(config));
- rc = do_domctl(xch, &domctl);
- if ( !rc )
- memcpy(config, &domctl.u.configuredomain, sizeof(*config));
+#if defined (__i386) || defined(__x86_64__)
+ /* No arch-specific configuration for now */
+#elif defined (__arm__) || defined(__aarch64__)
+ config.gic_version = XEN_DOMCTL_CONFIG_GIC_DEFAULT;
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
- return rc;
+ return xc_domain_create_config(xch, ssidref, handle,
+ flags, pdomid, &config);
}
-#endif
int xc_domain_cacheflush(xc_interface *xch, uint32_t domid,
xen_pfn_t start_pfn, xen_pfn_t nr_pfns)
@@ -15,6 +15,11 @@
#ifndef LIBXL_ARCH_H
#define LIBXL_ARCH_H
+/* fill the arch specific configuration for the domain */
+int libxl__arch_domain_prepare_config(libxl__gc *gc,
+ libxl_domain_config *d_config,
+ xc_domain_configuration_t *xc_config);
+
/* arch specific internal domain creation function */
int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
uint32_t domid);
@@ -22,6 +27,7 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
/* setup arch specific hardware description, i.e. DTB on ARM */
int libxl__arch_domain_init_hw_description(libxl__gc *gc,
libxl_domain_build_info *info,
+ libxl__domain_build_state *state,
struct xc_dom_image *dom);
/* finalize arch specific hardware description. */
int libxl__arch_domain_finalise_hw_description(libxl__gc *gc,
@@ -35,6 +35,15 @@ static const char *gicv_to_string(uint8_t gic_version)
}
}
+int libxl__arch_domain_prepare_config(libxl__gc *gc,
+ libxl_domain_config *d_config,
+ xc_domain_configuration_t *xc_config)
+{
+ xc_config->gic_version = XEN_DOMCTL_CONFIG_GIC_DEFAULT;
+
+ return 0;
+}
+
int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
uint32_t domid)
{
@@ -516,9 +525,9 @@ out:
int libxl__arch_domain_init_hw_description(libxl__gc *gc,
libxl_domain_build_info *info,
+ libxl__domain_build_state *state,
struct xc_dom_image *dom)
{
- xc_domain_configuration_t config;
void *fdt = NULL;
int rc, res;
size_t fdt_size = 0;
@@ -526,6 +535,9 @@ int libxl__arch_domain_init_hw_description(libxl__gc *gc,
const libxl_version_info *vers;
const struct arch_info *ainfo;
+ /* convenience aliases */
+ xc_domain_configuration_t *xc_config = &state->config;
+
assert(info->type == LIBXL_DOMAIN_TYPE_PV);
vers = libxl_get_version_info(CTX);
@@ -534,16 +546,9 @@ int libxl__arch_domain_init_hw_description(libxl__gc *gc,
ainfo = get_arch_info(gc, dom);
if (ainfo == NULL) return ERROR_FAIL;
- LOG(DEBUG, "configure the domain");
- config.gic_version = XEN_DOMCTL_CONFIG_GIC_DEFAULT;
- if (xc_domain_configure(CTX->xch, dom->guest_domid, &config) != 0) {
- LOG(ERROR, "couldn't configure the domain");
- return ERROR_FAIL;
- }
-
LOG(DEBUG, "constructing DTB for Xen version %d.%d guest",
vers->xen_version_major, vers->xen_version_minor);
- LOG(DEBUG, " - vGIC version: %s", gicv_to_string(config.gic_version));
+ LOG(DEBUG, " - vGIC version: %s\n", gicv_to_string(xc_config->gic_version));
/*
* Call "call" handling FDT_ERR_*. Will either:
@@ -592,7 +597,7 @@ next_resize:
FDT( make_memory_nodes(gc, fdt, dom) );
- switch (config.gic_version) {
+ switch (xc_config->gic_version) {
case XEN_DOMCTL_CONFIG_GIC_V2:
FDT( make_gicv2_node(gc, fdt,
GUEST_GICD_BASE, GUEST_GICD_SIZE,
@@ -602,7 +607,8 @@ next_resize:
FDT( make_gicv3_node(gc, fdt) );
break;
default:
- LOG(ERROR, "Unknown GIC version %d", config.gic_version);
+ LOG(ERROR, "Unknown GIC version %s",
+ gicv_to_string(xc_config->gic_version));
rc = ERROR_FAIL;
goto out;
}
@@ -497,8 +497,8 @@ out:
return ret;
}
-int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
- uint32_t *domid)
+int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
+ uint32_t *domid, xc_domain_configuration_t *xc_config)
{
libxl_ctx *ctx = libxl__gc_owner(gc);
int flags, ret, rc, nb_vm;
@@ -511,6 +511,8 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
xen_domain_handle_t handle;
libxl_vminfo *vm_list;
+ /* convenience aliases */
+ libxl_domain_create_info *info = &d_config->c_info;
assert(!libxl_domid_valid_guest(*domid));
@@ -539,7 +541,16 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
/* Ultimately, handle is an array of 16 uint8_t, same as uuid */
libxl_uuid_copy(ctx, (libxl_uuid *)handle, &info->uuid);
- ret = xc_domain_create(ctx->xch, info->ssidref, handle, flags, domid);
+ ret = libxl__arch_domain_prepare_config(gc, d_config, xc_config);
+ if (ret < 0) {
+ LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "fail to get domain config");
+ rc = ERROR_FAIL;
+ goto out;
+ }
+
+ ret = xc_domain_create_config(ctx->xch, info->ssidref,
+ handle, flags, domid,
+ xc_config);
if (ret < 0) {
LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "domain creation fail");
rc = ERROR_FAIL;
@@ -772,6 +783,7 @@ static void initiate_domain_create(libxl__egc *egc,
/* convenience aliases */
libxl_domain_config *const d_config = dcs->guest_config;
+ libxl__domain_build_state *const state = &dcs->build_state;
const int restore_fd = dcs->restore_fd;
memset(&dcs->build_state, 0, sizeof(dcs->build_state));
@@ -865,7 +877,7 @@ static void initiate_domain_create(libxl__egc *egc,
ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
if (ret) goto error_out;
- ret = libxl__domain_make(gc, &d_config->c_info, &domid);
+ ret = libxl__domain_make(gc, d_config, &domid, &state->config);
if (ret) {
LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
dcs->guest_domid = domid;
@@ -1089,7 +1089,8 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
stubdom_state->pv_ramdisk.path = "";
/* fixme: this function can leak the stubdom if it fails */
- ret = libxl__domain_make(gc, &dm_config->c_info, &sdss->pvqemu.guest_domid);
+ ret = libxl__domain_make(gc, dm_config, &sdss->pvqemu.guest_domid,
+ &stubdom_state->config);
if (ret)
goto out;
uint32_t dm_domid = sdss->pvqemu.guest_domid;
@@ -663,7 +663,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
LOGE(ERROR, "xc_dom_parse_image failed");
goto out;
}
- if ( (ret = libxl__arch_domain_init_hw_description(gc, info, dom)) != 0 ) {
+ if ( (ret = libxl__arch_domain_init_hw_description(gc, info, state, dom)) != 0 ) {
LOGE(ERROR, "libxl__arch_domain_init_hw_description failed");
goto out;
}
@@ -992,6 +992,8 @@ typedef struct {
xen_vmemrange_t *vmemranges;
uint32_t num_vmemranges;
+
+ xc_domain_configuration_t config;
} libxl__domain_build_state;
_hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid,
@@ -1481,8 +1483,9 @@ _hidden void libxl__exec(libxl__gc *gc, int stdinfd, int stdoutfd,
/* on entry, libxl_domid_valid_guest(domid) must be false;
* on exit (even error exit), domid may be valid and refer to a domain */
_hidden int libxl__domain_make(libxl__gc *gc,
- libxl_domain_create_info *info,
- uint32_t *domid);
+ libxl_domain_config *d_config,
+ uint32_t *domid,
+ xc_domain_configuration_t *xc_config);
_hidden int libxl__domain_build(libxl__gc *gc,
libxl_domain_config *d_config,
@@ -1,6 +1,15 @@
#include "libxl_internal.h"
#include "libxl_arch.h"
+int libxl__arch_domain_prepare_config(libxl__gc *gc,
+ libxl_domain_config *d_config,
+ xc_domain_configuration_t *xc_config)
+{
+ /* No specific configuration right now */
+
+ return 0;
+}
+
static const char *e820_names(int type)
{
switch (type) {
@@ -327,6 +336,7 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
int libxl__arch_domain_init_hw_description(libxl__gc *gc,
libxl_domain_build_info *info,
+ libxl__domain_build_state *state,
struct xc_dom_image *dom)
{
return 0;
@@ -503,9 +503,11 @@ void vcpu_destroy(struct vcpu *v)
free_xenheap_pages(v->arch.stack, STACK_ORDER);
}
-int arch_domain_create(struct domain *d, unsigned int domcr_flags)
+int arch_domain_create(struct domain *d, unsigned int domcr_flags,
+ struct xen_arch_domainconfig *config)
{
int rc;
+ uint8_t gic_version;
d->arch.relmem = RELMEM_not_started;
@@ -513,6 +515,7 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
if ( is_idle_domain(d) )
return 0;
+ ASSERT(config != NULL);
if ( (rc = p2m_init(d)) != 0 )
goto fail;
@@ -533,6 +536,29 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
if ( (rc = p2m_alloc_table(d)) != 0 )
goto fail;
+ /*
+ * Currently the vGIC is emulating the same version of the
+ * hardware GIC. Only the value XEN_DOMCTL_CONFIG_GIC_DEFAULT
+ * is allowed. The DOMCTL will return the actual version of the
+ * GIC.
+ */
+ rc = -EOPNOTSUPP;
+ if ( config->gic_version != XEN_DOMCTL_CONFIG_GIC_DEFAULT )
+ goto fail;
+
+ switch ( gic_hw_version() )
+ {
+ case GIC_V3:
+ gic_version = XEN_DOMCTL_CONFIG_GIC_V3;
+ break;
+ case GIC_V2:
+ gic_version = XEN_DOMCTL_CONFIG_GIC_V2;
+ break;
+ default:
+ BUG();
+ }
+ config->gic_version = gic_version;
+
if ( (rc = gicv_setup(d)) != 0 )
goto fail;
@@ -10,8 +10,6 @@
#include <xen/errno.h>
#include <xen/sched.h>
#include <xen/hypercall.h>
-#include <asm/gic.h>
-#include <xen/guest_access.h>
#include <public/domctl.h>
long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
@@ -32,40 +30,6 @@ long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
return p2m_cache_flush(d, s, e);
}
- case XEN_DOMCTL_arm_configure_domain:
- {
- uint8_t gic_version;
-
- /*
- * Currently the vGIC is emulating the same version of the
- * hardware GIC. Only the value XEN_DOMCTL_CONFIG_GIC_DEFAULT
- * is allowed. The DOMCTL will return the actual version of the
- * GIC.
- */
- if ( domctl->u.configuredomain.gic_version != XEN_DOMCTL_CONFIG_GIC_DEFAULT )
- return -EOPNOTSUPP;
-
- switch ( gic_hw_version() )
- {
- case GIC_V3:
- gic_version = XEN_DOMCTL_CONFIG_GIC_V3;
- break;
- case GIC_V2:
- gic_version = XEN_DOMCTL_CONFIG_GIC_V2;
- break;
- default:
- BUG();
- }
-
- domctl->u.configuredomain.gic_version = gic_version;
-
- /* TODO: Make the copy generic for all ARCH domctl */
- if ( __copy_to_guest(u_domctl, domctl, 1) )
- return -EFAULT;
-
- return 0;
- }
-
default:
return subarch_do_domctl(domctl, d, u_domctl);
}
@@ -399,7 +399,7 @@ void __init arch_init_memory(void)
* 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, DOMCRF_dummy, 0);
+ dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0, NULL);
BUG_ON(IS_ERR(dom_xen));
/*
@@ -407,14 +407,14 @@ void __init arch_init_memory(void)
* 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, DOMCRF_dummy, 0);
+ dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0, NULL);
BUG_ON(IS_ERR(dom_io));
/*
* Initialise our COW domain.
* This domain owns sharable pages.
*/
- dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
+ dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0, NULL);
BUG_ON(IS_ERR(dom_cow));
}
@@ -710,6 +710,7 @@ void __init start_xen(unsigned long boot_phys_offset,
const char *cmdline;
struct bootmodule *xen_bootmodule;
struct domain *dom0;
+ struct xen_arch_domainconfig config;
setup_cache();
@@ -827,7 +828,10 @@ void __init start_xen(unsigned long boot_phys_offset,
do_initcalls();
/* Create initial domain 0. */
- dom0 = domain_create(0, 0, 0);
+ /* The vGIC for DOM0 is exactly emulated the hardware GIC */
+ config.gic_version = XEN_DOMCTL_CONFIG_GIC_DEFAULT;
+
+ dom0 = domain_create(0, 0, 0, &config);
if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
panic("Error creating domain 0");
@@ -507,7 +507,8 @@ void vcpu_destroy(struct vcpu *v)
xfree(v->arch.pv_vcpu.trap_ctxt);
}
-int arch_domain_create(struct domain *d, unsigned int domcr_flags)
+int arch_domain_create(struct domain *d, unsigned int domcr_flags,
+ struct xen_arch_domainconfig *config)
{
int i, paging_initialised = 0;
int rc = -ENOMEM;
@@ -275,7 +275,7 @@ void __init arch_init_memory(void)
* Hidden PCI devices will also be associated with this domain
* (but be [partly] controlled by Dom0 nevertheless).
*/
- dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
+ dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0, NULL);
BUG_ON(IS_ERR(dom_xen));
INIT_LIST_HEAD(&dom_xen->arch.pdev_list);
@@ -284,14 +284,14 @@ void __init arch_init_memory(void)
* 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, DOMCRF_dummy, 0);
+ dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0, NULL);
BUG_ON(IS_ERR(dom_io));
/*
* Initialise our COW domain.
* This domain owns sharable pages.
*/
- dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
+ dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0, NULL);
BUG_ON(IS_ERR(dom_cow));
/* First 1MB of RAM is historically marked as I/O. */
@@ -1360,8 +1360,12 @@ void __init noreturn __start_xen(unsigned long mbi_p)
if ( opt_dom0pvh )
domcr_flags |= DOMCRF_pvh | DOMCRF_hap;
- /* Create initial domain 0. */
- dom0 = domain_create(0, domcr_flags, 0);
+ /*
+ * Create initial domain 0.
+ * x86 doesn't support arch-configuration. So it's fine to pass
+ * NULL.
+ */
+ dom0 = domain_create(0, domcr_flags, 0, NULL);
if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
panic("Error creating domain 0");
@@ -242,8 +242,9 @@ static void __init parse_extra_guest_irqs(const char *s)
}
custom_param("extra_guest_irqs", parse_extra_guest_irqs);
-struct domain *domain_create(
- domid_t domid, unsigned int domcr_flags, uint32_t ssidref)
+struct domain *domain_create(domid_t domid, unsigned int domcr_flags,
+ uint32_t ssidref,
+ struct xen_arch_domainconfig *config)
{
struct domain *d, **pd, *old_hwdom = NULL;
enum { INIT_xsm = 1u<<0, INIT_watchdog = 1u<<1, INIT_rangeset = 1u<<2,
@@ -353,7 +354,7 @@ struct domain *domain_create(
goto fail;
}
- if ( (err = arch_domain_create(d, domcr_flags)) != 0 )
+ if ( (err = arch_domain_create(d, domcr_flags, config)) != 0 )
goto fail;
init_status |= INIT_arch;
@@ -589,7 +589,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_oos_off )
domcr_flags |= DOMCRF_oos_off;
- d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref);
+ d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref,
+ &op->u.createdomain.config);
if ( IS_ERR(d) )
{
ret = PTR_ERR(d);
@@ -1419,7 +1419,8 @@ void __init scheduler_init(void)
sched_ratelimit_us = SCHED_DEFAULT_RATELIMIT_US;
}
- idle_domain = domain_create(DOMID_IDLE, 0, 0);
+ /* There is no need of arch-specific configuration for an idle domain */
+ idle_domain = domain_create(DOMID_IDLE, 0, 0, NULL);
BUG_ON(IS_ERR(idle_domain));
idle_domain->vcpu = idle_vcpu;
idle_domain->max_vcpus = nr_cpu_ids;
@@ -309,6 +309,14 @@ struct arch_shared_info {
typedef struct arch_shared_info arch_shared_info_t;
typedef uint64_t xen_callback_t;
+#define XEN_DOMCTL_CONFIG_GIC_DEFAULT 0
+#define XEN_DOMCTL_CONFIG_GIC_V2 1
+#define XEN_DOMCTL_CONFIG_GIC_V3 2
+struct xen_arch_domainconfig {
+ /* IN/OUT */
+ uint8_t gic_version;
+};
+
#endif
#if defined(__XEN__) || defined(__XEN_TOOLS__)
@@ -262,6 +262,10 @@ struct arch_shared_info {
};
typedef struct arch_shared_info arch_shared_info_t;
+struct xen_arch_domainconfig {
+ char dummy;
+};
+
#endif /* !__ASSEMBLY__ */
/*
@@ -64,23 +64,11 @@ struct xen_domctl_createdomain {
#define _XEN_DOMCTL_CDF_pvh_guest 4
#define XEN_DOMCTL_CDF_pvh_guest (1U<<_XEN_DOMCTL_CDF_pvh_guest)
uint32_t flags;
+ struct xen_arch_domainconfig config;
};
typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t);
-#if defined(__arm__) || defined(__aarch64__)
-#define XEN_DOMCTL_CONFIG_GIC_DEFAULT 0
-#define XEN_DOMCTL_CONFIG_GIC_V2 1
-#define XEN_DOMCTL_CONFIG_GIC_V3 2
-/* XEN_DOMCTL_configure_domain */
-struct xen_domctl_arm_configuredomain {
- /* IN/OUT parameters */
- uint8_t gic_version;
-};
-typedef struct xen_domctl_arm_configuredomain xen_domctl_arm_configuredomain_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_arm_configuredomain_t);
-#endif
-
/* XEN_DOMCTL_getdomaininfo */
struct xen_domctl_getdomaininfo {
/* OUT variables. */
@@ -1079,7 +1067,6 @@ struct xen_domctl {
#define XEN_DOMCTL_set_vcpu_msrs 73
#define XEN_DOMCTL_setvnumainfo 74
#define XEN_DOMCTL_psr_cmt_op 75
-#define XEN_DOMCTL_arm_configure_domain 76
#define XEN_DOMCTL_gdbsx_guestmemio 1000
#define XEN_DOMCTL_gdbsx_pausevcpu 1001
#define XEN_DOMCTL_gdbsx_unpausevcpu 1002
@@ -1088,9 +1075,6 @@ struct xen_domctl {
domid_t domain;
union {
struct xen_domctl_createdomain createdomain;
-#if defined(__arm__) || defined(__aarch64__)
- struct xen_domctl_arm_configuredomain configuredomain;
-#endif
struct xen_domctl_getdomaininfo getdomaininfo;
struct xen_domctl_getmemlist getmemlist;
struct xen_domctl_getpageframeinfo getpageframeinfo;
@@ -56,7 +56,8 @@ void vcpu_destroy(struct vcpu *v);
int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset);
void unmap_vcpu_info(struct vcpu *v);
-int arch_domain_create(struct domain *d, unsigned int domcr_flags);
+int arch_domain_create(struct domain *d, unsigned int domcr_flags,
+ struct xen_arch_domainconfig *config);
void arch_domain_destroy(struct domain *d);
@@ -525,8 +525,13 @@ static inline void get_knownalive_domain(struct domain *d)
int domain_set_node_affinity(struct domain *d, const nodemask_t *affinity);
void domain_update_node_affinity(struct domain *d);
-struct domain *domain_create(
- domid_t domid, unsigned int domcr_flags, uint32_t ssidref);
+/*
+ * Create a domain: the configuration is only necessary for real domain
+ * (i.e !DOMCRF_dummy, excluded idle domain).
+ */
+struct domain *domain_create(domid_t domid, unsigned int domcr_flags,
+ uint32_t ssidref,
+ struct xen_arch_domainconfig *config);
/* DOMCRF_hvm: Create an HVM domain, as opposed to a PV domain. */
#define _DOMCRF_hvm 0
#define DOMCRF_hvm (1U<<_DOMCRF_hvm)
@@ -729,9 +729,6 @@ static int flask_domctl(struct domain *d, int cmd)
case XEN_DOMCTL_psr_cmt_op:
return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__PSR_CMT_OP);
- case XEN_DOMCTL_arm_configure_domain:
- return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__CONFIGURE_DOMAIN);
-
default:
printk("flask_domctl: Unknown op %d\n", cmd);
return -EPERM;
@@ -219,8 +219,6 @@ class domain2
get_vnumainfo
# XEN_DOMCTL_psr_cmt_op
psr_cmt_op
-# XEN_DOMCTL_configure_domain
- configure_domain
}
# Similar to class domain, but primarily contains domctls related to HVM domains