* cases, and the generated policy must be compatible with a 4.13.
*
* Either pass a full new @featureset (and @nr_features), or adjust individual
- * features (@pae, @itsc).
+ * features (@pae, @itsc, @nested_virt).
*
* Then (optionally) apply legacy XEND overrides (@xend) to the result.
*/
uint32_t domid, bool restore,
const uint32_t *featureset,
unsigned int nr_features, bool pae, bool itsc,
- const struct xc_xend_cpuid *xend);
+ bool nested_virt, const struct xc_xend_cpuid *xend);
int xc_mca_op(xc_interface *xch, struct xen_mc *mc);
int xc_mca_op_inject_v2(xc_interface *xch, unsigned int flags,
xc_cpumap_t cpumap, unsigned int nr_cpus);
int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
const uint32_t *featureset, unsigned int nr_features,
- bool pae, bool itsc,
+ bool pae, bool itsc, bool nested_virt,
const struct xc_xend_cpuid *xend)
{
int rc;
p->extd.itsc = itsc;
if ( di.hvm )
+ {
p->basic.pae = pae;
+ p->basic.vmx = nested_virt;
+ p->extd.svm = nested_virt;
+ }
}
if ( !di.hvm )
}
break;
}
-
- /*
- * These settings are necessary to cause earlier HVM_PARAM_NESTEDHVM
- * to be reflected correctly in CPUID. Xen will discard these bits if
- * configuration hasn't been set for the domain.
- */
- p->basic.vmx = true;
- p->extd.svm = true;
}
rc = x86_cpuid_copy_to_buffer(p, leaves, &nr_leaves);
{
bool pae = true;
bool itsc;
+ bool nested_virt = libxl_defbool_val(info->nested_hvm);
/*
* For PV guests, PAE is Xen-controlled (it is the 'p' that differentiates
info->tsc_mode == LIBXL_TSC_MODE_ALWAYS_EMULATE);
xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
- pae, itsc, info->cpuid);
+ pae, itsc, nested_virt, info->cpuid);
}
static const char *input_names[2] = { "leaf", "subleaf" };