1
2 #ifndef _ASM_X86_VMWARE_H
3 #define _ASM_X86_VMWARE_H
4
5 #include <asm/cpufeatures.h>
6 #include <asm/alternative.h>
7 #include <linux/stringify.h>
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #define VMWARE_HYPERVISOR_PORT 0x5658
25 #define VMWARE_HYPERVISOR_PORT_HB 0x5659
26
27
28 #define VMWARE_HYPERVISOR_HB BIT(0)
29 #define VMWARE_HYPERVISOR_OUT BIT(1)
30
31
32 #define VMWARE_HYPERCALL \
33 ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT) ", %%dx; " \
34 "inl (%%dx), %%eax", \
35 "vmcall", X86_FEATURE_VMCALL, \
36 "vmmcall", X86_FEATURE_VMW_VMMCALL)
37
38
39
40
41
42 #define VMWARE_HYPERCALL_HB_OUT \
43 ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) ", %%dx; " \
44 "rep outsb", \
45 "vmcall", X86_FEATURE_VMCALL, \
46 "vmmcall", X86_FEATURE_VMW_VMMCALL)
47
48
49
50
51
52 #define VMWARE_HYPERCALL_HB_IN \
53 ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) ", %%dx; " \
54 "rep insb", \
55 "vmcall", X86_FEATURE_VMCALL, \
56 "vmmcall", X86_FEATURE_VMW_VMMCALL)
57 #endif