diff mbox

[2/3] x86: vmx: Use cpuid_maxphyaddr()

Message ID 1409248950-16268-3-git-send-email-ehabkost@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eduardo Habkost Aug. 28, 2014, 6:02 p.m. UTC
The vmx test code calls cpuid(0x80000008) without checking xlevel first.
Change it to use cpuid_maxphyaddr() instead.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 x86/vmx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

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;