Received: from eggs.gnu.org ([208.118.235.92]:33561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US84D-0007fH-6f for qemu-devel@nongnu.org; Tue, 16 Apr 2013 11:45:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US84B-0007Ni-Kp for qemu-devel@nongnu.org; Tue, 16 Apr 2013 11:45:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20179) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US84B-0007NP-CU for qemu-devel@nongnu.org; Tue, 16 Apr 2013 11:45:07 -0400 Date: Tue, 16 Apr 2013 17:45:04 +0200 From: Igor Mammedov Message-ID: <20130416174504.38399ec8@nial.usersys.redhat.com> In-Reply-To: <1366053940-9401-8-git-send-email-ehabkost@redhat.com> References: <1366053940-9401-1-git-send-email-ehabkost@redhat.com> <1366053940-9401-8-git-send-email-ehabkost@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [qom-cpu PATCH 7/7] 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 =?ISO-8859-1?B?RuRyYmVy?= On Mon, 15 Apr 2013 16:25:40 -0300 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(), CPU feature-bit > property lookup/registration, and the proposed "feature-words" property) > table of mapping *features to feature-words would nice here for review at least. The rest below could go to ---/nNotes: section > This should also help avoid bugs like the ones introduced when we added > cpuid_7_0_ebx_features. Today, adding a new feature word to the code > requires chaning 5 or 6 different places in the code, and it's very easy > to miss a problem when we forget to update one of those parts. See, for > example: > > * The bug solved by commit ffa8c11f0bbf47e1b7a3a62f97bc1da591c6734a; > (CPUID 7 leaf was not being filtered based on host capabilities) > * The bug solved by commit 07ca59450c9a0c5df65665ce46aa8487af59a1dd > (check/enforce flags were not checking all feature flags) > > Signed-off-by: Eduardo Habkost