blob: a9731f8a480f3bca0785c94e870c74be6c191a67 [file] [log] [blame]
Christopher Ferris25981132017-11-14 16:53:49 -08001/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Christopher Ferris0437c522013-11-07 14:16:29 -08002#ifndef _UAPI__SVM_H
3#define _UAPI__SVM_H
4
5#define SVM_EXIT_READ_CR0 0x000
Christopher Ferrisccfaccd2016-08-24 12:11:31 -07006#define SVM_EXIT_READ_CR2 0x002
Christopher Ferris0437c522013-11-07 14:16:29 -08007#define SVM_EXIT_READ_CR3 0x003
8#define SVM_EXIT_READ_CR4 0x004
9#define SVM_EXIT_READ_CR8 0x008
10#define SVM_EXIT_WRITE_CR0 0x010
Christopher Ferrisccfaccd2016-08-24 12:11:31 -070011#define SVM_EXIT_WRITE_CR2 0x012
Christopher Ferris0437c522013-11-07 14:16:29 -080012#define SVM_EXIT_WRITE_CR3 0x013
13#define SVM_EXIT_WRITE_CR4 0x014
14#define SVM_EXIT_WRITE_CR8 0x018
15#define SVM_EXIT_READ_DR0 0x020
16#define SVM_EXIT_READ_DR1 0x021
17#define SVM_EXIT_READ_DR2 0x022
18#define SVM_EXIT_READ_DR3 0x023
19#define SVM_EXIT_READ_DR4 0x024
20#define SVM_EXIT_READ_DR5 0x025
21#define SVM_EXIT_READ_DR6 0x026
22#define SVM_EXIT_READ_DR7 0x027
23#define SVM_EXIT_WRITE_DR0 0x030
24#define SVM_EXIT_WRITE_DR1 0x031
25#define SVM_EXIT_WRITE_DR2 0x032
26#define SVM_EXIT_WRITE_DR3 0x033
27#define SVM_EXIT_WRITE_DR4 0x034
28#define SVM_EXIT_WRITE_DR5 0x035
29#define SVM_EXIT_WRITE_DR6 0x036
30#define SVM_EXIT_WRITE_DR7 0x037
31#define SVM_EXIT_EXCP_BASE 0x040
32#define SVM_EXIT_INTR 0x060
33#define SVM_EXIT_NMI 0x061
34#define SVM_EXIT_SMI 0x062
35#define SVM_EXIT_INIT 0x063
36#define SVM_EXIT_VINTR 0x064
37#define SVM_EXIT_CR0_SEL_WRITE 0x065
38#define SVM_EXIT_IDTR_READ 0x066
39#define SVM_EXIT_GDTR_READ 0x067
40#define SVM_EXIT_LDTR_READ 0x068
41#define SVM_EXIT_TR_READ 0x069
42#define SVM_EXIT_IDTR_WRITE 0x06a
43#define SVM_EXIT_GDTR_WRITE 0x06b
44#define SVM_EXIT_LDTR_WRITE 0x06c
45#define SVM_EXIT_TR_WRITE 0x06d
46#define SVM_EXIT_RDTSC 0x06e
47#define SVM_EXIT_RDPMC 0x06f
48#define SVM_EXIT_PUSHF 0x070
49#define SVM_EXIT_POPF 0x071
50#define SVM_EXIT_CPUID 0x072
51#define SVM_EXIT_RSM 0x073
52#define SVM_EXIT_IRET 0x074
53#define SVM_EXIT_SWINT 0x075
54#define SVM_EXIT_INVD 0x076
55#define SVM_EXIT_PAUSE 0x077
56#define SVM_EXIT_HLT 0x078
57#define SVM_EXIT_INVLPG 0x079
58#define SVM_EXIT_INVLPGA 0x07a
59#define SVM_EXIT_IOIO 0x07b
60#define SVM_EXIT_MSR 0x07c
61#define SVM_EXIT_TASK_SWITCH 0x07d
62#define SVM_EXIT_FERR_FREEZE 0x07e
63#define SVM_EXIT_SHUTDOWN 0x07f
64#define SVM_EXIT_VMRUN 0x080
65#define SVM_EXIT_VMMCALL 0x081
66#define SVM_EXIT_VMLOAD 0x082
67#define SVM_EXIT_VMSAVE 0x083
68#define SVM_EXIT_STGI 0x084
69#define SVM_EXIT_CLGI 0x085
70#define SVM_EXIT_SKINIT 0x086
71#define SVM_EXIT_RDTSCP 0x087
72#define SVM_EXIT_ICEBP 0x088
73#define SVM_EXIT_WBINVD 0x089
74#define SVM_EXIT_MONITOR 0x08a
75#define SVM_EXIT_MWAIT 0x08b
76#define SVM_EXIT_MWAIT_COND 0x08c
77#define SVM_EXIT_XSETBV 0x08d
78#define SVM_EXIT_NPF 0x400
Christopher Ferrisccfaccd2016-08-24 12:11:31 -070079#define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401
80#define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402
Christopher Ferris0437c522013-11-07 14:16:29 -080081
82#define SVM_EXIT_ERR -1
83
84#define SVM_EXIT_REASONS \
85 { SVM_EXIT_READ_CR0, "read_cr0" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -070086 { SVM_EXIT_READ_CR2, "read_cr2" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -080087 { SVM_EXIT_READ_CR3, "read_cr3" }, \
88 { SVM_EXIT_READ_CR4, "read_cr4" }, \
89 { SVM_EXIT_READ_CR8, "read_cr8" }, \
90 { SVM_EXIT_WRITE_CR0, "write_cr0" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -070091 { SVM_EXIT_WRITE_CR2, "write_cr2" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -080092 { SVM_EXIT_WRITE_CR3, "write_cr3" }, \
93 { SVM_EXIT_WRITE_CR4, "write_cr4" }, \
94 { SVM_EXIT_WRITE_CR8, "write_cr8" }, \
95 { SVM_EXIT_READ_DR0, "read_dr0" }, \
96 { SVM_EXIT_READ_DR1, "read_dr1" }, \
97 { SVM_EXIT_READ_DR2, "read_dr2" }, \
98 { SVM_EXIT_READ_DR3, "read_dr3" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -070099 { SVM_EXIT_READ_DR4, "read_dr4" }, \
100 { SVM_EXIT_READ_DR5, "read_dr5" }, \
101 { SVM_EXIT_READ_DR6, "read_dr6" }, \
102 { SVM_EXIT_READ_DR7, "read_dr7" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800103 { SVM_EXIT_WRITE_DR0, "write_dr0" }, \
104 { SVM_EXIT_WRITE_DR1, "write_dr1" }, \
105 { SVM_EXIT_WRITE_DR2, "write_dr2" }, \
106 { SVM_EXIT_WRITE_DR3, "write_dr3" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700107 { SVM_EXIT_WRITE_DR4, "write_dr4" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800108 { SVM_EXIT_WRITE_DR5, "write_dr5" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700109 { SVM_EXIT_WRITE_DR6, "write_dr6" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800110 { SVM_EXIT_WRITE_DR7, "write_dr7" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700111 { SVM_EXIT_EXCP_BASE + DE_VECTOR, "DE excp" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800112 { SVM_EXIT_EXCP_BASE + DB_VECTOR, "DB excp" }, \
113 { SVM_EXIT_EXCP_BASE + BP_VECTOR, "BP excp" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700114 { SVM_EXIT_EXCP_BASE + OF_VECTOR, "OF excp" }, \
115 { SVM_EXIT_EXCP_BASE + BR_VECTOR, "BR excp" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800116 { SVM_EXIT_EXCP_BASE + UD_VECTOR, "UD excp" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800117 { SVM_EXIT_EXCP_BASE + NM_VECTOR, "NM excp" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700118 { SVM_EXIT_EXCP_BASE + DF_VECTOR, "DF excp" }, \
119 { SVM_EXIT_EXCP_BASE + TS_VECTOR, "TS excp" }, \
120 { SVM_EXIT_EXCP_BASE + NP_VECTOR, "NP excp" }, \
121 { SVM_EXIT_EXCP_BASE + SS_VECTOR, "SS excp" }, \
122 { SVM_EXIT_EXCP_BASE + GP_VECTOR, "GP excp" }, \
123 { SVM_EXIT_EXCP_BASE + PF_VECTOR, "PF excp" }, \
124 { SVM_EXIT_EXCP_BASE + MF_VECTOR, "MF excp" }, \
Christopher Ferris12e1f282016-02-04 12:35:07 -0800125 { SVM_EXIT_EXCP_BASE + AC_VECTOR, "AC excp" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800126 { SVM_EXIT_EXCP_BASE + MC_VECTOR, "MC excp" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700127 { SVM_EXIT_EXCP_BASE + XM_VECTOR, "XF excp" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800128 { SVM_EXIT_INTR, "interrupt" }, \
129 { SVM_EXIT_NMI, "nmi" }, \
130 { SVM_EXIT_SMI, "smi" }, \
131 { SVM_EXIT_INIT, "init" }, \
132 { SVM_EXIT_VINTR, "vintr" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700133 { SVM_EXIT_CR0_SEL_WRITE, "cr0_sel_write" }, \
134 { SVM_EXIT_IDTR_READ, "read_idtr" }, \
135 { SVM_EXIT_GDTR_READ, "read_gdtr" }, \
136 { SVM_EXIT_LDTR_READ, "read_ldtr" }, \
137 { SVM_EXIT_TR_READ, "read_rt" }, \
138 { SVM_EXIT_IDTR_WRITE, "write_idtr" }, \
139 { SVM_EXIT_GDTR_WRITE, "write_gdtr" }, \
140 { SVM_EXIT_LDTR_WRITE, "write_ldtr" }, \
141 { SVM_EXIT_TR_WRITE, "write_rt" }, \
142 { SVM_EXIT_RDTSC, "rdtsc" }, \
143 { SVM_EXIT_RDPMC, "rdpmc" }, \
144 { SVM_EXIT_PUSHF, "pushf" }, \
145 { SVM_EXIT_POPF, "popf" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800146 { SVM_EXIT_CPUID, "cpuid" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700147 { SVM_EXIT_RSM, "rsm" }, \
148 { SVM_EXIT_IRET, "iret" }, \
149 { SVM_EXIT_SWINT, "swint" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800150 { SVM_EXIT_INVD, "invd" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700151 { SVM_EXIT_PAUSE, "pause" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800152 { SVM_EXIT_HLT, "hlt" }, \
153 { SVM_EXIT_INVLPG, "invlpg" }, \
154 { SVM_EXIT_INVLPGA, "invlpga" }, \
155 { SVM_EXIT_IOIO, "io" }, \
156 { SVM_EXIT_MSR, "msr" }, \
157 { SVM_EXIT_TASK_SWITCH, "task_switch" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700158 { SVM_EXIT_FERR_FREEZE, "ferr_freeze" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800159 { SVM_EXIT_SHUTDOWN, "shutdown" }, \
160 { SVM_EXIT_VMRUN, "vmrun" }, \
161 { SVM_EXIT_VMMCALL, "hypercall" }, \
162 { SVM_EXIT_VMLOAD, "vmload" }, \
163 { SVM_EXIT_VMSAVE, "vmsave" }, \
164 { SVM_EXIT_STGI, "stgi" }, \
165 { SVM_EXIT_CLGI, "clgi" }, \
166 { SVM_EXIT_SKINIT, "skinit" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700167 { SVM_EXIT_RDTSCP, "rdtscp" }, \
168 { SVM_EXIT_ICEBP, "icebp" }, \
Christopher Ferris0437c522013-11-07 14:16:29 -0800169 { SVM_EXIT_WBINVD, "wbinvd" }, \
170 { SVM_EXIT_MONITOR, "monitor" }, \
171 { SVM_EXIT_MWAIT, "mwait" }, \
172 { SVM_EXIT_XSETBV, "xsetbv" }, \
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700173 { SVM_EXIT_NPF, "npf" }, \
174 { SVM_EXIT_AVIC_INCOMPLETE_IPI, "avic_incomplete_ipi" }, \
175 { SVM_EXIT_AVIC_UNACCELERATED_ACCESS, "avic_unaccelerated_access" }, \
176 { SVM_EXIT_ERR, "invalid_guest_state" }
Christopher Ferris0437c522013-11-07 14:16:29 -0800177
178
179#endif /* _UAPI__SVM_H */