input/vmmouse: Update the backdoor call with support for new instructions
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 28 Aug 2019 08:03:53 +0000 (10:03 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 28 Aug 2019 11:43:01 +0000 (13:43 +0200)
Use the definition provided by include/asm/vmware.h.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Doug Covelli <dcovelli@vmware.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-input@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
Cc: <pv-drivers@vmware.com>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190828080353.12658-5-thomas_os@shipmail.org
drivers/input/mouse/vmmouse.c

index 871e5b5ab129d9d5b4614c6992cfdc8d2e7a33ae..148245c69be75fbd4e97f7cf239eaf3bca61cde6 100644 (file)
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <asm/hypervisor.h>
+#include <asm/vmware.h>
 
 #include "psmouse.h"
 #include "vmmouse.h"
 
 #define VMMOUSE_PROTO_MAGIC                    0x564D5868U
-#define VMMOUSE_PROTO_PORT                     0x5658
 
 /*
  * Main commands supported by the vmmouse hypervisor port.
@@ -84,7 +84,7 @@ struct vmmouse_data {
 #define VMMOUSE_CMD(cmd, in1, out1, out2, out3, out4)  \
 ({                                                     \
        unsigned long __dummy1, __dummy2;               \
-       __asm__ __volatile__ ("inl %%dx" :              \
+       __asm__ __volatile__ (VMWARE_HYPERCALL :        \
                "=a"(out1),                             \
                "=b"(out2),                             \
                "=c"(out3),                             \
@@ -94,7 +94,7 @@ struct vmmouse_data {
                "a"(VMMOUSE_PROTO_MAGIC),               \
                "b"(in1),                               \
                "c"(VMMOUSE_PROTO_CMD_##cmd),           \
-               "d"(VMMOUSE_PROTO_PORT) :               \
+               "d"(0) :                                \
                "memory");                              \
 })