From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Eduardo Habkost 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> Subject: [Qemu-devel] [PATCH 12/15] i386: kvm: mask cpuid_ext4_features bits earlier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, Gleb Natapov , Marcelo Tosatti , Avi Kivity , Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= 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++) { -- 1.7.11.4