[libvirt] [PATCH v4 11/11] target-i386: Return runnability information on query-cpu-definitions
Paolo Bonzini
pbonzini at redhat.com
Fri Sep 30 08:02:49 UTC 2016
On 29/09/2016 23:14, Eduardo Habkost wrote:
> +/* Return the feature property name for a feature flag bit */
> +static const char *x86_cpu_feature_name(FeatureWord w, int bitnr)
> +{
> + /* XSAVE components are automatically enabled by other features,
> + * so return the original feature name instead
> + */
> + if (w == FEAT_XSAVE_COMP_LO || w == FEAT_XSAVE_COMP_HI) {
> + int comp = (w == FEAT_XSAVE_COMP_HI) ? bitnr + 32 : bitnr;
> +
> + if (comp < ARRAY_SIZE(x86_ext_save_areas) &&
> + x86_ext_save_areas[comp].bits) {
> + w = x86_ext_save_areas[comp].feature;
> + bitnr = ctz32(x86_ext_save_areas[comp].bits);
> + }
> + }
> +
> + assert(bitnr < 32);
> + assert(w < FEATURE_WORDS);
> + return feature_word_info[w].feat_names[bitnr];
> +}
> +
Could this be used to replace migratable_features?
Paolo
More information about the libvir-list
mailing list