From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGzCq-0006Td-Ed for qemu-devel@nongnu.org; Wed, 26 Sep 2012 17:31:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGzCk-0003w5-80 for qemu-devel@nongnu.org; Wed, 26 Sep 2012 17:31:44 -0400 Received: from terminus.zytor.com ([198.137.202.10]:58855 helo=mail.zytor.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGzCj-0003w0-VA for qemu-devel@nongnu.org; Wed, 26 Sep 2012 17:31:38 -0400 Message-ID: <5063742D.7070507@zytor.com> Date: Wed, 26 Sep 2012 14:31:25 -0700 From: "H. Peter Anvin" MIME-Version: 1.0 References: <1348691578-17231-1-git-send-email-imammedo@redhat.com> <1348691578-17231-8-git-send-email-imammedo@redhat.com> In-Reply-To: <1348691578-17231-8-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/22] target-i386: convert cpuid features into properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: aliguori@us.ibm.com, ehabkost@redhat.com, jan.kiszka@siemens.com, Don@CloudSwitch.com, mtosatti@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, blauwirbel@gmail.com, pbonzini@redhat.com, lersek@redhat.com, afaerber@suse.de, stefanha@linux.vnet.ibm.com On 09/26/2012 01:32 PM, Igor Mammedov wrote: > + > +static void x86_cpuid_get_feature(Object *obj, Visitor *v, void *opaque, > + const char *name, Error **errp) > +{ > + X86CPU *cpu = X86_CPU(obj); > + CPUX86State *env = &cpu->env; > + bool value = true; > + > + if (!is_feature_set(name, env->cpuid_features, feature_name) && > + !is_feature_set(name, env->cpuid_ext_features, ext_feature_name) && > + !is_feature_set(name, env->cpuid_ext2_features, ext2_feature_name) && > + !is_feature_set(name, env->cpuid_ext3_features, ext3_feature_name) && > + !is_feature_set(name, env->cpuid_kvm_features, kvm_feature_name) && > + !is_feature_set(name, env->cpuid_svm_features, svm_feature_name)) { > + value = false; > + } > + If you're going to do a full-blown restructuring of the CPUID handling, how about actually turning this into a composite object, specifically an array, instead of this insane collection of arguments (which needs to be augmented)? -hpa