From patchwork Mon Oct 22 15:03:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 193192 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9712C2C00FE for ; Tue, 23 Oct 2012 02:46:19 +1100 (EST) Received: from localhost ([::1]:52848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQKCn-00083C-QB for incoming@patchwork.ozlabs.org; Mon, 22 Oct 2012 11:46:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQJZA-0003k8-1X for qemu-devel@nongnu.org; Mon, 22 Oct 2012 11:05:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQJZ2-000170-KC for qemu-devel@nongnu.org; Mon, 22 Oct 2012 11:05:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQJZ2-000164-Bn for qemu-devel@nongnu.org; Mon, 22 Oct 2012 11:05:12 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9MF4Che019139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 22 Oct 2012 11:04:12 -0400 Received: from nial.brq.redhat.com (dhcp-1-247.brq.redhat.com [10.34.1.247]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9MF3OnG031350; Mon, 22 Oct 2012 11:04:10 -0400 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 22 Oct 2012 17:03:01 +0200 Message-Id: <1350918203-25198-16-git-send-email-imammedo@redhat.com> In-Reply-To: <1350918203-25198-1-git-send-email-imammedo@redhat.com> References: <1350918203-25198-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, ehabkost@redhat.com, jan.kiszka@siemens.com, Don@CloudSwitch.com, mdroth@linux.vnet.ibm.com, blauwirbel@gmail.com, stefanha@redhat.com, pbonzini@redhat.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH 15/37] target-i386: set default value of "hypervisor" feature using static property X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Igor Mammedov Reviewed-by: Don Slutz --- target-i386/cpu.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 3131945..dc4fcdf 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -174,7 +174,7 @@ static Property cpu_x86_properties[] = { DEFINE_PROP_BIT("f-xsave", X86CPU, env.cpuid_ext_features, 26, false), DEFINE_PROP_BIT("f-osxsave", X86CPU, env.cpuid_ext_features, 27, false), DEFINE_PROP_BIT("f-avx", X86CPU, env.cpuid_ext_features, 28, false), - DEFINE_PROP_BIT("f-hypervisor", X86CPU, env.cpuid_ext_features, 31, false), + DEFINE_PROP_BIT("f-hypervisor", X86CPU, env.cpuid_ext_features, 31, true), DEFINE_PROP_BIT("f-syscall", X86CPU, env.cpuid_ext2_features, 11, false), DEFINE_PROP_BIT("f-nx", X86CPU, env.cpuid_ext2_features, 20, false), DEFINE_PROP_BIT("f-xd", X86CPU, env.cpuid_ext2_features, 20, false), @@ -1307,11 +1307,12 @@ static int cpu_x86_find_by_name(X86CPU *cpu, x86_def_t *x86_cpu_def, { unsigned int i; x86_def_t *def; + CPUX86State *env = &cpu->env; char *s = g_strdup(cpu_model); char *featurestr, *name = strtok(s, ","); /* Features to be added*/ - uint32_t plus_features = 0, plus_ext_features = 0; + uint32_t plus_features = 0, plus_ext_features = env->cpuid_ext_features; uint32_t plus_ext2_features = 0, plus_ext3_features = 0; uint32_t plus_kvm_features = 0, plus_svm_features = 0; uint32_t plus_7_0_ebx_features = 0; @@ -1345,10 +1346,6 @@ static int cpu_x86_find_by_name(X86CPU *cpu, x86_def_t *x86_cpu_def, plus_kvm_features = 0; #endif - add_flagname_to_bitmaps("hypervisor", &plus_features, - &plus_ext_features, &plus_ext2_features, &plus_ext3_features, - &plus_kvm_features, &plus_svm_features, &plus_7_0_ebx_features); - featurestr = strtok(NULL, ","); while (featurestr) {