0001
0002 #ifndef _ASM_X86_VMWARE_H
0003 #define _ASM_X86_VMWARE_H
0004
0005 #include <asm/cpufeatures.h>
0006 #include <asm/alternative.h>
0007 #include <linux/stringify.h>
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #define VMWARE_HYPERVISOR_PORT 0x5658
0025 #define VMWARE_HYPERVISOR_PORT_HB 0x5659
0026
0027
0028 #define VMWARE_HYPERVISOR_HB BIT(0)
0029 #define VMWARE_HYPERVISOR_OUT BIT(1)
0030
0031
0032 #define VMWARE_HYPERCALL \
0033 ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT) ", %%dx; " \
0034 "inl (%%dx), %%eax", \
0035 "vmcall", X86_FEATURE_VMCALL, \
0036 "vmmcall", X86_FEATURE_VMW_VMMCALL)
0037
0038
0039
0040
0041
0042 #define VMWARE_HYPERCALL_HB_OUT \
0043 ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) ", %%dx; " \
0044 "rep outsb", \
0045 "vmcall", X86_FEATURE_VMCALL, \
0046 "vmmcall", X86_FEATURE_VMW_VMMCALL)
0047
0048
0049
0050
0051
0052 #define VMWARE_HYPERCALL_HB_IN \
0053 ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) ", %%dx; " \
0054 "rep insb", \
0055 "vmcall", X86_FEATURE_VMCALL, \
0056 "vmmcall", X86_FEATURE_VMW_VMMCALL)
0057 #endif