From: Eduardo Habkost Subject: [PATCH 2/3] x86: vmx: Use cpuid_maxphyaddr() Date: Thu, 28 Aug 2014 15:02:29 -0300 Message-ID: <1409248950-16268-3-git-send-email-ehabkost@redhat.com> References: <1409248950-16268-1-git-send-email-ehabkost@redhat.com> Cc: Paolo Bonzini To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:13305 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbaH1SCn (ORCPT ); Thu, 28 Aug 2014 14:02:43 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7SI2gX4024213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 28 Aug 2014 14:02:43 -0400 In-Reply-To: <1409248950-16268-1-git-send-email-ehabkost@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: The vmx test code calls cpuid(0x80000008) without checking xlevel first. Change it to use cpuid_maxphyaddr() instead. Signed-off-by: Eduardo Habkost --- x86/vmx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x86/vmx.c b/x86/vmx.c index ef9caca..132e5f0 100644 --- a/x86/vmx.c +++ b/x86/vmx.c @@ -161,7 +161,7 @@ void print_vmexit_info() static void test_vmclear(void) { struct vmcs *tmp_root; - int width = cpuid(0x80000008).a & 0xff; + int width = cpuid_maxphyaddr(); /* * Note- The tests below do not necessarily have a @@ -652,7 +652,7 @@ static int test_vmxon(void) { int ret, ret1; u64 *tmp_region = vmxon_region; - int width = cpuid(0x80000008).a & 0xff; + int width = cpuid_maxphyaddr(); /* Unaligned page access */ vmxon_region = (u64 *)((intptr_t)vmxon_region + 1); @@ -694,7 +694,7 @@ out: static void test_vmptrld(void) { struct vmcs *vmcs, *tmp_root; - int width = cpuid(0x80000008).a & 0xff; + int width = cpuid_maxphyaddr(); vmcs = alloc_page(); vmcs->revision_id = basic.revision; -- 1.9.3