[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161220155602.6298-8-rkagan@virtuozzo.com>
Date: Tue, 20 Dec 2016 18:55:54 +0300
From: Roman Kagan <rkagan@...tuozzo.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>
CC: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, <x86@...nel.org>,
Haiyang Zhang <haiyangz@...rosoft.com>, <kvm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <devel@...uxdriverproject.org>,
"Denis V . Lunev" <den@...nvz.org>,
Roman Kagan <rkagan@...tuozzo.com>
Subject: [PATCH 07/15] hyperv: dedup cpuid definitions
Use the definitions already present in the uapi header throughout the
guest driver, too.
Signed-off-by: Roman Kagan <rkagan@...tuozzo.com>
---
drivers/hv/hyperv_vmbus.h | 19 -------------------
drivers/hv/hv.c | 6 +++---
2 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 4fab154..9b0f1c9 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -39,25 +39,6 @@
*/
#define HV_UTIL_NEGO_TIMEOUT 55
-/*
- * The below CPUID leaves are present if VersionAndFeatures.HypervisorPresent
- * is set by CPUID(HVCPUID_VERSION_FEATURES).
- */
-enum hv_cpuid_function {
- HVCPUID_VERSION_FEATURES = 0x00000001,
- HVCPUID_VENDOR_MAXFUNCTION = 0x40000000,
- HVCPUID_INTERFACE = 0x40000001,
-
- /*
- * The remaining functions depend on the value of
- * HVCPUID_INTERFACE
- */
- HVCPUID_VERSION = 0x40000002,
- HVCPUID_FEATURES = 0x40000003,
- HVCPUID_ENLIGHTENMENT_INFO = 0x40000004,
- HVCPUID_IMPLEMENTATION_LIMITS = 0x40000005,
-};
-
#define HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE 0x400
#define HV_X64_MSR_CRASH_P0 0x40000100
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index b40c7d9..dddba07 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -69,17 +69,17 @@ static int query_hypervisor_info(void)
ebx = 0;
ecx = 0;
edx = 0;
- op = HVCPUID_VENDOR_MAXFUNCTION;
+ op = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
cpuid(op, &eax, &ebx, &ecx, &edx);
max_leaf = eax;
- if (max_leaf >= HVCPUID_VERSION) {
+ if (max_leaf >= HYPERV_CPUID_VERSION) {
eax = 0;
ebx = 0;
ecx = 0;
edx = 0;
- op = HVCPUID_VERSION;
+ op = HYPERV_CPUID_VERSION;
cpuid(op, &eax, &ebx, &ecx, &edx);
host_info_eax = eax;
host_info_ebx = ebx;
--
2.9.3
Powered by blists - more mailing lists