Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765180AbcLTSb0 (ORCPT ); Tue, 20 Dec 2016 13:31:26 -0500 Received: from mail-db5eur01on0094.outbound.protection.outlook.com ([104.47.2.94]:37763 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754717AbcLTSbQ (ORCPT ); Tue, 20 Dec 2016 13:31:16 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; From: Roman Kagan To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , "K. Y. Srinivasan" , Vitaly Kuznetsov CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , , Haiyang Zhang , , , , "Denis V . Lunev" , Roman Kagan Subject: [PATCH 07/15] hyperv: dedup cpuid definitions Date: Tue, 20 Dec 2016 18:55:54 +0300 Message-ID: <20161220155602.6298-8-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161220155602.6298-1-rkagan@virtuozzo.com> References: <20161220155602.6298-1-rkagan@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: AM4PR01CA0030.eurprd01.prod.exchangelabs.com (10.164.74.168) To VI1PR0802MB2478.eurprd08.prod.outlook.com (10.175.26.21) X-MS-Office365-Filtering-Correlation-Id: 8c11ae43-f89c-4c68-434d-08d428f0ceb2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR0802MB2478; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0802MB2478;3:s0xm+BeJWuea45YHTz/Rcwp134td9zYlYpJSYxZk97huXabmKSAFEnL+8xM8yKwCOQrx2pRKnQLkIYSpG0t706ve9SkEk1ZRbh2JoUduTfHAeooknRn7v6S23GSe7wk6jTKsamItaYRdYlEthLdLJ4nKaa4FAO0qrrix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Ugz3S8dbFmtjs/u+zNc5SKpTfEJHmWqVuO1FMQgjQHGfYRp8p8//I+ygMxL7AxAVsBYY6uBJvk8idjJHb4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123558021)(20161123562025)(6072148);SRVR:VI1PR0802MB2478;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0802MB2478; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0802MB2478;4:WOlgPga23EMwzPU+LYlFnD+NFx/ocF/rY8zDkjY1HH9pqKyWj2L2/stIVNrBuLfIpX1RzIBCBjqjNtp5x487pvujLu4znFrJbDMN2MKCCTMC4YODSrV95hmUzYb3c2PShGEYkPu1Qhk2Znf8xhBvaf2/yGjH2wcfIgg+YlEPAYweSDkFqlnpxatFk99B0n5eSoqC4ZfRSqRilKxMJGiiBHvHJGMjaaO8sewqO7tI76FbMkPFRfJROmfPepi5UGbI8JXufJ2PwpXIsFRp4s5QyyD1yW7eIzF8LiyvvLZUPRGNZgUg+bfwMbwEpFkfmKOXRRm1ux+QoYGgQ8Zd5YnD87scK7Rn7yp2eTXe+yzn1u80eTwSfYJV8PYa+NlCcExqfN1XIXWof7admJCEpe1irXiCbssbXXVK+qlrwoGYbylCiFhr6lJJKIZmL/ntXlm3E1iZSStUepaE5Ede8dYbgHF/Ku+IrjpW5GKh0VFcTnFi5kXWJWD9QKko9KzecIjsQ8ViIMhaV/TbClx03459QCDvOt2ID5OhT5MQwTh/6o1wnsd3uNt4okiAiKoRPnK2G9HCeMdTXiuGKMCwCa8XCsX/h9NHTEpl7mA4xLviYM4= X-Forefront-PRVS: 0162ACCC24 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(39450400003)(199003)(189002)(6666003)(97736004)(189998001)(101416001)(5001770100001)(4001430100002)(5003940100001)(36756003)(81166006)(47776003)(50986999)(66066001)(1511001)(2950100002)(50466002)(76176999)(5660300001)(81156014)(2906002)(8666005)(305945005)(69596002)(48376002)(7736002)(92566002)(7416002)(106356001)(53416004)(25786008)(6116002)(105586002)(6486002)(2421001)(6506006)(1076002)(3846002)(575784001)(86362001)(4326007)(68736007)(8676002)(50226002)(42186005)(107886002)(2561002)(38730400001)(6512006)(33646002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0802MB2478;H:rkaganb.sw.ru;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR0802MB2478;23:UTJxcGcx8AzKfklve4HNHTieccDM83lA0NGCtyy?= =?us-ascii?Q?m2x+tPtEoRyMl2WOTxNqQrlVExn98rghs6g2o9GQH2sMfcG7o4g7DffpbFy+?= =?us-ascii?Q?MgYaDVT7yEpUox9kA8ucJ8Wx2s4ogpVTuHylyjXxzYu0R9oRraXrNHVrTXBw?= =?us-ascii?Q?Q8+8NnoytK/zjcbRlla96KMIqQNSuc+Re7wZkzgn5bk+nBw8jAxTAm+tmzdr?= =?us-ascii?Q?2M12tj/1Lr+ZWxdIOpdIXUamj6HL7HX54VxfAfHei85TICCFZl9+dSgnsAZN?= =?us-ascii?Q?ZTnmwKIo52xnrjbxaOHdWrXT2Yif+P8dC40UCkvTq0XDSwofHamd0e5nhbT9?= =?us-ascii?Q?fGqPnPyI1DldKL4OkWNA6w6PYs795nzlCMaP8ZHNLRQ2zO7imfWSaq85PGPN?= =?us-ascii?Q?wcU6oLMNfx8ctcXSkbLtVaGukOI+b5/G0c+Ze4E93OqcJVQP8mcl/SZMJNg0?= =?us-ascii?Q?fZXoGwLZyi5qlA0/SM2H+4ye0C8443lKkAx1Bg7726f26cUdmyzgIUEXyvll?= =?us-ascii?Q?Wtbqp/mI4Bt+Lk2DTPlbjBVZMrqAV3Ex0YlM83VPtpl5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A6QE33FOXOP0w5vNnKxQER7H9GzCG6VspxiCJkJZw/9CIsqLIy9UluuL0SLwm34t5laVSlOqBPYnCxnpfL0g==;20:7t81uIOTrmeGzWcN7zvOdOX09utL7EevGTzEKPbRDgaFAs+m/7l7dwY/w7po0sihC5z1UatkmT9sTJaFvrExh3uDm24kDmEMObXWMCEg0ak0KBqYn+w3070qGijFmR31ytP1Hs3/6t1amZoX2uErAsDY2jd6wwrO75iXDaOE8ss= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2016 15:56:48.0815 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2478 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1773 Lines: 66 Use the definitions already present in the uapi header throughout the guest driver, too. Signed-off-by: Roman Kagan --- 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