Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1312537

[PATCH 6/6] VMware balloon: Update vmw_balloon.c to use the VMW_PORT macro

From "Sinclair Yeh" <syeh@vmware.com>
Newsgroups linux.kernel
Subject [PATCH 6/6] VMware balloon: Update vmw_balloon.c to use the VMW_PORT macro
Date 2016-01-19 22:50 +0100
Message-ID <qSMk2-59V-19@gated-at.bofh.it> (permalink)
References <qC7NT-MQ-9@gated-at.bofh.it> <qSMk2-59V-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Updated VMWARE_BALLOON_CMD to use the common VMW_PORT macro.
Doing this rather than replacing all instances of VMWARE_BALLOON_CMD
to minimize code change.

Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Alok N Kataria <akataria@vmware.com>
Acked-by: Xavier Deguillard <xdeguillard@vmware.com>
Cc: pv-drivers@vmware.com
Cc: Xavier Deguillard <xdeguillard@vmware.com>
Cc: linux-kernel@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
v1
Swapped parameters 1 and 2 to VMW_PORT because the macro has been
updated

v2
Updated VMW_PORT() usage because the macro and vmw_balloon.c's
usage have changed.
---
 drivers/misc/vmw_balloon.c | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
index 1e688bf..6476b74 100644
--- a/drivers/misc/vmw_balloon.c
+++ b/drivers/misc/vmw_balloon.c
@@ -46,6 +46,7 @@
 #include <linux/vmw_vmci_defs.h>
 #include <linux/vmw_vmci_api.h>
 #include <asm/hypervisor.h>
+#include <asm/vmware.h>
 
 MODULE_AUTHOR("VMware, Inc.");
 MODULE_DESCRIPTION("VMware Memory Control (Balloon) Driver");
@@ -197,25 +198,17 @@ static void vmballoon_batch_set_pa(struct vmballoon_batch_page *batch, int idx,
 }
 
 
-#define VMWARE_BALLOON_CMD(cmd, arg1, arg2, result)		\
-({								\
-	unsigned long __status, __dummy1, __dummy2, __dummy3;	\
-	__asm__ __volatile__ ("inl %%dx" :			\
-		"=a"(__status),					\
-		"=c"(__dummy1),					\
-		"=d"(__dummy2),					\
-		"=b"(result),					\
-		"=S" (__dummy3) :				\
-		"0"(VMW_BALLOON_HV_MAGIC),			\
-		"1"(VMW_BALLOON_CMD_##cmd),			\
-		"2"(VMW_BALLOON_HV_PORT),			\
-		"3"(arg1),					\
-		"4" (arg2) :					\
-		"memory");					\
-	if (VMW_BALLOON_CMD_##cmd == VMW_BALLOON_CMD_START)	\
-		result = __dummy1;				\
-	result &= -1UL;						\
-	__status & -1UL;					\
+#define VMWARE_BALLOON_CMD(cmd, arg1, arg2, result)			\
+({									\
+	unsigned long __status, __dummy1, __dummy2;			\
+	unsigned long __si, __di;					\
+	VMW_PORT(VMW_BALLOON_CMD_##cmd, arg1, arg2, 0,			\
+		 VMW_BALLOON_HV_PORT, VMW_BALLOON_HV_MAGIC,		\
+		 __status, result, __dummy1, __dummy2, __si, __di);	\
+	if (VMW_BALLOON_CMD_##cmd == VMW_BALLOON_CMD_START)		\
+		result = __dummy1;					\
+	result &= -1UL;							\
+	__status & -1UL;						\
 })
 
 #ifdef CONFIG_DEBUG_FS
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Create common VMWare host port communication macros v3 "Sinclair Yeh" <syeh@vmware.com> - 2016-01-19 22:50 +0100
  [PATCH 4/6] Input: Remove vmmouse port reservation "Sinclair Yeh" <syeh@vmware.com> - 2016-01-19 22:50 +0100
  [PATCH 1/6] x86: Add VMWare Host Communication Macros "Sinclair Yeh" <syeh@vmware.com> - 2016-01-19 22:50 +0100
  [PATCH 5/6] x86: Remove address from the vmware.c header "Sinclair Yeh" <syeh@vmware.com> - 2016-01-19 22:50 +0100
  [PATCH 3/6] Input: Update vmmouse.c to use the common VMW_PORT macros "Sinclair Yeh" <syeh@vmware.com> - 2016-01-19 22:50 +0100
  [PATCH 6/6] VMware balloon: Update vmw_balloon.c to use the VMW_PORT macro "Sinclair Yeh" <syeh@vmware.com> - 2016-01-19 22:50 +0100

csiph-web