Received: from eggs.gnu.org ([2001:4830:134:3::10]:34011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpy3g-0007AM-9t for qemu-devel@nongnu.org; Fri, 30 Sep 2016 09:41:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpy3d-0006k6-6V for qemu-devel@nongnu.org; Fri, 30 Sep 2016 09:41:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpy3c-0006jk-W1 for qemu-devel@nongnu.org; Fri, 30 Sep 2016 09:40:57 -0400 Date: Fri, 30 Sep 2016 10:40:54 -0300 From: Eduardo Habkost Message-ID: <20160930134054.GV3877@thinpad.lan.raisama.net> References: <1475183699-11646-1-git-send-email-ehabkost@redhat.com> <1475183699-11646-12-git-send-email-ehabkost@redhat.com> <1740881e-a66b-4a5d-602d-b197a53cd798@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1740881e-a66b-4a5d-602d-b197a53cd798@redhat.com> 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: Paolo Bonzini Cc: qemu-devel@nongnu.org, dahi@linux.vnet.ibm.com, Igor Mammedov , Jiri Denemark , Markus Armbruster , Richard Henderson , libvir-list@redhat.com On Fri, Sep 30, 2016 at 10:02:49AM +0200, Paolo Bonzini wrote: > 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? It can. I will do it in a follow-up patch. -- Eduardo