From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9CUh-0003G4-J2 for qemu-devel@nongnu.org; Fri, 31 Jan 2014 06:42:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9CUZ-0000WL-4j for qemu-devel@nongnu.org; Fri, 31 Jan 2014 06:42:47 -0500 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:35684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9CUY-0000Va-Mb for qemu-devel@nongnu.org; Fri, 31 Jan 2014 06:42:38 -0500 Received: by mail-ea0-f176.google.com with SMTP id h14so2235267eaj.21 for ; Fri, 31 Jan 2014 03:42:37 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52EB8C26.4030501@redhat.com> Date: Fri, 31 Jan 2014 12:42:30 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1391111339-6958-1-git-send-email-ehabkost@redhat.com> <1391111339-6958-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1391111339-6958-3-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [uq/master PATCH 2/7] target-i386: Don't change x86_def_t struct on cpu_x86_register() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: libvir-list@redhat.com, Igor Mammedov , Jiri Denemark , =?ISO-8859-1?Q?Andreas_F=E4rber?= , kvm@vger.kernel.org Il 30/01/2014 20:48, Eduardo Habkost ha scritto: > As eventually the x86_def_t data is going to be provided by the CPU > class, it's better to not touch it, and handle the special cases on the > X86CPU object itself. > > Current behavior of the code should stay exactly the same. > > Signed-off-by: Eduardo Habkost > --- > target-i386/cpu.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index 8425212..be54f84 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c > @@ -1841,11 +1841,6 @@ static void cpu_x86_register(X86CPU *cpu, const char *name, Error **errp) > return; > } > > - if (kvm_enabled()) { > - def->features[FEAT_KVM] |= kvm_default_features; > - } > - def->features[FEAT_1_ECX] |= CPUID_EXT_HYPERVISOR; > - > object_property_set_str(OBJECT(cpu), def->vendor, "vendor", errp); > object_property_set_int(OBJECT(cpu), def->level, "level", errp); > object_property_set_int(OBJECT(cpu), def->family, "family", errp); > @@ -1864,6 +1859,12 @@ static void cpu_x86_register(X86CPU *cpu, const char *name, Error **errp) > cpu->cache_info_passthrough = def->cache_info_passthrough; > > object_property_set_str(OBJECT(cpu), def->model_id, "model-id", errp); > + > + /* Special cases not set in the x86_def_t structs: */ > + if (kvm_enabled()) { > + env->features[FEAT_KVM] |= kvm_default_features; > + } > + env->features[FEAT_1_ECX] |= CPUID_EXT_HYPERVISOR; > } > > X86CPU *cpu_x86_create(const char *cpu_model, DeviceState *icc_bridge, > Reviewed-by: Paolo Bonzini