0001
0002 #ifndef _UAPI__SVM_H
0003 #define _UAPI__SVM_H
0004
0005 #define SVM_EXIT_READ_CR0 0x000
0006 #define SVM_EXIT_READ_CR2 0x002
0007 #define SVM_EXIT_READ_CR3 0x003
0008 #define SVM_EXIT_READ_CR4 0x004
0009 #define SVM_EXIT_READ_CR8 0x008
0010 #define SVM_EXIT_WRITE_CR0 0x010
0011 #define SVM_EXIT_WRITE_CR2 0x012
0012 #define SVM_EXIT_WRITE_CR3 0x013
0013 #define SVM_EXIT_WRITE_CR4 0x014
0014 #define SVM_EXIT_WRITE_CR8 0x018
0015 #define SVM_EXIT_READ_DR0 0x020
0016 #define SVM_EXIT_READ_DR1 0x021
0017 #define SVM_EXIT_READ_DR2 0x022
0018 #define SVM_EXIT_READ_DR3 0x023
0019 #define SVM_EXIT_READ_DR4 0x024
0020 #define SVM_EXIT_READ_DR5 0x025
0021 #define SVM_EXIT_READ_DR6 0x026
0022 #define SVM_EXIT_READ_DR7 0x027
0023 #define SVM_EXIT_WRITE_DR0 0x030
0024 #define SVM_EXIT_WRITE_DR1 0x031
0025 #define SVM_EXIT_WRITE_DR2 0x032
0026 #define SVM_EXIT_WRITE_DR3 0x033
0027 #define SVM_EXIT_WRITE_DR4 0x034
0028 #define SVM_EXIT_WRITE_DR5 0x035
0029 #define SVM_EXIT_WRITE_DR6 0x036
0030 #define SVM_EXIT_WRITE_DR7 0x037
0031 #define SVM_EXIT_EXCP_BASE 0x040
0032 #define SVM_EXIT_LAST_EXCP 0x05f
0033 #define SVM_EXIT_INTR 0x060
0034 #define SVM_EXIT_NMI 0x061
0035 #define SVM_EXIT_SMI 0x062
0036 #define SVM_EXIT_INIT 0x063
0037 #define SVM_EXIT_VINTR 0x064
0038 #define SVM_EXIT_CR0_SEL_WRITE 0x065
0039 #define SVM_EXIT_IDTR_READ 0x066
0040 #define SVM_EXIT_GDTR_READ 0x067
0041 #define SVM_EXIT_LDTR_READ 0x068
0042 #define SVM_EXIT_TR_READ 0x069
0043 #define SVM_EXIT_IDTR_WRITE 0x06a
0044 #define SVM_EXIT_GDTR_WRITE 0x06b
0045 #define SVM_EXIT_LDTR_WRITE 0x06c
0046 #define SVM_EXIT_TR_WRITE 0x06d
0047 #define SVM_EXIT_RDTSC 0x06e
0048 #define SVM_EXIT_RDPMC 0x06f
0049 #define SVM_EXIT_PUSHF 0x070
0050 #define SVM_EXIT_POPF 0x071
0051 #define SVM_EXIT_CPUID 0x072
0052 #define SVM_EXIT_RSM 0x073
0053 #define SVM_EXIT_IRET 0x074
0054 #define SVM_EXIT_SWINT 0x075
0055 #define SVM_EXIT_INVD 0x076
0056 #define SVM_EXIT_PAUSE 0x077
0057 #define SVM_EXIT_HLT 0x078
0058 #define SVM_EXIT_INVLPG 0x079
0059 #define SVM_EXIT_INVLPGA 0x07a
0060 #define SVM_EXIT_IOIO 0x07b
0061 #define SVM_EXIT_MSR 0x07c
0062 #define SVM_EXIT_TASK_SWITCH 0x07d
0063 #define SVM_EXIT_FERR_FREEZE 0x07e
0064 #define SVM_EXIT_SHUTDOWN 0x07f
0065 #define SVM_EXIT_VMRUN 0x080
0066 #define SVM_EXIT_VMMCALL 0x081
0067 #define SVM_EXIT_VMLOAD 0x082
0068 #define SVM_EXIT_VMSAVE 0x083
0069 #define SVM_EXIT_STGI 0x084
0070 #define SVM_EXIT_CLGI 0x085
0071 #define SVM_EXIT_SKINIT 0x086
0072 #define SVM_EXIT_RDTSCP 0x087
0073 #define SVM_EXIT_ICEBP 0x088
0074 #define SVM_EXIT_WBINVD 0x089
0075 #define SVM_EXIT_MONITOR 0x08a
0076 #define SVM_EXIT_MWAIT 0x08b
0077 #define SVM_EXIT_MWAIT_COND 0x08c
0078 #define SVM_EXIT_XSETBV 0x08d
0079 #define SVM_EXIT_RDPRU 0x08e
0080 #define SVM_EXIT_EFER_WRITE_TRAP 0x08f
0081 #define SVM_EXIT_CR0_WRITE_TRAP 0x090
0082 #define SVM_EXIT_CR1_WRITE_TRAP 0x091
0083 #define SVM_EXIT_CR2_WRITE_TRAP 0x092
0084 #define SVM_EXIT_CR3_WRITE_TRAP 0x093
0085 #define SVM_EXIT_CR4_WRITE_TRAP 0x094
0086 #define SVM_EXIT_CR5_WRITE_TRAP 0x095
0087 #define SVM_EXIT_CR6_WRITE_TRAP 0x096
0088 #define SVM_EXIT_CR7_WRITE_TRAP 0x097
0089 #define SVM_EXIT_CR8_WRITE_TRAP 0x098
0090 #define SVM_EXIT_CR9_WRITE_TRAP 0x099
0091 #define SVM_EXIT_CR10_WRITE_TRAP 0x09a
0092 #define SVM_EXIT_CR11_WRITE_TRAP 0x09b
0093 #define SVM_EXIT_CR12_WRITE_TRAP 0x09c
0094 #define SVM_EXIT_CR13_WRITE_TRAP 0x09d
0095 #define SVM_EXIT_CR14_WRITE_TRAP 0x09e
0096 #define SVM_EXIT_CR15_WRITE_TRAP 0x09f
0097 #define SVM_EXIT_INVPCID 0x0a2
0098 #define SVM_EXIT_NPF 0x400
0099 #define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401
0100 #define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402
0101 #define SVM_EXIT_VMGEXIT 0x403
0102
0103
0104 #define SVM_VMGEXIT_MMIO_READ 0x80000001
0105 #define SVM_VMGEXIT_MMIO_WRITE 0x80000002
0106 #define SVM_VMGEXIT_NMI_COMPLETE 0x80000003
0107 #define SVM_VMGEXIT_AP_HLT_LOOP 0x80000004
0108 #define SVM_VMGEXIT_AP_JUMP_TABLE 0x80000005
0109 #define SVM_VMGEXIT_SET_AP_JUMP_TABLE 0
0110 #define SVM_VMGEXIT_GET_AP_JUMP_TABLE 1
0111 #define SVM_VMGEXIT_PSC 0x80000010
0112 #define SVM_VMGEXIT_GUEST_REQUEST 0x80000011
0113 #define SVM_VMGEXIT_EXT_GUEST_REQUEST 0x80000012
0114 #define SVM_VMGEXIT_AP_CREATION 0x80000013
0115 #define SVM_VMGEXIT_AP_CREATE_ON_INIT 0
0116 #define SVM_VMGEXIT_AP_CREATE 1
0117 #define SVM_VMGEXIT_AP_DESTROY 2
0118 #define SVM_VMGEXIT_HV_FEATURES 0x8000fffd
0119 #define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff
0120
0121
0122 #define SVM_EXIT_SW 0xf0000000
0123
0124 #define SVM_EXIT_ERR -1
0125
0126 #define SVM_EXIT_REASONS \
0127 { SVM_EXIT_READ_CR0, "read_cr0" }, \
0128 { SVM_EXIT_READ_CR2, "read_cr2" }, \
0129 { SVM_EXIT_READ_CR3, "read_cr3" }, \
0130 { SVM_EXIT_READ_CR4, "read_cr4" }, \
0131 { SVM_EXIT_READ_CR8, "read_cr8" }, \
0132 { SVM_EXIT_WRITE_CR0, "write_cr0" }, \
0133 { SVM_EXIT_WRITE_CR2, "write_cr2" }, \
0134 { SVM_EXIT_WRITE_CR3, "write_cr3" }, \
0135 { SVM_EXIT_WRITE_CR4, "write_cr4" }, \
0136 { SVM_EXIT_WRITE_CR8, "write_cr8" }, \
0137 { SVM_EXIT_READ_DR0, "read_dr0" }, \
0138 { SVM_EXIT_READ_DR1, "read_dr1" }, \
0139 { SVM_EXIT_READ_DR2, "read_dr2" }, \
0140 { SVM_EXIT_READ_DR3, "read_dr3" }, \
0141 { SVM_EXIT_READ_DR4, "read_dr4" }, \
0142 { SVM_EXIT_READ_DR5, "read_dr5" }, \
0143 { SVM_EXIT_READ_DR6, "read_dr6" }, \
0144 { SVM_EXIT_READ_DR7, "read_dr7" }, \
0145 { SVM_EXIT_WRITE_DR0, "write_dr0" }, \
0146 { SVM_EXIT_WRITE_DR1, "write_dr1" }, \
0147 { SVM_EXIT_WRITE_DR2, "write_dr2" }, \
0148 { SVM_EXIT_WRITE_DR3, "write_dr3" }, \
0149 { SVM_EXIT_WRITE_DR4, "write_dr4" }, \
0150 { SVM_EXIT_WRITE_DR5, "write_dr5" }, \
0151 { SVM_EXIT_WRITE_DR6, "write_dr6" }, \
0152 { SVM_EXIT_WRITE_DR7, "write_dr7" }, \
0153 { SVM_EXIT_EXCP_BASE + DE_VECTOR, "DE excp" }, \
0154 { SVM_EXIT_EXCP_BASE + DB_VECTOR, "DB excp" }, \
0155 { SVM_EXIT_EXCP_BASE + BP_VECTOR, "BP excp" }, \
0156 { SVM_EXIT_EXCP_BASE + OF_VECTOR, "OF excp" }, \
0157 { SVM_EXIT_EXCP_BASE + BR_VECTOR, "BR excp" }, \
0158 { SVM_EXIT_EXCP_BASE + UD_VECTOR, "UD excp" }, \
0159 { SVM_EXIT_EXCP_BASE + NM_VECTOR, "NM excp" }, \
0160 { SVM_EXIT_EXCP_BASE + DF_VECTOR, "DF excp" }, \
0161 { SVM_EXIT_EXCP_BASE + TS_VECTOR, "TS excp" }, \
0162 { SVM_EXIT_EXCP_BASE + NP_VECTOR, "NP excp" }, \
0163 { SVM_EXIT_EXCP_BASE + SS_VECTOR, "SS excp" }, \
0164 { SVM_EXIT_EXCP_BASE + GP_VECTOR, "GP excp" }, \
0165 { SVM_EXIT_EXCP_BASE + PF_VECTOR, "PF excp" }, \
0166 { SVM_EXIT_EXCP_BASE + MF_VECTOR, "MF excp" }, \
0167 { SVM_EXIT_EXCP_BASE + AC_VECTOR, "AC excp" }, \
0168 { SVM_EXIT_EXCP_BASE + MC_VECTOR, "MC excp" }, \
0169 { SVM_EXIT_EXCP_BASE + XM_VECTOR, "XF excp" }, \
0170 { SVM_EXIT_INTR, "interrupt" }, \
0171 { SVM_EXIT_NMI, "nmi" }, \
0172 { SVM_EXIT_SMI, "smi" }, \
0173 { SVM_EXIT_INIT, "init" }, \
0174 { SVM_EXIT_VINTR, "vintr" }, \
0175 { SVM_EXIT_CR0_SEL_WRITE, "cr0_sel_write" }, \
0176 { SVM_EXIT_IDTR_READ, "read_idtr" }, \
0177 { SVM_EXIT_GDTR_READ, "read_gdtr" }, \
0178 { SVM_EXIT_LDTR_READ, "read_ldtr" }, \
0179 { SVM_EXIT_TR_READ, "read_rt" }, \
0180 { SVM_EXIT_IDTR_WRITE, "write_idtr" }, \
0181 { SVM_EXIT_GDTR_WRITE, "write_gdtr" }, \
0182 { SVM_EXIT_LDTR_WRITE, "write_ldtr" }, \
0183 { SVM_EXIT_TR_WRITE, "write_rt" }, \
0184 { SVM_EXIT_RDTSC, "rdtsc" }, \
0185 { SVM_EXIT_RDPMC, "rdpmc" }, \
0186 { SVM_EXIT_PUSHF, "pushf" }, \
0187 { SVM_EXIT_POPF, "popf" }, \
0188 { SVM_EXIT_CPUID, "cpuid" }, \
0189 { SVM_EXIT_RSM, "rsm" }, \
0190 { SVM_EXIT_IRET, "iret" }, \
0191 { SVM_EXIT_SWINT, "swint" }, \
0192 { SVM_EXIT_INVD, "invd" }, \
0193 { SVM_EXIT_PAUSE, "pause" }, \
0194 { SVM_EXIT_HLT, "hlt" }, \
0195 { SVM_EXIT_INVLPG, "invlpg" }, \
0196 { SVM_EXIT_INVLPGA, "invlpga" }, \
0197 { SVM_EXIT_IOIO, "io" }, \
0198 { SVM_EXIT_MSR, "msr" }, \
0199 { SVM_EXIT_TASK_SWITCH, "task_switch" }, \
0200 { SVM_EXIT_FERR_FREEZE, "ferr_freeze" }, \
0201 { SVM_EXIT_SHUTDOWN, "shutdown" }, \
0202 { SVM_EXIT_VMRUN, "vmrun" }, \
0203 { SVM_EXIT_VMMCALL, "hypercall" }, \
0204 { SVM_EXIT_VMLOAD, "vmload" }, \
0205 { SVM_EXIT_VMSAVE, "vmsave" }, \
0206 { SVM_EXIT_STGI, "stgi" }, \
0207 { SVM_EXIT_CLGI, "clgi" }, \
0208 { SVM_EXIT_SKINIT, "skinit" }, \
0209 { SVM_EXIT_RDTSCP, "rdtscp" }, \
0210 { SVM_EXIT_ICEBP, "icebp" }, \
0211 { SVM_EXIT_WBINVD, "wbinvd" }, \
0212 { SVM_EXIT_MONITOR, "monitor" }, \
0213 { SVM_EXIT_MWAIT, "mwait" }, \
0214 { SVM_EXIT_XSETBV, "xsetbv" }, \
0215 { SVM_EXIT_EFER_WRITE_TRAP, "write_efer_trap" }, \
0216 { SVM_EXIT_CR0_WRITE_TRAP, "write_cr0_trap" }, \
0217 { SVM_EXIT_CR4_WRITE_TRAP, "write_cr4_trap" }, \
0218 { SVM_EXIT_CR8_WRITE_TRAP, "write_cr8_trap" }, \
0219 { SVM_EXIT_INVPCID, "invpcid" }, \
0220 { SVM_EXIT_NPF, "npf" }, \
0221 { SVM_EXIT_AVIC_INCOMPLETE_IPI, "avic_incomplete_ipi" }, \
0222 { SVM_EXIT_AVIC_UNACCELERATED_ACCESS, "avic_unaccelerated_access" }, \
0223 { SVM_EXIT_VMGEXIT, "vmgexit" }, \
0224 { SVM_VMGEXIT_MMIO_READ, "vmgexit_mmio_read" }, \
0225 { SVM_VMGEXIT_MMIO_WRITE, "vmgexit_mmio_write" }, \
0226 { SVM_VMGEXIT_NMI_COMPLETE, "vmgexit_nmi_complete" }, \
0227 { SVM_VMGEXIT_AP_HLT_LOOP, "vmgexit_ap_hlt_loop" }, \
0228 { SVM_VMGEXIT_AP_JUMP_TABLE, "vmgexit_ap_jump_table" }, \
0229 { SVM_VMGEXIT_PSC, "vmgexit_page_state_change" }, \
0230 { SVM_VMGEXIT_GUEST_REQUEST, "vmgexit_guest_request" }, \
0231 { SVM_VMGEXIT_EXT_GUEST_REQUEST, "vmgexit_ext_guest_request" }, \
0232 { SVM_VMGEXIT_AP_CREATION, "vmgexit_ap_creation" }, \
0233 { SVM_VMGEXIT_HV_FEATURES, "vmgexit_hypervisor_feature" }, \
0234 { SVM_EXIT_ERR, "invalid_guest_state" }
0235
0236
0237 #endif