@@ -680,17 +680,17 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
LOG(DETAIL, "altp2m: %s", libxl_altp2m_mode_to_string(b_info->altp2m));
switch(b_info->altp2m) {
case LIBXL_ALTP2M_MODE_MIXED:
- create.altp2m_opts |=
+ create.altp2m.opts |=
XEN_DOMCTL_ALTP2M_mode(XEN_DOMCTL_ALTP2M_mixed);
break;
case LIBXL_ALTP2M_MODE_EXTERNAL:
- create.altp2m_opts |=
+ create.altp2m.opts |=
XEN_DOMCTL_ALTP2M_mode(XEN_DOMCTL_ALTP2M_external);
break;
case LIBXL_ALTP2M_MODE_LIMITED:
- create.altp2m_opts |=
+ create.altp2m.opts |=
XEN_DOMCTL_ALTP2M_mode(XEN_DOMCTL_ALTP2M_limited);
break;
@@ -231,7 +231,9 @@ CAMLprim value stub_xc_domain_create(value xch_val, value wanted_domid, value co
.max_maptrack_frames = Int_val(VAL_MAX_MAPTRACK_FRAMES),
.grant_opts =
XEN_DOMCTL_GRANT_version(Int_val(VAL_MAX_GRANT_VERSION)),
- .altp2m_opts = Int32_val(VAL_ALTP2M_OPTS),
+ .altp2m = {
+ .opts = Int32_val(VAL_ALTP2M_OPTS),
+ },
.vmtrace_size = vmtrace_size,
.cpupool_id = Int32_val(VAL_CPUPOOL_ID),
};
@@ -688,7 +688,7 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
return -EINVAL;
}
- if ( config->altp2m_opts )
+ if ( config->altp2m.opts )
{
dprintk(XENLOG_INFO, "Altp2m not supported\n");
return -EINVAL;
@@ -637,7 +637,7 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
bool hap = config->flags & XEN_DOMCTL_CDF_hap;
bool nested_virt = config->flags & XEN_DOMCTL_CDF_nested_virt;
unsigned int max_vcpus;
- unsigned int altp2m_mode = MASK_EXTR(config->altp2m_opts,
+ unsigned int altp2m_mode = MASK_EXTR(config->altp2m.opts,
XEN_DOMCTL_ALTP2M_mode_mask);
if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) )
@@ -717,7 +717,7 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
return -EINVAL;
}
- if ( config->altp2m_opts & ~XEN_DOMCTL_ALTP2M_mode_mask )
+ if ( config->altp2m.opts & ~XEN_DOMCTL_ALTP2M_mode_mask )
{
dprintk(XENLOG_INFO, "Invalid altp2m options selected: %#x\n",
config->flags);
@@ -659,7 +659,7 @@ int hvm_domain_initialise(struct domain *d,
d->arch.hvm.params[HVM_PARAM_TRIPLE_FAULT_REASON] = SHUTDOWN_reboot;
/* Set altp2m based on domctl flags. */
- switch ( MASK_EXTR(config->altp2m_opts, XEN_DOMCTL_ALTP2M_mode_mask) )
+ switch ( MASK_EXTR(config->altp2m.opts, XEN_DOMCTL_ALTP2M_mode_mask) )
{
case XEN_DOMCTL_ALTP2M_mixed:
d->arch.hvm.params[HVM_PARAM_ALTP2M] = XEN_ALTP2M_mixed;
@@ -86,6 +86,7 @@ struct xen_domctl_createdomain {
uint32_t grant_opts;
+ struct {
/*
* Enable altp2m mixed mode.
*
@@ -102,7 +103,8 @@ struct xen_domctl_createdomain {
/* Altp2m mode signaling uses bits [0, 1]. */
#define XEN_DOMCTL_ALTP2M_mode_mask (0x3U)
#define XEN_DOMCTL_ALTP2M_mode(m) ((m) & XEN_DOMCTL_ALTP2M_mode_mask)
- uint32_t altp2m_opts;
+ uint32_t opts;
+ } altp2m;
/* Per-vCPU buffer size in bytes. 0 to disable. */
uint32_t vmtrace_size;