Changeset 72854 in vbox for trunk/include
- Timestamp:
- Jul 4, 2018 7:46:06 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123399
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/hm_vmx.h
r72750 r72854 735 735 /** @} */ 736 736 737 /** VMX VPID flush types. 737 /** 738 * VMX VPID flush types. 738 739 * @note Valid enum members are in accordance to the VT-x spec. 739 740 */ … … 755 756 AssertCompileSize(VMXFLUSHVPID, 4); 756 757 757 /** VMX EPT flush types. 758 /** 759 * VMX EPT flush types. 758 760 * @note Valid enums values are in accordance to the VT-x spec. 759 761 */ … … 771 773 AssertCompileSize(VMXFLUSHEPT, 4); 772 774 773 /** VMX Posted Interrupt Descriptor. 775 /** 776 * VMX Posted Interrupt Descriptor. 774 777 * In accordance to the VT-x spec. 775 778 */ … … 788 791 typedef const VMXPOSTEDINTRDESC *PCVMXPOSTEDINTRDESC; 789 792 790 /** VMX MSR autoload/store element. 793 /** 794 * VMX MSR autoload/store element. 791 795 * In accordance to the VT-x spec. 792 796 */ … … 807 811 808 812 /** 809 * VMX-capability qword 813 * VMX-capability qword. 810 814 */ 811 815 typedef union … … 828 832 typedef struct VMXMSRS 829 833 { 830 uint64_t 831 uint64_t 832 VMXCAPABILITY 833 VMXCAPABILITY 834 VMXCAPABILITY 835 VMXCAPABILITY 836 VMXCAPABILITY 837 uint64_t 838 uint64_t 839 uint64_t 840 uint64_t 841 uint64_t 842 uint64_t 843 uint64_t 844 uint64_t 834 uint64_t u64FeatureCtrl; 835 uint64_t u64BasicInfo; 836 VMXCAPABILITY VmxPinCtls; 837 VMXCAPABILITY VmxProcCtls; 838 VMXCAPABILITY VmxProcCtls2; 839 VMXCAPABILITY VmxExit; 840 VMXCAPABILITY VmxEntry; 841 uint64_t u64Misc; 842 uint64_t u64Cr0Fixed0; 843 uint64_t u64Cr0Fixed1; 844 uint64_t u64Cr4Fixed0; 845 uint64_t u64Cr4Fixed1; 846 uint64_t u64VmcsEnum; 847 uint64_t u64Vmfunc; 848 uint64_t u64EptVpidCaps; 845 849 } VMXMSRS; 846 850 AssertCompileSizeAlignment(VMXMSRS, 8); 847 851 /** Pointer to a VMXMSRS struct. */ 848 852 typedef VMXMSRS *PVMXMSRS; 849 850 /** @name VMX EFLAGS reserved bits.851 * @{852 */853 /** And-mask for setting reserved bits to zero */854 #define VMX_EFLAGS_RESERVED_0 (X86_EFL_1 | X86_EFL_LIVE_MASK)855 /** Or-mask for setting reserved bits to 1 */856 #define VMX_EFLAGS_RESERVED_1 X86_EFL_1857 /** @} */858 853 859 854 /** @name VMX Basic Exit Reasons. … … 944 939 /** 43 TPR below threshold. Guest software executed MOV to CR8. */ 945 940 #define VMX_EXIT_TPR_BELOW_THRESHOLD 43 946 /** 44 APIC access. Guest software attempted to access memory at a physical address on the APIC-access page. */ 941 /** 44 APIC access. Guest software attempted to access memory at a physical 942 * address on the APIC-access page. */ 947 943 #define VMX_EXIT_APIC_ACCESS 44 948 /** 45 Virtualized EOI. EOI virtualization was performed for a virtual interrupt949 whose vector indexed a bit set in the EOI-exit bitmap. */944 /** 45 Virtualized EOI. EOI virtualization was performed for a virtual 945 * interrupt whose vector indexed a bit set in the EOI-exit bitmap. */ 950 946 #define VMX_EXIT_VIRTUALIZED_EOI 45 951 /** 46 Access to GDTR or IDTR. Guest software attempted to execute LGDT, LIDT, SGDT, or SIDT. */ 947 /** 46 Access to GDTR or IDTR. Guest software attempted to execute LGDT, LIDT, 948 * SGDT, or SIDT. */ 952 949 #define VMX_EXIT_XDTR_ACCESS 46 953 /** 47 Access to LDTR or TR. Guest software attempted to execute LLDT, LTR, SLDT, or STR. */ 950 /** 47 Access to LDTR or TR. Guest software attempted to execute LLDT, LTR, 951 * SLDT, or STR. */ 954 952 #define VMX_EXIT_TR_ACCESS 47 955 /** 48 EPT violation. An attempt to access memory with a guest-physical address was disallowed by the configuration of the EPT paging structures. */ 953 /** 48 EPT violation. An attempt to access memory with a guest-physical address 954 * was disallowed by the configuration of the EPT paging structures. */ 956 955 #define VMX_EXIT_EPT_VIOLATION 48 957 /** 49 EPT misconfiguration. An attempt to access memory with a guest-physical address encountered a misconfigured EPT paging-structure entry. */ 956 /** 49 EPT misconfiguration. An attempt to access memory with a guest-physical 957 * address encountered a misconfigured EPT paging-structure entry. */ 958 958 #define VMX_EXIT_EPT_MISCONFIG 49 959 959 /** 50 INVEPT. Guest software attempted to execute INVEPT. */ … … 1064 1064 */ 1065 1065 #define MSR_IA32_VMX_BASIC_INFO_VMCS_PHYS_WIDTH(a) (((a) >> 48) & 1) 1066 /** Whether the processor supports the dual-monitor treatment of system-management interrupts and system-management code. (always 1) */ 1066 /** Whether the processor supports the dual-monitor treatment of 1067 * system-management interrupts and system-management code. (always 1) */ 1067 1068 #define MSR_IA32_VMX_BASIC_INFO_VMCS_DUAL_MON(a) (((a) >> 49) & 1) 1068 1069 /** Memory type that must be used for the VMCS. */ 1069 1070 #define MSR_IA32_VMX_BASIC_INFO_VMCS_MEM_TYPE(a) (((a) >> 50) & 0xF) 1070 /** Whether the processor provides additional information for exits due to INS/OUTS. */ 1071 /** Whether the processor provides additional information for exits due to 1072 * INS/OUTS. */ 1071 1073 #define MSR_IA32_VMX_BASIC_INFO_VMCS_INS_OUTS(a) ((a) & RT_BIT_64(54)) 1072 1074 /** Whether default 1 bits in control MSRs (pin/proc/exit/entry) may be … … 1079 1081 * @{ 1080 1082 */ 1081 /** Relationship between the preemption timer and tsc; count down every time bit x of the tsc changes. */ 1083 /** Relationship between the preemption timer and tsc; count down every time bit 1084 * x of the tsc changes. */ 1082 1085 #define MSR_IA32_VMX_MISC_PREEMPT_TSC_BIT(a) ((a) & 0x1f) 1083 1086 /** Whether VM-exit stores EFER.LMA into the "IA32e mode guest" field. */ … … 1145 1148 1146 1149 1147 /** @name VMCS field encoding - 16 bits guest fields1150 /** @name VMCS field encoding: 16-bit guest fields. 1148 1151 * @{ 1149 1152 */ … … 1162 1165 /** @} */ 1163 1166 1164 /** @name VMCS field encoding - 16 bits host fields1167 /** @name VMCS field encoding: 16-bits host fields. 1165 1168 * @{ 1166 1169 */ … … 1174 1177 /** @} */ 1175 1178 1176 /** @name VMCS field encoding - 64 bits host fields1179 /** @name VMCS field encoding: 64-bit host fields. 1177 1180 * @{ 1178 1181 */ … … 1186 1189 1187 1190 1188 /** @name VMCS field encoding - 64 Bits control fields1191 /** @name VMCS field encoding: 64-bit control fields. 1189 1192 * @{ 1190 1193 */ … … 1193 1196 #define VMX_VMCS64_CTRL_IO_BITMAP_B_FULL 0x2002 1194 1197 #define VMX_VMCS64_CTRL_IO_BITMAP_B_HIGH 0x2003 1195 1196 /* Optional */1197 1198 #define VMX_VMCS64_CTRL_MSR_BITMAP_FULL 0x2004 1198 1199 #define VMX_VMCS64_CTRL_MSR_BITMAP_HIGH 0x2005 1199 1200 1200 #define VMX_VMCS64_CTRL_EXIT_MSR_STORE_FULL 0x2006 1201 1201 #define VMX_VMCS64_CTRL_EXIT_MSR_STORE_HIGH 0x2007 1202 1202 #define VMX_VMCS64_CTRL_EXIT_MSR_LOAD_FULL 0x2008 1203 1203 #define VMX_VMCS64_CTRL_EXIT_MSR_LOAD_HIGH 0x2009 1204 1205 1204 #define VMX_VMCS64_CTRL_ENTRY_MSR_LOAD_FULL 0x200A 1206 1205 #define VMX_VMCS64_CTRL_ENTRY_MSR_LOAD_HIGH 0x200B 1207 1208 1206 #define VMX_VMCS64_CTRL_EXEC_VMCS_PTR_FULL 0x200C 1209 1207 #define VMX_VMCS64_CTRL_EXEC_VMCS_PTR_HIGH 0x200D 1210 1211 1208 #define VMX_VMCS64_CTRL_TSC_OFFSET_FULL 0x2010 1212 1209 #define VMX_VMCS64_CTRL_TSC_OFFSET_HIGH 0x2011 1213 1214 /** Optional (VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW) */1215 1210 #define VMX_VMCS64_CTRL_VAPIC_PAGEADDR_FULL 0x2012 1216 1211 #define VMX_VMCS64_CTRL_VAPIC_PAGEADDR_HIGH 0x2013 1217 1218 /** Optional (VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC) */1219 1212 #define VMX_VMCS64_CTRL_APIC_ACCESSADDR_FULL 0x2014 1220 1213 #define VMX_VMCS64_CTRL_APIC_ACCESSADDR_HIGH 0x2015 1221 1222 /** Optional (VMX_VMCS_CTRL_PROC_EXEC2_VMFUNC) */1223 1214 #define VMX_VMCS64_CTRL_POSTED_INTR_DESC_FULL 0x2016 1224 1215 #define VMX_VMCS64_CTRL_POSTED_INTR_DESC_HIGH 0x2017 1225 1226 /** Optional (VMX_VMCS_CTRL_PROC_EXEC2_VMFUNC) */1227 1216 #define VMX_VMCS64_CTRL_VMFUNC_CTRLS_FULL 0x2018 1228 1217 #define VMX_VMCS64_CTRL_VMFUNC_CTRLS_HIGH 0x2019 1229 1230 /** Extended page table pointer. */1231 1218 #define VMX_VMCS64_CTRL_EPTP_FULL 0x201A 1232 1219 #define VMX_VMCS64_CTRL_EPTP_HIGH 0x201B 1233 1234 /** EOI-exit bitmap 0. */1235 1220 #define VMX_VMCS64_CTRL_EOI_BITMAP_0_FULL 0x201C 1236 1221 #define VMX_VMCS64_CTRL_EOI_BITMAP_0_HIGH 0x201D 1237 1238 /** EOI-exit bitmap 1. */1239 1222 #define VMX_VMCS64_CTRL_EOI_BITMAP_1_FULL 0x201E 1240 1223 #define VMX_VMCS64_CTRL_EOI_BITMAP_1_HIGH 0x201F 1241 1242 /** EOI-exit bitmap 2. */1243 1224 #define VMX_VMCS64_CTRL_EOI_BITMAP_2_FULL 0x2020 1244 1225 #define VMX_VMCS64_CTRL_EOI_BITMAP_2_HIGH 0x2021 1245 1246 /** EOI-exit bitmap 3. */1247 1226 #define VMX_VMCS64_CTRL_EOI_BITMAP_3_FULL 0x2022 1248 1227 #define VMX_VMCS64_CTRL_EOI_BITMAP_3_HIGH 0x2023 1249 1250 /** Extended page table pointer lists. */1251 1228 #define VMX_VMCS64_CTRL_EPTP_LIST_FULL 0x2024 1252 1229 #define VMX_VMCS64_CTRL_EPTP_LIST_HIGH 0x2025 1253 1254 /** VM-read bitmap. */1255 1230 #define VMX_VMCS64_CTRL_VMREAD_BITMAP_FULL 0x2026 1256 1231 #define VMX_VMCS64_CTRL_VMREAD_BITMAP_HIGH 0x2027 1257 1258 /** VM-write bitmap. */1259 1232 #define VMX_VMCS64_CTRL_VMWRITE_BITMAP_FULL 0x2028 1260 1233 #define VMX_VMCS64_CTRL_VMWRITE_BITMAP_HIGH 0x2029 1261 1262 /** Virtualization-exception information address. */1263 1234 #define VMX_VMCS64_CTRL_VIRTXCPT_INFO_ADDR_FULL 0x202A 1264 1235 #define VMX_VMCS64_CTRL_VIRTXCPT_INFO_ADDR_HIGH 0x202B 1265 1266 /** XSS-exiting bitmap. */1267 1236 #define VMX_VMCS64_CTRL_XSS_EXITING_BITMAP_FULL 0x202C 1268 1237 #define VMX_VMCS64_CTRL_XSS_EXITING_BITMAP_HIGH 0x202D 1269 1270 /** TSC multiplier. */1271 1238 #define VMX_VMCS64_CTRL_TSC_MULTIPLIER_FULL 0x2032 1272 1239 #define VMX_VMCS64_CTRL_TSC_MULTIPLIER_HIGH 0x2033 1273 1274 /** VM-exit guest physical address. */1275 1240 #define VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL 0x2400 1276 1241 #define VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_HIGH 0x2401 … … 1278 1243 1279 1244 1280 /** @name VMCS field encoding - 64 Bits guest fields1245 /** @name VMCS field encoding: 64-bit guest fields. 1281 1246 * @{ 1282 1247 */ … … 1302 1267 1303 1268 1304 /** @name VMCS field encoding - 32 Bits control fields1269 /** @name VMCS field encoding: 32-bit control fields. 1305 1270 * @{ 1306 1271 */ … … 1329 1294 * @{ 1330 1295 */ 1331 /** External interrupts cause VM-exits if set; otherwise dispatched through the guest's IDT. */ 1296 /** External interrupts cause VM-exits if set; otherwise dispatched through the 1297 * guest's IDT. */ 1332 1298 #define VMX_VMCS_CTRL_PIN_EXEC_EXT_INT_EXIT RT_BIT(0) 1333 /** Non-maskable interrupts cause VM-exits if set; otherwise dispatched through the guest's IDT. */ 1299 /** Non-maskable interrupts cause VM-exits if set; otherwise dispatched through 1300 * the guest's IDT. */ 1334 1301 #define VMX_VMCS_CTRL_PIN_EXEC_NMI_EXIT RT_BIT(3) 1335 1302 /** Virtual NMIs. */ … … 1360 1327 /** VM-exit when executing the RDTSC/RDTSCP instruction. */ 1361 1328 #define VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT RT_BIT(12) 1362 /** VM-exit when executing the MOV to CR3 instruction. (forced to 1 on the 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs) */ 1329 /** VM-exit when executing the MOV to CR3 instruction. (forced to 1 on the 1330 * 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs) */ 1363 1331 #define VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT RT_BIT(15) 1364 /** VM-exit when executing the MOV from CR3 instruction. (forced to 1 on the 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs) */ 1332 /** VM-exit when executing the MOV from CR3 instruction. (forced to 1 on the 1333 * 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs) */ 1365 1334 #define VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT RT_BIT(16) 1366 1335 /** VM-exit on CR8 loads. */ … … 1386 1355 /** VM-exit when executing the PAUSE instruction. */ 1387 1356 #define VMX_VMCS_CTRL_PROC_EXEC_PAUSE_EXIT RT_BIT(30) 1388 /** Determines whether the secondary processor based VM-execution controls are used. */1357 /** Whether the secondary processor based VM-execution controls are used. */ 1389 1358 #define VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL RT_BIT(31) 1390 1359 /** @} */ … … 1438 1407 /** Use TSC scaling. */ 1439 1408 #define VMX_VMCS_CTRL_PROC_EXEC2_TSC_SCALING RT_BIT(25) 1440 1441 1409 /** @} */ 1442 1410 … … 1445 1413 * @{ 1446 1414 */ 1447 /** Load guest debug controls (dr7 & IA32_DEBUGCTL_MSR) (forced to 1 on the 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs) */ 1415 /** Load guest debug controls (dr7 & IA32_DEBUGCTL_MSR) (forced to 1 on the 1416 * 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs) */ 1448 1417 #define VMX_VMCS_CTRL_ENTRY_LOAD_DEBUG RT_BIT(2) 1449 1418 /** 64 bits guest mode. Must be 0 for CPUs that don't support AMD64. */ … … 1465 1434 * @{ 1466 1435 */ 1467 /** Save guest debug controls (dr7 & IA32_DEBUGCTL_MSR) (forced to 1 on the 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs) */ 1436 /** Save guest debug controls (dr7 & IA32_DEBUGCTL_MSR) (forced to 1 on the 1437 * 'first' VT-x capable CPUs; this actually includes the newest Nehalem CPUs) */ 1468 1438 #define VMX_VMCS_CTRL_EXIT_SAVE_DEBUG RT_BIT(2) 1469 1439 /** Return to long mode after a VM-exit. */ … … 1494 1464 1495 1465 1496 /** @name VMCS field encoding - 32 Bits read-only fields1466 /** @name VMCS field encoding: 32-bits read-only fields. 1497 1467 * @{ 1498 1468 */ … … 1535 1505 #define VMX_EXIT_INTERRUPTION_INFO_VALID RT_BIT(31) 1536 1506 #define VMX_EXIT_INTERRUPTION_INFO_IS_VALID(a) RT_BOOL((a) & RT_BIT(31)) 1537 /** Construct an irq event injection value from the exit interruption info value (same except that bit 12 is reserved). */ 1507 /** Construct an irq event injection value from the exit interruption info value 1508 * (same except that bit 12 is reserved). */ 1538 1509 #define VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(a) ((a) & ~RT_BIT(12)) 1539 1510 /** @} */ … … 1577 1548 1578 1549 1579 /** @name VMCS field encoding - 32 Bits guest state fields1550 /** @name VMCS field encoding: 32-bit guest-state fields. 1580 1551 * @{ 1581 1552 */ … … 1629 1600 1630 1601 1631 /** @name VMCS field encoding - 32 Bits host state fields1602 /** @name VMCS field encoding: 32-bit host-state fields. 1632 1603 * @{ 1633 1604 */ … … 1666 1637 */ 1667 1638 /** 0-2: Debug register number */ 1668 #define VMX_EXIT_QUAL_DRX_REGISTER(a) ((a) & 7)1639 #define VMX_EXIT_QUAL_DRX_REGISTER(a) ((a) & 7) 1669 1640 /** 3: Reserved; cleared to 0. */ 1670 #define VMX_EXIT_QUAL_DRX_RES1(a) (((a) >> 3) & 1)1641 #define VMX_EXIT_QUAL_DRX_RES1(a) (((a) >> 3) & 1) 1671 1642 /** 4: Direction of move (0 = write, 1 = read) */ 1672 #define VMX_EXIT_QUAL_DRX_DIRECTION(a) (((a) >> 4) & 1)1643 #define VMX_EXIT_QUAL_DRX_DIRECTION(a) (((a) >> 4) & 1) 1673 1644 /** 5-7: Reserved; cleared to 0. */ 1674 #define VMX_EXIT_QUAL_DRX_RES2(a) (((a) >> 5) & 7)1645 #define VMX_EXIT_QUAL_DRX_RES2(a) (((a) >> 5) & 7) 1675 1646 /** 8-11: General purpose register number. */ 1676 #define VMX_EXIT_QUAL_DRX_GENREG(a) (((a) >> 8) & 0xF)1647 #define VMX_EXIT_QUAL_DRX_GENREG(a) (((a) >> 8) & 0xF) 1677 1648 /** Rest: reserved. */ 1678 1649 /** @} */ … … 1797 1768 * @{ 1798 1769 */ 1799 /** 0-11: If the APIC-access VM-exit is due to a linear access, the offset of access within the APIC page. */ 1770 /** 0-11: If the APIC-access VM-exit is due to a linear access, the offset of 1771 * access within the APIC page. */ 1800 1772 #define VMX_EXIT_QUAL_APIC_ACCESS_OFFSET(a) ((a) & 0xfff) 1801 /** 12-15: 1773 /** 12-15: Access type. */ 1802 1774 #define VMX_EXIT_QUAL_APIC_ACCESS_TYPE(a) (((a) & 0xf000) >> 12) 1803 1775 /* Rest reserved. */ … … 1933 1905 1934 1906 1935 /** @name VMCS field encoding - Natural width guest state fields1907 /** @name VMCS field encoding: Natural width guest-state fields. 1936 1908 * @{ 1937 1909 */ … … 1977 1949 /** @} */ 1978 1950 1979 /** @name VMCS field encoding - Natural width host state fields 1951 1952 /** @name VMCS field encoding: Natural width host-state fields. 1980 1953 * @{ 1981 1954 */ … … 2222 2195 #endif 2223 2196 2197 2224 2198 /** 2225 2199 * Executes VMPTRST. … … 2230 2204 */ 2231 2205 DECLASM(int) VMXGetActivatedVmcs(RTHCPHYS *pHCPhysVmcs); 2206 2232 2207 2233 2208 /** … … 2348 2323 DECLASM(int) VMXR0InvEPT(VMXFLUSHEPT enmFlush, uint64_t *pDescriptor); 2349 2324 2325 2350 2326 /** 2351 2327 * Invalidate a page using INVVPID. … … 2356 2332 */ 2357 2333 DECLASM(int) VMXR0InvVPID(VMXFLUSHVPID enmFlush, uint64_t *pDescriptor); 2334 2358 2335 2359 2336 /** … … 2484 2461 #endif 2485 2462 2463 2486 2464 /** 2487 2465 * Gets the last instruction error value from the current VMCS.
Note:
See TracChangeset
for help on using the changeset viewer.