From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjVhD-0001Ke-NM for qemu-devel@nongnu.org; Fri, 14 Dec 2012 08:53:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjVh8-0001rs-RU for qemu-devel@nongnu.org; Fri, 14 Dec 2012 08:52:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjVh8-0001ro-Is for qemu-devel@nongnu.org; Fri, 14 Dec 2012 08:52:54 -0500 Date: Fri, 14 Dec 2012 14:52:50 +0100 From: Igor Mammedov Message-ID: <20121214145250.22322c6e@thinkpad.mammed.net> In-Reply-To: <20121214122734.GR3236@otherpad.lan.raisama.net> References: <1355350946-28010-1-git-send-email-ehabkost@redhat.com> <1355350946-28010-4-git-send-email-ehabkost@redhat.com> <20121214103850.53dda479@thinkpad.mammed.net> <20121214122734.GR3236@otherpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] target-i386: replace cpuid_*features fields with a feature word array List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, Andreas =?UTF-8?B?RsOkcmJlcg==?= On Fri, 14 Dec 2012 10:27:34 -0200 Eduardo Habkost wrote: > On Fri, Dec 14, 2012 at 10:38:50AM +0100, Igor Mammedov wrote: > > On Wed, 12 Dec 2012 20:22:26 -0200 > > Eduardo Habkost wrote: > > > > > This replaces the feature-bit fields on both X86CPU and x86_def_t > > > structs with an array. > > > > > > With this, we will be able to simplify code that simply does the same > > > operation on all feature words (e.g. kvm_check_features_against_host(), > > > filter_features_for_kvm(), add_flagname_to_bitmaps(), and CPU > > > feature-bit property lookup/registration). > > > > > > > do you have a patch that simplifies kvm_check_features_against_host() using > > this? > > I have a very old one, based on an older (and more complex) version of > this series: > https://github.com/ehabkost/qemu-hacks/commit/eb01d374baecf6df26fd6f0d0bb23f2e1547f499 > > It's in the work/cpuid-refactor-v0.22-2012-08-31 branch in my git > repository. > > That branch also has some patches to merge kvm_check_features_against_host() > and filter_features_for_kvm() (because the purpose of > kvm_check_features_against_host() is simply to check if anything is > going to be filtered out by filter_features_for_kvm()). > > If people are happy with the approach in this series, I plan to write > and submit cleanups for kvm_cpu_fill_host(), > kvm_check_features_against_host(), filter_features_for_kvm(), > add_flagname_to_bitmaps(), and the cpudef -> CPU feature copying code. > > There's so much code that could be cleaned up using the array, that I am > afraid that it would cause too much conflicts in the CPU properties > work. So I can wait until the CPU properties series are submitted before > making the cleanups, if necessary. with cpu properties and subclasses in place, kvm_check_features_against_host() could be expressed as simple subtraction of host subclass features list from guest cpu features list. Which won't require access to feature words at all. Just iterating over properties of both to build lists and then do subtraction and print difference if any, it could be eventially generalized to other kvm supported targets since it won't use any x86 specific fields. > -- > Eduardo > -- Regards, Igor