From patchwork Thu Oct 4 20:49:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 189327 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 5C0F32C03B5 for ; Fri, 5 Oct 2012 07:20:03 +1000 (EST) Received: from localhost ([::1]:34214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJsMr-0005cW-JZ for incoming@patchwork.ozlabs.org; Thu, 04 Oct 2012 16:50:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJsLp-0003er-25 for qemu-devel@nongnu.org; Thu, 04 Oct 2012 16:49:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJsL7-0003qA-Ue for qemu-devel@nongnu.org; Thu, 04 Oct 2012 16:48:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJsL7-0003pe-MV for qemu-devel@nongnu.org; Thu, 04 Oct 2012 16:48:13 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q94KmCZG000954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Oct 2012 16:48:13 -0400 Received: from blackpad.lan.raisama.net (vpn1-7-183.gru2.redhat.com [10.97.7.183]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q94KmC3p017409; Thu, 4 Oct 2012 16:48:12 -0400 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 11CF0203631; Thu, 4 Oct 2012 17:49:13 -0300 (BRT) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Thu, 4 Oct 2012 17:49:04 -0300 Message-Id: <1349383747-19383-13-git-send-email-ehabkost@redhat.com> In-Reply-To: <1349383747-19383-1-git-send-email-ehabkost@redhat.com> References: <1349383747-19383-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kvm@vger.kernel.org, Gleb Natapov , Marcelo Tosatti , Avi Kivity , Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH 12/15] i386: kvm: mask cpuid_ext4_features bits earlier 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 This way all the filtering by GET_SUPPORTED_CPUID is being done at the same place in the code. Signed-off-by: Eduardo Habkost --- target-i386/kvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 3f4bee5..335b3e7 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -431,6 +431,9 @@ int kvm_arch_init_vcpu(CPUX86State *env) env->cpuid_kvm_features &= kvm_arch_get_supported_cpuid(s, KVM_CPUID_FEATURES, 0, R_EAX); + env->cpuid_ext4_features &= kvm_arch_get_supported_cpuid(s, 0xC0000001, + 0, R_EDX); + cpuid_i = 0; /* Paravirtualization CPUIDs */ @@ -572,8 +575,6 @@ int kvm_arch_init_vcpu(CPUX86State *env) /* Call Centaur's CPUID instructions they are supported. */ if (env->cpuid_xlevel2 > 0) { - env->cpuid_ext4_features &= - kvm_arch_get_supported_cpuid(s, 0xC0000001, 0, R_EDX); cpu_x86_cpuid(env, 0xC0000000, 0, &limit, &unused, &unused, &unused); for (i = 0xC0000000; i <= limit; i++) {