vmx.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * vmx.h: VMX Architecture related definitions
  3. * Copyright (c) 2004, Intel Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  16. * Place - Suite 330, Boston, MA 02111-1307 USA.
  17. *
  18. * A few random additions are:
  19. * Copyright (C) 2006 Qumranet
  20. * Avi Kivity <avi@qumranet.com>
  21. * Yaniv Kamay <yaniv@qumranet.com>
  22. *
  23. */
  24. #ifndef _UAPIVMX_H
  25. #define _UAPIVMX_H
  26. #define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000
  27. #define EXIT_REASON_EXCEPTION_NMI 0
  28. #define EXIT_REASON_EXTERNAL_INTERRUPT 1
  29. #define EXIT_REASON_TRIPLE_FAULT 2
  30. #define EXIT_REASON_PENDING_INTERRUPT 7
  31. #define EXIT_REASON_NMI_WINDOW 8
  32. #define EXIT_REASON_TASK_SWITCH 9
  33. #define EXIT_REASON_CPUID 10
  34. #define EXIT_REASON_HLT 12
  35. #define EXIT_REASON_INVD 13
  36. #define EXIT_REASON_INVLPG 14
  37. #define EXIT_REASON_RDPMC 15
  38. #define EXIT_REASON_RDTSC 16
  39. #define EXIT_REASON_VMCALL 18
  40. #define EXIT_REASON_VMCLEAR 19
  41. #define EXIT_REASON_VMLAUNCH 20
  42. #define EXIT_REASON_VMPTRLD 21
  43. #define EXIT_REASON_VMPTRST 22
  44. #define EXIT_REASON_VMREAD 23
  45. #define EXIT_REASON_VMRESUME 24
  46. #define EXIT_REASON_VMWRITE 25
  47. #define EXIT_REASON_VMOFF 26
  48. #define EXIT_REASON_VMON 27
  49. #define EXIT_REASON_CR_ACCESS 28
  50. #define EXIT_REASON_DR_ACCESS 29
  51. #define EXIT_REASON_IO_INSTRUCTION 30
  52. #define EXIT_REASON_MSR_READ 31
  53. #define EXIT_REASON_MSR_WRITE 32
  54. #define EXIT_REASON_INVALID_STATE 33
  55. #define EXIT_REASON_MSR_LOAD_FAIL 34
  56. #define EXIT_REASON_MWAIT_INSTRUCTION 36
  57. #define EXIT_REASON_MONITOR_TRAP_FLAG 37
  58. #define EXIT_REASON_MONITOR_INSTRUCTION 39
  59. #define EXIT_REASON_PAUSE_INSTRUCTION 40
  60. #define EXIT_REASON_MCE_DURING_VMENTRY 41
  61. #define EXIT_REASON_TPR_BELOW_THRESHOLD 43
  62. #define EXIT_REASON_APIC_ACCESS 44
  63. #define EXIT_REASON_EOI_INDUCED 45
  64. #define EXIT_REASON_EPT_VIOLATION 48
  65. #define EXIT_REASON_EPT_MISCONFIG 49
  66. #define EXIT_REASON_INVEPT 50
  67. #define EXIT_REASON_RDTSCP 51
  68. #define EXIT_REASON_PREEMPTION_TIMER 52
  69. #define EXIT_REASON_INVVPID 53
  70. #define EXIT_REASON_WBINVD 54
  71. #define EXIT_REASON_XSETBV 55
  72. #define EXIT_REASON_APIC_WRITE 56
  73. #define EXIT_REASON_INVPCID 58
  74. #define EXIT_REASON_PML_FULL 62
  75. #define EXIT_REASON_XSAVES 63
  76. #define EXIT_REASON_XRSTORS 64
  77. #define EXIT_REASON_PCOMMIT 65
  78. #define VMX_EXIT_REASONS \
  79. { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
  80. { EXIT_REASON_EXTERNAL_INTERRUPT, "EXTERNAL_INTERRUPT" }, \
  81. { EXIT_REASON_TRIPLE_FAULT, "TRIPLE_FAULT" }, \
  82. { EXIT_REASON_PENDING_INTERRUPT, "PENDING_INTERRUPT" }, \
  83. { EXIT_REASON_NMI_WINDOW, "NMI_WINDOW" }, \
  84. { EXIT_REASON_TASK_SWITCH, "TASK_SWITCH" }, \
  85. { EXIT_REASON_CPUID, "CPUID" }, \
  86. { EXIT_REASON_HLT, "HLT" }, \
  87. { EXIT_REASON_INVLPG, "INVLPG" }, \
  88. { EXIT_REASON_RDPMC, "RDPMC" }, \
  89. { EXIT_REASON_RDTSC, "RDTSC" }, \
  90. { EXIT_REASON_VMCALL, "VMCALL" }, \
  91. { EXIT_REASON_VMCLEAR, "VMCLEAR" }, \
  92. { EXIT_REASON_VMLAUNCH, "VMLAUNCH" }, \
  93. { EXIT_REASON_VMPTRLD, "VMPTRLD" }, \
  94. { EXIT_REASON_VMPTRST, "VMPTRST" }, \
  95. { EXIT_REASON_VMREAD, "VMREAD" }, \
  96. { EXIT_REASON_VMRESUME, "VMRESUME" }, \
  97. { EXIT_REASON_VMWRITE, "VMWRITE" }, \
  98. { EXIT_REASON_VMOFF, "VMOFF" }, \
  99. { EXIT_REASON_VMON, "VMON" }, \
  100. { EXIT_REASON_CR_ACCESS, "CR_ACCESS" }, \
  101. { EXIT_REASON_DR_ACCESS, "DR_ACCESS" }, \
  102. { EXIT_REASON_IO_INSTRUCTION, "IO_INSTRUCTION" }, \
  103. { EXIT_REASON_MSR_READ, "MSR_READ" }, \
  104. { EXIT_REASON_MSR_WRITE, "MSR_WRITE" }, \
  105. { EXIT_REASON_MWAIT_INSTRUCTION, "MWAIT_INSTRUCTION" }, \
  106. { EXIT_REASON_MONITOR_TRAP_FLAG, "MONITOR_TRAP_FLAG" }, \
  107. { EXIT_REASON_MONITOR_INSTRUCTION, "MONITOR_INSTRUCTION" }, \
  108. { EXIT_REASON_PAUSE_INSTRUCTION, "PAUSE_INSTRUCTION" }, \
  109. { EXIT_REASON_MCE_DURING_VMENTRY, "MCE_DURING_VMENTRY" }, \
  110. { EXIT_REASON_TPR_BELOW_THRESHOLD, "TPR_BELOW_THRESHOLD" }, \
  111. { EXIT_REASON_APIC_ACCESS, "APIC_ACCESS" }, \
  112. { EXIT_REASON_EPT_VIOLATION, "EPT_VIOLATION" }, \
  113. { EXIT_REASON_EPT_MISCONFIG, "EPT_MISCONFIG" }, \
  114. { EXIT_REASON_INVEPT, "INVEPT" }, \
  115. { EXIT_REASON_PREEMPTION_TIMER, "PREEMPTION_TIMER" }, \
  116. { EXIT_REASON_WBINVD, "WBINVD" }, \
  117. { EXIT_REASON_APIC_WRITE, "APIC_WRITE" }, \
  118. { EXIT_REASON_EOI_INDUCED, "EOI_INDUCED" }, \
  119. { EXIT_REASON_INVALID_STATE, "INVALID_STATE" }, \
  120. { EXIT_REASON_MSR_LOAD_FAIL, "MSR_LOAD_FAIL" }, \
  121. { EXIT_REASON_INVD, "INVD" }, \
  122. { EXIT_REASON_INVVPID, "INVVPID" }, \
  123. { EXIT_REASON_INVPCID, "INVPCID" }, \
  124. { EXIT_REASON_XSAVES, "XSAVES" }, \
  125. { EXIT_REASON_XRSTORS, "XRSTORS" }, \
  126. { EXIT_REASON_PCOMMIT, "PCOMMIT" }
  127. #define VMX_ABORT_SAVE_GUEST_MSR_FAIL 1
  128. #define VMX_ABORT_LOAD_HOST_MSR_FAIL 4
  129. #endif /* _UAPIVMX_H */