Path: blob/master/tools/arch/x86/include/uapi/asm/svm.h
25928 views
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1#ifndef _UAPI__SVM_H2#define _UAPI__SVM_H34#define SVM_EXIT_READ_CR0 0x0005#define SVM_EXIT_READ_CR2 0x0026#define SVM_EXIT_READ_CR3 0x0037#define SVM_EXIT_READ_CR4 0x0048#define SVM_EXIT_READ_CR8 0x0089#define SVM_EXIT_WRITE_CR0 0x01010#define SVM_EXIT_WRITE_CR2 0x01211#define SVM_EXIT_WRITE_CR3 0x01312#define SVM_EXIT_WRITE_CR4 0x01413#define SVM_EXIT_WRITE_CR8 0x01814#define SVM_EXIT_READ_DR0 0x02015#define SVM_EXIT_READ_DR1 0x02116#define SVM_EXIT_READ_DR2 0x02217#define SVM_EXIT_READ_DR3 0x02318#define SVM_EXIT_READ_DR4 0x02419#define SVM_EXIT_READ_DR5 0x02520#define SVM_EXIT_READ_DR6 0x02621#define SVM_EXIT_READ_DR7 0x02722#define SVM_EXIT_WRITE_DR0 0x03023#define SVM_EXIT_WRITE_DR1 0x03124#define SVM_EXIT_WRITE_DR2 0x03225#define SVM_EXIT_WRITE_DR3 0x03326#define SVM_EXIT_WRITE_DR4 0x03427#define SVM_EXIT_WRITE_DR5 0x03528#define SVM_EXIT_WRITE_DR6 0x03629#define SVM_EXIT_WRITE_DR7 0x03730#define SVM_EXIT_EXCP_BASE 0x04031#define SVM_EXIT_LAST_EXCP 0x05f32#define SVM_EXIT_INTR 0x06033#define SVM_EXIT_NMI 0x06134#define SVM_EXIT_SMI 0x06235#define SVM_EXIT_INIT 0x06336#define SVM_EXIT_VINTR 0x06437#define SVM_EXIT_CR0_SEL_WRITE 0x06538#define SVM_EXIT_IDTR_READ 0x06639#define SVM_EXIT_GDTR_READ 0x06740#define SVM_EXIT_LDTR_READ 0x06841#define SVM_EXIT_TR_READ 0x06942#define SVM_EXIT_IDTR_WRITE 0x06a43#define SVM_EXIT_GDTR_WRITE 0x06b44#define SVM_EXIT_LDTR_WRITE 0x06c45#define SVM_EXIT_TR_WRITE 0x06d46#define SVM_EXIT_RDTSC 0x06e47#define SVM_EXIT_RDPMC 0x06f48#define SVM_EXIT_PUSHF 0x07049#define SVM_EXIT_POPF 0x07150#define SVM_EXIT_CPUID 0x07251#define SVM_EXIT_RSM 0x07352#define SVM_EXIT_IRET 0x07453#define SVM_EXIT_SWINT 0x07554#define SVM_EXIT_INVD 0x07655#define SVM_EXIT_PAUSE 0x07756#define SVM_EXIT_HLT 0x07857#define SVM_EXIT_INVLPG 0x07958#define SVM_EXIT_INVLPGA 0x07a59#define SVM_EXIT_IOIO 0x07b60#define SVM_EXIT_MSR 0x07c61#define SVM_EXIT_TASK_SWITCH 0x07d62#define SVM_EXIT_FERR_FREEZE 0x07e63#define SVM_EXIT_SHUTDOWN 0x07f64#define SVM_EXIT_VMRUN 0x08065#define SVM_EXIT_VMMCALL 0x08166#define SVM_EXIT_VMLOAD 0x08267#define SVM_EXIT_VMSAVE 0x08368#define SVM_EXIT_STGI 0x08469#define SVM_EXIT_CLGI 0x08570#define SVM_EXIT_SKINIT 0x08671#define SVM_EXIT_RDTSCP 0x08772#define SVM_EXIT_ICEBP 0x08873#define SVM_EXIT_WBINVD 0x08974#define SVM_EXIT_MONITOR 0x08a75#define SVM_EXIT_MWAIT 0x08b76#define SVM_EXIT_MWAIT_COND 0x08c77#define SVM_EXIT_XSETBV 0x08d78#define SVM_EXIT_RDPRU 0x08e79#define SVM_EXIT_EFER_WRITE_TRAP 0x08f80#define SVM_EXIT_CR0_WRITE_TRAP 0x09081#define SVM_EXIT_CR1_WRITE_TRAP 0x09182#define SVM_EXIT_CR2_WRITE_TRAP 0x09283#define SVM_EXIT_CR3_WRITE_TRAP 0x09384#define SVM_EXIT_CR4_WRITE_TRAP 0x09485#define SVM_EXIT_CR5_WRITE_TRAP 0x09586#define SVM_EXIT_CR6_WRITE_TRAP 0x09687#define SVM_EXIT_CR7_WRITE_TRAP 0x09788#define SVM_EXIT_CR8_WRITE_TRAP 0x09889#define SVM_EXIT_CR9_WRITE_TRAP 0x09990#define SVM_EXIT_CR10_WRITE_TRAP 0x09a91#define SVM_EXIT_CR11_WRITE_TRAP 0x09b92#define SVM_EXIT_CR12_WRITE_TRAP 0x09c93#define SVM_EXIT_CR13_WRITE_TRAP 0x09d94#define SVM_EXIT_CR14_WRITE_TRAP 0x09e95#define SVM_EXIT_CR15_WRITE_TRAP 0x09f96#define SVM_EXIT_INVPCID 0x0a297#define SVM_EXIT_BUS_LOCK 0x0a598#define SVM_EXIT_IDLE_HLT 0x0a699#define SVM_EXIT_NPF 0x400100#define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401101#define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402102#define SVM_EXIT_VMGEXIT 0x403103104/* SEV-ES software-defined VMGEXIT events */105#define SVM_VMGEXIT_MMIO_READ 0x80000001106#define SVM_VMGEXIT_MMIO_WRITE 0x80000002107#define SVM_VMGEXIT_NMI_COMPLETE 0x80000003108#define SVM_VMGEXIT_AP_HLT_LOOP 0x80000004109#define SVM_VMGEXIT_AP_JUMP_TABLE 0x80000005110#define SVM_VMGEXIT_SET_AP_JUMP_TABLE 0111#define SVM_VMGEXIT_GET_AP_JUMP_TABLE 1112#define SVM_VMGEXIT_PSC 0x80000010113#define SVM_VMGEXIT_GUEST_REQUEST 0x80000011114#define SVM_VMGEXIT_EXT_GUEST_REQUEST 0x80000012115#define SVM_VMGEXIT_AP_CREATION 0x80000013116#define SVM_VMGEXIT_AP_CREATE_ON_INIT 0117#define SVM_VMGEXIT_AP_CREATE 1118#define SVM_VMGEXIT_AP_DESTROY 2119#define SVM_VMGEXIT_SNP_RUN_VMPL 0x80000018120#define SVM_VMGEXIT_HV_FEATURES 0x8000fffd121#define SVM_VMGEXIT_TERM_REQUEST 0x8000fffe122#define SVM_VMGEXIT_TERM_REASON(reason_set, reason_code) \123/* SW_EXITINFO1[3:0] */ \124(((((u64)reason_set) & 0xf)) | \125/* SW_EXITINFO1[11:4] */ \126((((u64)reason_code) & 0xff) << 4))127#define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff128129/* Exit code reserved for hypervisor/software use */130#define SVM_EXIT_SW 0xf0000000131132#define SVM_EXIT_ERR -1133134#define SVM_EXIT_REASONS \135{ SVM_EXIT_READ_CR0, "read_cr0" }, \136{ SVM_EXIT_READ_CR2, "read_cr2" }, \137{ SVM_EXIT_READ_CR3, "read_cr3" }, \138{ SVM_EXIT_READ_CR4, "read_cr4" }, \139{ SVM_EXIT_READ_CR8, "read_cr8" }, \140{ SVM_EXIT_WRITE_CR0, "write_cr0" }, \141{ SVM_EXIT_WRITE_CR2, "write_cr2" }, \142{ SVM_EXIT_WRITE_CR3, "write_cr3" }, \143{ SVM_EXIT_WRITE_CR4, "write_cr4" }, \144{ SVM_EXIT_WRITE_CR8, "write_cr8" }, \145{ SVM_EXIT_READ_DR0, "read_dr0" }, \146{ SVM_EXIT_READ_DR1, "read_dr1" }, \147{ SVM_EXIT_READ_DR2, "read_dr2" }, \148{ SVM_EXIT_READ_DR3, "read_dr3" }, \149{ SVM_EXIT_READ_DR4, "read_dr4" }, \150{ SVM_EXIT_READ_DR5, "read_dr5" }, \151{ SVM_EXIT_READ_DR6, "read_dr6" }, \152{ SVM_EXIT_READ_DR7, "read_dr7" }, \153{ SVM_EXIT_WRITE_DR0, "write_dr0" }, \154{ SVM_EXIT_WRITE_DR1, "write_dr1" }, \155{ SVM_EXIT_WRITE_DR2, "write_dr2" }, \156{ SVM_EXIT_WRITE_DR3, "write_dr3" }, \157{ SVM_EXIT_WRITE_DR4, "write_dr4" }, \158{ SVM_EXIT_WRITE_DR5, "write_dr5" }, \159{ SVM_EXIT_WRITE_DR6, "write_dr6" }, \160{ SVM_EXIT_WRITE_DR7, "write_dr7" }, \161{ SVM_EXIT_EXCP_BASE + DE_VECTOR, "DE excp" }, \162{ SVM_EXIT_EXCP_BASE + DB_VECTOR, "DB excp" }, \163{ SVM_EXIT_EXCP_BASE + BP_VECTOR, "BP excp" }, \164{ SVM_EXIT_EXCP_BASE + OF_VECTOR, "OF excp" }, \165{ SVM_EXIT_EXCP_BASE + BR_VECTOR, "BR excp" }, \166{ SVM_EXIT_EXCP_BASE + UD_VECTOR, "UD excp" }, \167{ SVM_EXIT_EXCP_BASE + NM_VECTOR, "NM excp" }, \168{ SVM_EXIT_EXCP_BASE + DF_VECTOR, "DF excp" }, \169{ SVM_EXIT_EXCP_BASE + TS_VECTOR, "TS excp" }, \170{ SVM_EXIT_EXCP_BASE + NP_VECTOR, "NP excp" }, \171{ SVM_EXIT_EXCP_BASE + SS_VECTOR, "SS excp" }, \172{ SVM_EXIT_EXCP_BASE + GP_VECTOR, "GP excp" }, \173{ SVM_EXIT_EXCP_BASE + PF_VECTOR, "PF excp" }, \174{ SVM_EXIT_EXCP_BASE + MF_VECTOR, "MF excp" }, \175{ SVM_EXIT_EXCP_BASE + AC_VECTOR, "AC excp" }, \176{ SVM_EXIT_EXCP_BASE + MC_VECTOR, "MC excp" }, \177{ SVM_EXIT_EXCP_BASE + XM_VECTOR, "XF excp" }, \178{ SVM_EXIT_INTR, "interrupt" }, \179{ SVM_EXIT_NMI, "nmi" }, \180{ SVM_EXIT_SMI, "smi" }, \181{ SVM_EXIT_INIT, "init" }, \182{ SVM_EXIT_VINTR, "vintr" }, \183{ SVM_EXIT_CR0_SEL_WRITE, "cr0_sel_write" }, \184{ SVM_EXIT_IDTR_READ, "read_idtr" }, \185{ SVM_EXIT_GDTR_READ, "read_gdtr" }, \186{ SVM_EXIT_LDTR_READ, "read_ldtr" }, \187{ SVM_EXIT_TR_READ, "read_rt" }, \188{ SVM_EXIT_IDTR_WRITE, "write_idtr" }, \189{ SVM_EXIT_GDTR_WRITE, "write_gdtr" }, \190{ SVM_EXIT_LDTR_WRITE, "write_ldtr" }, \191{ SVM_EXIT_TR_WRITE, "write_rt" }, \192{ SVM_EXIT_RDTSC, "rdtsc" }, \193{ SVM_EXIT_RDPMC, "rdpmc" }, \194{ SVM_EXIT_PUSHF, "pushf" }, \195{ SVM_EXIT_POPF, "popf" }, \196{ SVM_EXIT_CPUID, "cpuid" }, \197{ SVM_EXIT_RSM, "rsm" }, \198{ SVM_EXIT_IRET, "iret" }, \199{ SVM_EXIT_SWINT, "swint" }, \200{ SVM_EXIT_INVD, "invd" }, \201{ SVM_EXIT_PAUSE, "pause" }, \202{ SVM_EXIT_HLT, "hlt" }, \203{ SVM_EXIT_INVLPG, "invlpg" }, \204{ SVM_EXIT_INVLPGA, "invlpga" }, \205{ SVM_EXIT_IOIO, "io" }, \206{ SVM_EXIT_MSR, "msr" }, \207{ SVM_EXIT_TASK_SWITCH, "task_switch" }, \208{ SVM_EXIT_FERR_FREEZE, "ferr_freeze" }, \209{ SVM_EXIT_SHUTDOWN, "shutdown" }, \210{ SVM_EXIT_VMRUN, "vmrun" }, \211{ SVM_EXIT_VMMCALL, "hypercall" }, \212{ SVM_EXIT_VMLOAD, "vmload" }, \213{ SVM_EXIT_VMSAVE, "vmsave" }, \214{ SVM_EXIT_STGI, "stgi" }, \215{ SVM_EXIT_CLGI, "clgi" }, \216{ SVM_EXIT_SKINIT, "skinit" }, \217{ SVM_EXIT_RDTSCP, "rdtscp" }, \218{ SVM_EXIT_ICEBP, "icebp" }, \219{ SVM_EXIT_WBINVD, "wbinvd" }, \220{ SVM_EXIT_MONITOR, "monitor" }, \221{ SVM_EXIT_MWAIT, "mwait" }, \222{ SVM_EXIT_XSETBV, "xsetbv" }, \223{ SVM_EXIT_EFER_WRITE_TRAP, "write_efer_trap" }, \224{ SVM_EXIT_CR0_WRITE_TRAP, "write_cr0_trap" }, \225{ SVM_EXIT_CR4_WRITE_TRAP, "write_cr4_trap" }, \226{ SVM_EXIT_CR8_WRITE_TRAP, "write_cr8_trap" }, \227{ SVM_EXIT_INVPCID, "invpcid" }, \228{ SVM_EXIT_BUS_LOCK, "buslock" }, \229{ SVM_EXIT_IDLE_HLT, "idle-halt" }, \230{ SVM_EXIT_NPF, "npf" }, \231{ SVM_EXIT_AVIC_INCOMPLETE_IPI, "avic_incomplete_ipi" }, \232{ SVM_EXIT_AVIC_UNACCELERATED_ACCESS, "avic_unaccelerated_access" }, \233{ SVM_EXIT_VMGEXIT, "vmgexit" }, \234{ SVM_VMGEXIT_MMIO_READ, "vmgexit_mmio_read" }, \235{ SVM_VMGEXIT_MMIO_WRITE, "vmgexit_mmio_write" }, \236{ SVM_VMGEXIT_NMI_COMPLETE, "vmgexit_nmi_complete" }, \237{ SVM_VMGEXIT_AP_HLT_LOOP, "vmgexit_ap_hlt_loop" }, \238{ SVM_VMGEXIT_AP_JUMP_TABLE, "vmgexit_ap_jump_table" }, \239{ SVM_VMGEXIT_PSC, "vmgexit_page_state_change" }, \240{ SVM_VMGEXIT_GUEST_REQUEST, "vmgexit_guest_request" }, \241{ SVM_VMGEXIT_EXT_GUEST_REQUEST, "vmgexit_ext_guest_request" }, \242{ SVM_VMGEXIT_AP_CREATION, "vmgexit_ap_creation" }, \243{ SVM_VMGEXIT_HV_FEATURES, "vmgexit_hypervisor_feature" }, \244{ SVM_EXIT_ERR, "invalid_guest_state" }245246247#endif /* _UAPI__SVM_H */248249250