mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
tools/libx[cl]: Merge xc_cpuid_set() into xc_cpuid_apply_policy()
This reduces the number of CPUID handling entry-points to just one. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Release-acked-by: Paul Durrant <paul@xen.org>
This commit is contained in:
1 parent
585c7f4317
commit
f79cd47cd7
3 files changed
+11
-14
No files matched your search
@@ -1819,20 +1819,19 @@ struct xc_xend_cpuid {
|
||||
char *policy[4];
|
||||
};
|
||||
|
||||
int xc_cpuid_set(xc_interface *xch,
|
||||
uint32_t domid,
|
||||
const struct xc_xend_cpuid *xend);
|
||||
|
||||
/*
|
||||
* Make adjustments to the CPUID settings for a domain.
|
||||
*
|
||||
* Either pass a full new @featureset (and @nr_features), or adjust individual
|
||||
* features (@pae).
|
||||
*
|
||||
* Then (optionally) apply legacy XEND overrides (@xend) to the result.
|
||||
*/
|
||||
int xc_cpuid_apply_policy(xc_interface *xch,
|
||||
uint32_t domid,
|
||||
const uint32_t *featureset,
|
||||
unsigned int nr_features, bool pae);
|
||||
unsigned int nr_features, bool pae,
|
||||
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);
|
||||
|
||||
@@ -280,7 +280,7 @@ static xen_cpuid_leaf_t *find_leaf(
|
||||
return bsearch(&key, leaves, nr_leaves, sizeof(*leaves), compare_leaves);
|
||||
}
|
||||
|
||||
int xc_cpuid_set(
|
||||
static int xc_cpuid_xend_policy(
|
||||
xc_interface *xch, uint32_t domid, const struct xc_xend_cpuid *xend)
|
||||
{
|
||||
int rc;
|
||||
@@ -427,7 +427,8 @@ int xc_cpuid_set(
|
||||
|
||||
int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid,
|
||||
const uint32_t *featureset, unsigned int nr_features,
|
||||
bool pae)
|
||||
bool pae,
|
||||
const struct xc_xend_cpuid *xend)
|
||||
{
|
||||
int rc;
|
||||
xc_dominfo_t di;
|
||||
@@ -637,6 +638,9 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ( xend && (rc = xc_cpuid_xend_policy(xch, domid, xend)) )
|
||||
goto out;
|
||||
|
||||
rc = 0;
|
||||
|
||||
out:
|
||||
|
||||
@@ -419,7 +419,6 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
|
||||
void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid,
|
||||
libxl_domain_build_info *info)
|
||||
{
|
||||
libxl_cpuid_policy_list cpuid = info->cpuid;
|
||||
bool pae = true;
|
||||
|
||||
/*
|
||||
@@ -435,12 +434,7 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid,
|
||||
if (info->type == LIBXL_DOMAIN_TYPE_HVM)
|
||||
pae = libxl_defbool_val(info->u.hvm.pae);
|
||||
|
||||
xc_cpuid_apply_policy(ctx->xch, domid, NULL, 0, pae);
|
||||
|
||||
if (!cpuid)
|
||||
return;
|
||||
|
||||
xc_cpuid_set(ctx->xch, domid, info->cpuid);
|
||||
xc_cpuid_apply_policy(ctx->xch, domid, NULL, 0, pae, info->cpuid);
|
||||
}
|
||||
|
||||
static const char *input_names[2] = { "leaf", "subleaf" };
|
||||
|
||||