Received: from eggs.gnu.org ([2001:4830:134:3::10]:49014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpsma-0002Ij-Gi for qemu-devel@nongnu.org; Fri, 30 Sep 2016 04:03:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpsmW-0005Rq-Dz for qemu-devel@nongnu.org; Fri, 30 Sep 2016 04:02:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpsmW-0005Rb-5m for qemu-devel@nongnu.org; Fri, 30 Sep 2016 04:02:56 -0400 References: <1475183699-11646-1-git-send-email-ehabkost@redhat.com> <1475183699-11646-12-git-send-email-ehabkost@redhat.com> From: Paolo Bonzini Message-ID: <1740881e-a66b-4a5d-602d-b197a53cd798@redhat.com> Date: Fri, 30 Sep 2016 10:02:49 +0200 MIME-Version: 1.0 In-Reply-To: <1475183699-11646-12-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 11/11] target-i386: Return runnability information on query-cpu-definitions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: dahi@linux.vnet.ibm.com, Igor Mammedov , Jiri Denemark , Markus Armbruster , Richard Henderson , libvir-list@redhat.com 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