From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB3eH-0006cq-7x for qemu-devel@nongnu.org; Wed, 05 Feb 2014 09:40:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WB3eC-0005VK-Pg for qemu-devel@nongnu.org; Wed, 05 Feb 2014 09:40:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB3eC-0005Uw-I9 for qemu-devel@nongnu.org; Wed, 05 Feb 2014 09:40:16 -0500 Date: Wed, 5 Feb 2014 15:40:07 +0100 From: Igor Mammedov Message-ID: <20140205154007.4886f3e3@thinkpad> In-Reply-To: <52AE3247.5000303@suse.de> References: <1385591336-2755-1-git-send-email-imammedo@redhat.com> <52AE3247.5000303@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu 00/16 v10] target-i386: convert CPU features into properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?ISO-8859-1?B?RuRyYmVy?= Cc: qemu-devel@nongnu.org, Anthony Liguori , Eduardo Habkost On Sun, 15 Dec 2013 23:50:47 +0100 Andreas F=E4rber wrote: > Am 27.11.2013 23:28, schrieb Igor Mammedov: > > Igor Mammedov (16): > > target-i386: cleanup 'foo' feature handling' > > target-i386: cleanup 'foo=3Dval' feature handling >=20 > Thanks, I've queued these on qom-cpu-next: > https://github.com/afaerber/qemu-cpu/commits/qom-cpu-next >=20 > > target-i386: cpu: convert 'level' to static property > > target-i386: cpu: convert 'xlevel' to static property > > target-i386: cpu: convert 'family' to static property > > target-i386: cpu: convert 'model' to static property > > target-i386: cpu: convert 'stepping' to static property > > target-i386: cpu: convert 'vendor' to static property > > target-i386: cpu: convert 'model-id' to static property > > target-i386: cpu: convert 'tsc-frequency' to static property >=20 > But I still don't see the utility of this conversion after all the > discussions we've had... :( It seems there is movement to make DEVICE self describing for purpose of QAPI schema introspection, where static properties would be used (dynamic ones are not suitable for this purpose) > The below patches seem to only operate on > CPUID bits, which get added as properties in the following patch. >=20 > > target-i386: set [+-]feature using static properties > > qdev: introduce qdev_prop_find_bit() > > target-i386: use static properties in check_features_against_host() to > > print CPUID feature names > > target-i386: use static properties to list CPUID features >=20 > I am reading too many occurrences of "static properties" above that > should IMO just be "properties". You got permission to use a name-based > scheme to iterate over feat-* properties, so why are you still iterating > over static properties with a helper searching for offsets rather than > QOM properties with feat- prefix? Either we need that scheme for Ok, I'll use feat- prefix, there is not real need for iterating over array when listing properties. > automated processing as I understood you, then we should be consequent > in using it, or we don't. And I would prefer to keep these mappings in > x86 code rather than messing in generic device infrastructure and > iterating over *all* properties in your qdev_prop_find_bit() and making > generally available new QDEV_* macros QDEV_PROP_FOREACH() and > QDEV_CLASS_FOREACH(). Unfortunatly we still need mapping from bit position to name for kvm_check_features_against_host() So there is 2 options: 1st: keep iterating over array local to x86 2nd: drop name reporting in kvm_check_features_against_host() and report bit positions. which one would you preffer? >=20 > The utility of the feat- prefix AIUI is to go from +foo to feat-foo=3Don; > going from bit position to name should work just as before and could > even be consolidated into a single array by using dynamic properties. I can't get you, Could you elaborate more on "consolidated into a single ar= ray by using dynamic properties." > Am I the only one that finds the approach backwards? o.O >=20 > Regards, > Andreas >=20 > > target-i386: remove unused *_feature_name arrays > > target-i386: cpu: fix invalid use of error_is_set(errp) if errp =3D=3D > > NULL >=20 > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg --=20 Regards, Igor