lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 19 Jan 2016 13:46:01 -0800
From:	"Sinclair Yeh" <syeh@...are.com>
To:	x86@...nel.org
Cc:	linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
	Sinclair Yeh <syeh@...are.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, pv-drivers@...are.com,
	virtualization@...ts.linux-foundation.org
Subject: [PATCH 2/6] x86: Update vmware.c to use the common VMW_PORT macros

Updated the VMWARE_PORT macro to use the new VMW_PORT
macro.  Doing this instead of replacing all existing
instances of VMWARE_PORT to minimize code change.

Signed-off-by: Sinclair Yeh <syeh@...are.com>
Reviewed-by: Thomas Hellstrom <thellstrom@...are.com>
Reviewed-by: Alok N Kataria <akataria@...are.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: pv-drivers@...are.com
Cc: virtualization@...ts.linux-foundation.org
Cc: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

---

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

v4:
Swapped the first and second parameters because VMW_PORT has
changed.

v5:
si and di are now separate input/output arguments in VMW_PORT()
---
 arch/x86/kernel/cpu/vmware.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 628a059..8e900d3 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -26,6 +26,7 @@
 #include <asm/div64.h>
 #include <asm/x86_init.h>
 #include <asm/hypervisor.h>
+#include <asm/vmware.h>
 
 #define CPUID_VMWARE_INFO_LEAF	0x40000000
 #define VMWARE_HYPERVISOR_MAGIC	0x564D5868
@@ -38,12 +39,13 @@
 #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");
+({									\
+	unsigned long __si, __di; /* Not used */			\
+	VMW_PORT(VMWARE_PORT_CMD_##cmd, UINT_MAX, 0, 0,			\
+		 VMWARE_HYPERVISOR_PORT, VMWARE_HYPERVISOR_MAGIC,	\
+		 eax, ebx, ecx, edx, __si, __di);			\
+})
+
 
 static inline int __vmware_platform(void)
 {
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ