Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757193AbbLAWSF (ORCPT ); Tue, 1 Dec 2015 17:18:05 -0500 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]:37930 "EHLO smtp-outbound-2.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756998AbbLAWSB (ORCPT ); Tue, 1 Dec 2015 17:18:01 -0500 From: "Sinclair Yeh" To: x86@kernel.org Cc: Sinclair Yeh , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , pv-drivers@vmware.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] x86: Update vmware.c to use the common VMW_PORT macros Date: Tue, 1 Dec 2015 14:18:48 -0800 Message-Id: <1449008332-9394-2-git-send-email-syeh@vmware.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449008332-9394-1-git-send-email-syeh@vmware.com> References: <1449008047-8252-1-git-send-email-syeh@vmware.com> <1449008332-9394-1-git-send-email-syeh@vmware.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2092 Lines: 63 v2: Instead of replacing all existing instances of VMWARE_PORT with VMW_PORT, update VMWARE_PORT to use the new VMW_PORT. v3: Using updated VMWARE_PORT() macro, which needs hypervisor magic in the parameter Signed-off-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Reviewed-by: Alok N Kataria Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: pv-drivers@vmware.com Cc: virtualization@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org --- arch/x86/kernel/cpu/vmware.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 628a059..1837f66 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@ -26,6 +26,7 @@ #include #include #include +#include #define CPUID_VMWARE_INFO_LEAF 0x40000000 #define VMWARE_HYPERVISOR_MAGIC 0x564D5868 @@ -37,13 +38,14 @@ #define VMWARE_PORT_CMD_LEGACY_X2APIC 3 #define VMWARE_PORT_CMD_VCPU_RESERVED 31 -#define VMWARE_PORT(cmd, eax, ebx, ecx, edx) \ - __asm__("inl (%%dx)" : \ - "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ - "0"(VMWARE_HYPERVISOR_MAGIC), \ - "1"(VMWARE_PORT_CMD_##cmd), \ - "2"(VMWARE_HYPERVISOR_PORT), "3"(UINT_MAX) : \ - "memory"); +#define VMWARE_PORT(cmd, eax, ebx, ecx, edx) \ +({ \ + unsigned long __si = 0, __di = 0; \ + VMW_PORT(UINT_MAX, VMWARE_PORT_CMD_##cmd, VMWARE_HYPERVISOR_PORT, \ + VMWARE_HYPERVISOR_MAGIC, \ + eax, ebx, ecx, edx, __si, __di); \ +}) + static inline int __vmware_platform(void) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/