Changeset 79202 in vbox for trunk/include
- Timestamp:
- Jun 18, 2019 9:13:29 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131377
- Location:
- trunk/include/VBox/vmm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/include/VBox/vmm/hm_vmx.h ¶
r79195 r79202 466 466 /** 467 467 * EPT Page Directory Pointer Entry. Bit view. 468 * In accordance with the VT-x spec. 469 * 468 470 * @todo uint64_t isn't safe for bitfields (gcc pedantic warnings, and IIRC, 469 471 * this did cause trouble with one compiler/version). … … 497 499 /** 498 500 * EPT PML4E. 501 * In accordance with the VT-x spec. 499 502 */ 500 503 typedef union EPTPML4E … … 517 520 /** 518 521 * EPT PML4 Table. 522 * In accordance with the VT-x spec. 519 523 */ 520 524 typedef struct EPTPML4 … … 530 534 /** 531 535 * EPT Page Directory Pointer Entry. Bit view. 536 * In accordance with the VT-x spec. 532 537 */ 533 538 typedef struct EPTPDPTEBITS … … 559 564 /** 560 565 * EPT Page Directory Pointer. 566 * In accordance with the VT-x spec. 561 567 */ 562 568 typedef union EPTPDPTE … … 579 585 /** 580 586 * EPT Page Directory Pointer Table. 587 * In accordance with the VT-x spec. 581 588 */ 582 589 typedef struct EPTPDPT … … 592 599 /** 593 600 * EPT Page Directory Table Entry. Bit view. 601 * In accordance with the VT-x spec. 594 602 */ 595 603 typedef struct EPTPDEBITS … … 623 631 /** 624 632 * EPT 2MB Page Directory Table Entry. Bit view. 633 * In accordance with the VT-x spec. 625 634 */ 626 635 typedef struct EPTPDE2MBITS … … 654 663 /** 655 664 * EPT Page Directory Table Entry. 665 * In accordance with the VT-x spec. 656 666 */ 657 667 typedef union EPTPDE … … 676 686 /** 677 687 * EPT Page Directory Table. 688 * In accordance with the VT-x spec. 678 689 */ 679 690 typedef struct EPTPD … … 689 700 /** 690 701 * EPT Page Table Entry. Bit view. 702 * In accordance with the VT-x spec. 691 703 */ 692 704 typedef struct EPTPTEBITS … … 725 737 /** 726 738 * EPT Page Table Entry. 739 * In accordance with the VT-x spec. 727 740 */ 728 741 typedef union EPTPTE … … 745 758 /** 746 759 * EPT Page Table. 760 * In accordance with the VT-x spec. 747 761 */ 748 762 typedef struct EPTPT … … 816 830 /** 817 831 * VMX VMCS revision identifier. 832 * In accordance with the VT-x spec. 818 833 */ 819 834 typedef union … … 837 852 /** 838 853 * VMX VM-exit instruction information. 854 * In accordance with the VT-x spec. 839 855 */ 840 856 typedef union … … 1126 1142 /** 1127 1143 * VMX controls MSR. 1144 * In accordance with the VT-x spec. 1128 1145 */ 1129 1146 typedef union … … 1351 1368 1352 1369 /** @name VM Instruction Errors. 1370 * In accordance with the VT-x spec. 1353 1371 * See Intel spec. "30.4 VM Instruction Error Numbers" 1354 1372 * @{ … … 1413 1431 1414 1432 /** @name VMX abort reasons. 1433 * In accordance with the VT-x spec. 1415 1434 * See Intel spec. "27.7 VMX Aborts". 1416 1435 * Update HMGetVmxAbortDesc() if new reasons are added. @{ … … 1693 1712 1694 1713 1695 /** @name VMCS field encoding: 16-bit control fields. 1696 * @{ 1697 */ 1714 /** @name VMCS fields and encoding. 1715 * 1716 * When adding a new field: 1717 * - Always add it to g_aVmcsFields. 1718 * - Consider if it needs to be added to VMXVVMCS. 1719 * @{ 1720 */ 1721 /** 16-bit control fields. */ 1698 1722 #define VMX_VMCS16_VPID 0x0000 1699 1723 #define VMX_VMCS16_POSTED_INT_NOTIFY_VECTOR 0x0002 1700 1724 #define VMX_VMCS16_EPTP_INDEX 0x0004 1701 /** @} */ 1702 1703 1704 /** @name VMCS field encoding: 16-bit guest-state fields. 1705 * @{ 1706 */ 1725 1726 /** 16-bit guest-state fields. */ 1707 1727 #define VMX_VMCS16_GUEST_ES_SEL 0x0800 1708 1728 #define VMX_VMCS16_GUEST_CS_SEL 0x0802 … … 1715 1735 #define VMX_VMCS16_GUEST_INTR_STATUS 0x0810 1716 1736 #define VMX_VMCS16_GUEST_PML_INDEX 0x0812 1717 /** @} */ 1718 1719 1720 /** @name VMCS field encoding: 16-bits host-state fields. 1721 * @{ 1722 */ 1737 1738 /** 16-bits host-state fields. */ 1723 1739 #define VMX_VMCS16_HOST_ES_SEL 0x0c00 1724 1740 #define VMX_VMCS16_HOST_CS_SEL 0x0c02 … … 1728 1744 #define VMX_VMCS16_HOST_GS_SEL 0x0c0a 1729 1745 #define VMX_VMCS16_HOST_TR_SEL 0x0c0c 1730 /** @} */ 1731 1732 1733 /** @name VMCS field encoding: 64-bit control fields. 1734 * @{ 1735 */ 1746 1747 /** 64-bit control fields. */ 1736 1748 #define VMX_VMCS64_CTRL_IO_BITMAP_A_FULL 0x2000 1737 1749 #define VMX_VMCS64_CTRL_IO_BITMAP_A_HIGH 0x2001 … … 1784 1796 #define VMX_VMCS64_CTRL_TSC_MULTIPLIER_FULL 0x2032 1785 1797 #define VMX_VMCS64_CTRL_TSC_MULTIPLIER_HIGH 0x2033 1786 /** @} */ 1787 1788 1789 /** @name VMCS field encoding: 64-bit read-only data fields. 1790 * @{ 1791 */ 1798 1799 /** 64-bit read-only data fields. */ 1792 1800 #define VMX_VMCS64_RO_GUEST_PHYS_ADDR_FULL 0x2400 1793 1801 #define VMX_VMCS64_RO_GUEST_PHYS_ADDR_HIGH 0x2401 1794 /** @} */ 1795 1796 1797 /** @name VMCS field encoding: 64-bit guest-state fields. 1798 * @{ 1799 */ 1802 1803 /** 64-bit guest-state fields. */ 1800 1804 #define VMX_VMCS64_GUEST_VMCS_LINK_PTR_FULL 0x2800 1801 1805 #define VMX_VMCS64_GUEST_VMCS_LINK_PTR_HIGH 0x2801 … … 1818 1822 #define VMX_VMCS64_GUEST_BNDCFGS_FULL 0x2812 1819 1823 #define VMX_VMCS64_GUEST_BNDCFGS_HIGH 0x2813 1820 /** @} */ 1821 1822 1823 /** @name VMCS field encoding: 64-bit host-state fields. 1824 * @{ 1825 */ 1824 1825 /** 64-bit host-state fields. */ 1826 1826 #define VMX_VMCS64_HOST_PAT_FULL 0x2c00 1827 1827 #define VMX_VMCS64_HOST_PAT_HIGH 0x2c01 … … 1830 1830 #define VMX_VMCS64_HOST_PERF_GLOBAL_CTRL_FULL 0x2c04 1831 1831 #define VMX_VMCS64_HOST_PERF_GLOBAL_CTRL_HIGH 0x2c05 1832 /** @} */ 1833 1834 1835 /** @name VMCS field encoding: 32-bit control fields. 1836 * @{ 1837 */ 1832 1833 /** 32-bit control fields. */ 1838 1834 #define VMX_VMCS32_CTRL_PIN_EXEC 0x4000 1839 1835 #define VMX_VMCS32_CTRL_PROC_EXEC 0x4002 … … 1854 1850 #define VMX_VMCS32_CTRL_PLE_GAP 0x4020 1855 1851 #define VMX_VMCS32_CTRL_PLE_WINDOW 0x4022 1856 /** @} */ 1857 1858 1859 /** @name VMCS field encoding: 32-bits read-only fields. 1860 * @{ 1861 */ 1852 1853 /** 32-bits read-only fields. */ 1862 1854 #define VMX_VMCS32_RO_VM_INSTR_ERROR 0x4400 1863 1855 #define VMX_VMCS32_RO_EXIT_REASON 0x4402 … … 1868 1860 #define VMX_VMCS32_RO_EXIT_INSTR_LENGTH 0x440c 1869 1861 #define VMX_VMCS32_RO_EXIT_INSTR_INFO 0x440e 1870 /** @} */ 1871 1872 1873 /** @name VMCS field encoding: 32-bit guest-state fields. 1874 * @{ 1875 */ 1862 1863 /** 32-bit guest-state fields. */ 1876 1864 #define VMX_VMCS32_GUEST_ES_LIMIT 0x4800 1877 1865 #define VMX_VMCS32_GUEST_CS_LIMIT 0x4802 … … 1897 1885 #define VMX_VMCS32_GUEST_SYSENTER_CS 0x482a 1898 1886 #define VMX_VMCS32_PREEMPT_TIMER_VALUE 0x482e 1899 /** @} */ 1900 1901 1902 /** @name VMCS field encoding: 32-bit host-state fields. 1903 * @{ 1904 */ 1887 1888 /** 32-bit host-state fields. */ 1905 1889 #define VMX_VMCS32_HOST_SYSENTER_CS 0x4C00 1906 /** @} */ 1907 1908 1909 /** @name VMCS field encoding: Natural-width control fields. 1910 * @{ 1911 */ 1890 1891 /** Natural-width control fields. */ 1912 1892 #define VMX_VMCS_CTRL_CR0_MASK 0x6000 1913 1893 #define VMX_VMCS_CTRL_CR4_MASK 0x6002 … … 1918 1898 #define VMX_VMCS_CTRL_CR3_TARGET_VAL2 0x600c 1919 1899 #define VMX_VMCS_CTRL_CR3_TARGET_VAL3 0x600e 1920 /** @} */ 1921 1922 1923 /** @name Natural-width read-only data fields. 1924 * @{ 1925 */ 1900 1901 /** Natural-width read-only data fields. */ 1926 1902 #define VMX_VMCS_RO_EXIT_QUALIFICATION 0x6400 1927 1903 #define VMX_VMCS_RO_IO_RCX 0x6402 … … 1930 1906 #define VMX_VMCS_RO_IO_RIP 0x6408 1931 1907 #define VMX_VMCS_RO_GUEST_LINEAR_ADDR 0x640a 1932 /** @} */ 1933 1934 1935 /** @name VMCS field encoding: Natural-width guest-state fields. 1936 * @{ 1937 */ 1908 1909 /** Natural-width guest-state fields. */ 1938 1910 #define VMX_VMCS_GUEST_CR0 0x6800 1939 1911 #define VMX_VMCS_GUEST_CR3 0x6802 … … 1956 1928 #define VMX_VMCS_GUEST_SYSENTER_ESP 0x6824 1957 1929 #define VMX_VMCS_GUEST_SYSENTER_EIP 0x6826 1958 /** @} */ 1959 1960 1961 /** @name VMCS field encoding: Natural-width host-state fields. 1962 * @{ 1963 */ 1930 1931 /** Natural-width host-state fields. */ 1964 1932 #define VMX_VMCS_HOST_CR0 0x6c00 1965 1933 #define VMX_VMCS_HOST_CR3 0x6c02 … … 1974 1942 #define VMX_VMCS_HOST_RSP 0x6c14 1975 1943 #define VMX_VMCS_HOST_RIP 0x6c16 1976 /** @} */ 1977 1978 1979 /** @name VMCS field encoding: Access. 1980 * @{ */ 1981 typedef enum 1982 { 1983 VMXVMCSFIELDACCESS_FULL = 0, 1984 VMXVMCSFIELDACCESS_HIGH 1985 } VMXVMCSFIELDACCESS; 1986 AssertCompileSize(VMXVMCSFIELDACCESS, 4); 1987 1988 /** VMCS field encoding type: Full. */ 1989 #define VMX_VMCS_ENC_ACCESS_TYPE_FULL 0 1990 /** VMCS field encoding type: High. */ 1991 #define VMX_VMCS_ENC_ACCESS_TYPE_HIGH 1 1992 /** @} */ 1993 1994 1995 /** @name VMCS field encoding: Type. 1996 * @{ */ 1997 typedef enum 1998 { 1999 VMXVMCSFIELDTYPE_CONTROL = 0, 2000 VMXVMCSFIELDTYPE_VMEXIT_INFO, 2001 VMXVMCSFIELDTYPE_GUEST_STATE, 2002 VMXVMCSFIELDTYPE_HOST_STATE 2003 } VMXVMCSFIELDTYPE; 2004 AssertCompileSize(VMXVMCSFIELDTYPE, 4); 2005 2006 /** VMCS field encoding type: Control. */ 2007 #define VMX_VMCS_ENC_TYPE_CONTROL 0 2008 /** VMCS field encoding type: VM-exit information / read-only fields. */ 2009 #define VMX_VMCS_ENC_TYPE_VMEXIT_INFO 1 2010 /** VMCS field encoding type: Guest-state. */ 2011 #define VMX_VMCS_ENC_TYPE_GUEST_STATE 2 2012 /** VMCS field encoding type: Host-state. */ 2013 #define VMX_VMCS_ENC_TYPE_HOST_STATE 3 2014 /** @} */ 2015 2016 2017 /** @name VMCS field encoding: Width. 2018 * @{ */ 2019 typedef enum 2020 { 2021 VMXVMCSFIELDWIDTH_16BIT = 0, 2022 VMXVMCSFIELDWIDTH_64BIT, 2023 VMXVMCSFIELDWIDTH_32BIT, 2024 VMXVMCSFIELDWIDTH_NATURAL 2025 } VMXVMCSFIELDWIDTH; 2026 AssertCompileSize(VMXVMCSFIELDWIDTH, 4); 2027 2028 /** VMCS field encoding width: 16-bit. */ 2029 #define VMX_VMCS_ENC_WIDTH_16BIT 0 2030 /** VMCS field encoding width: 64-bit. */ 2031 #define VMX_VMCS_ENC_WIDTH_64BIT 1 2032 /** VMCS field encoding width: 32-bit. */ 2033 #define VMX_VMCS_ENC_WIDTH_32BIT 2 2034 /** VMCS field encoding width: Natural width. */ 2035 #define VMX_VMCS_ENC_WIDTH_NATURAL 3 2036 /** @} */ 2037 2038 2039 /** @name VMCS field. 2040 * @{ */ 1944 1945 /** 1946 * VMCS field. 1947 * In accordance with the VT-x spec. 1948 */ 2041 1949 typedef union 2042 1950 { … … 2061 1969 } VMXVMCSFIELD; 2062 1970 AssertCompileSize(VMXVMCSFIELD, 4); 2063 /** Pointer to a VMCS field encoding. */1971 /** Pointer to a VMCS field. */ 2064 1972 typedef VMXVMCSFIELD *PVMXVMCSFIELD; 2065 /** Pointer to a const VMCS field encoding. */1973 /** Pointer to a const VMCS field. */ 2066 1974 typedef const VMXVMCSFIELD *PCVMXVMCSFIELD; 2067 1975 2068 /** VMCS field encoding: Mask of reserved bits (bits 63:15 MBZ), bit 12 is 2069 * not included! */ 2070 #define VMX_VMCS_ENC_RSVD_MASK UINT64_C(0xffffffffffff8000) 2071 2072 /** Bits fields for VMCS field encoding. */ 2073 #define VMX_BF_VMCS_ENC_ACCESS_TYPE_SHIFT 0 2074 #define VMX_BF_VMCS_ENC_ACCESS_TYPE_MASK UINT32_C(0x00000001) 2075 #define VMX_BF_VMCS_ENC_INDEX_SHIFT 1 2076 #define VMX_BF_VMCS_ENC_INDEX_MASK UINT32_C(0x000003fe) 2077 #define VMX_BF_VMCS_ENC_TYPE_SHIFT 10 2078 #define VMX_BF_VMCS_ENC_TYPE_MASK UINT32_C(0x00000c00) 2079 #define VMX_BF_VMCS_ENC_RSVD_12_SHIFT 12 2080 #define VMX_BF_VMCS_ENC_RSVD_12_MASK UINT32_C(0x00001000) 2081 #define VMX_BF_VMCS_ENC_WIDTH_SHIFT 13 2082 #define VMX_BF_VMCS_ENC_WIDTH_MASK UINT32_C(0x00006000) 2083 #define VMX_BF_VMCS_ENC_RSVD_15_31_SHIFT 15 2084 #define VMX_BF_VMCS_ENC_RSVD_15_31_MASK UINT32_C(0xffff8000) 2085 RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_VMCS_ENC_, UINT32_C(0), UINT32_MAX, 1976 /** VMCS field: Mask of reserved bits (bits 63:15 MBZ), bit 12 is not included! */ 1977 #define VMX_VMCSFIELD_RSVD_MASK UINT64_C(0xffffffffffff8000) 1978 1979 /** Bits fields for a VMCS field. */ 1980 #define VMX_BF_VMCSFIELD_ACCESS_TYPE_SHIFT 0 1981 #define VMX_BF_VMCSFIELD_ACCESS_TYPE_MASK UINT32_C(0x00000001) 1982 #define VMX_BF_VMCSFIELD_INDEX_SHIFT 1 1983 #define VMX_BF_VMCSFIELD_INDEX_MASK UINT32_C(0x000003fe) 1984 #define VMX_BF_VMCSFIELD_TYPE_SHIFT 10 1985 #define VMX_BF_VMCSFIELD_TYPE_MASK UINT32_C(0x00000c00) 1986 #define VMX_BF_VMCSFIELD_RSVD_12_SHIFT 12 1987 #define VMX_BF_VMCSFIELD_RSVD_12_MASK UINT32_C(0x00001000) 1988 #define VMX_BF_VMCSFIELD_WIDTH_SHIFT 13 1989 #define VMX_BF_VMCSFIELD_WIDTH_MASK UINT32_C(0x00006000) 1990 #define VMX_BF_VMCSFIELD_RSVD_15_31_SHIFT 15 1991 #define VMX_BF_VMCSFIELD_RSVD_15_31_MASK UINT32_C(0xffff8000) 1992 RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_VMCSFIELD_, UINT32_C(0), UINT32_MAX, 2086 1993 (ACCESS_TYPE, INDEX, TYPE, RSVD_12, WIDTH, RSVD_15_31)); 1994 1995 /** 1996 * VMCS field encoding: Access type. 1997 * In accordance with the VT-x spec. 1998 */ 1999 typedef enum 2000 { 2001 VMXVMCSFIELDACCESS_FULL = 0, 2002 VMXVMCSFIELDACCESS_HIGH 2003 } VMXVMCSFIELDACCESS; 2004 AssertCompileSize(VMXVMCSFIELDACCESS, 4); 2005 /** VMCS field encoding type: Full. */ 2006 #define VMX_VMCSFIELD_ACCESS_FULL 0 2007 /** VMCS field encoding type: High. */ 2008 #define VMX_VMCSFIELD_ACCESS_HIGH 1 2009 2010 /** 2011 * VMCS field encoding: Type. 2012 * In accordance with the VT-x spec. 2013 */ 2014 typedef enum 2015 { 2016 VMXVMCSFIELDTYPE_CONTROL = 0, 2017 VMXVMCSFIELDTYPE_VMEXIT_INFO, 2018 VMXVMCSFIELDTYPE_GUEST_STATE, 2019 VMXVMCSFIELDTYPE_HOST_STATE 2020 } VMXVMCSFIELDTYPE; 2021 AssertCompileSize(VMXVMCSFIELDTYPE, 4); 2022 /** VMCS field encoding type: Control. */ 2023 #define VMX_VMCSFIELD_TYPE_CONTROL 0 2024 /** VMCS field encoding type: VM-exit information / read-only fields. */ 2025 #define VMX_VMCSFIELD_TYPE_VMEXIT_INFO 1 2026 /** VMCS field encoding type: Guest-state. */ 2027 #define VMX_VMCSFIELD_TYPE_GUEST_STATE 2 2028 /** VMCS field encoding type: Host-state. */ 2029 #define VMX_VMCSFIELD_TYPE_HOST_STATE 3 2030 2031 /** 2032 * VMCS field encoding: Width. 2033 * In accordance with the VT-x spec. 2034 */ 2035 typedef enum 2036 { 2037 VMXVMCSFIELDWIDTH_16BIT = 0, 2038 VMXVMCSFIELDWIDTH_64BIT, 2039 VMXVMCSFIELDWIDTH_32BIT, 2040 VMXVMCSFIELDWIDTH_NATURAL 2041 } VMXVMCSFIELDWIDTH; 2042 AssertCompileSize(VMXVMCSFIELDWIDTH, 4); 2043 /** VMCS field encoding width: 16-bit. */ 2044 #define VMX_VMCSFIELD_WIDTH_16BIT 0 2045 /** VMCS field encoding width: 64-bit. */ 2046 #define VMX_VMCSFIELD_WIDTH_64BIT 1 2047 /** VMCS field encoding width: 32-bit. */ 2048 #define VMX_VMCSFIELD_WIDTH_32BIT 2 2049 /** VMCS field encoding width: Natural width. */ 2050 #define VMX_VMCSFIELD_WIDTH_NATURAL 3 2087 2051 /** @} */ 2088 2052 … … 3111 3075 /** 3112 3076 * APIC-access type. 3077 * In accordance with the VT-x spec. 3113 3078 */ 3114 3079 typedef enum … … 3385 3350 3386 3351 /** The highest index value used for supported virtual VMCS field encoding. */ 3387 #define VMX_V_VMCS_MAX_INDEX RT_BF_GET(VMX_VMCS64_CTRL_TSC_MULTIPLIER_HIGH, VMX_BF_VMCS _ENC_INDEX)3352 #define VMX_V_VMCS_MAX_INDEX RT_BF_GET(VMX_VMCS64_CTRL_TSC_MULTIPLIER_HIGH, VMX_BF_VMCSFIELD_INDEX) 3388 3353 3389 3354 /** … … 3472 3437 * 3473 3438 * Note! Any fields that are added or modified here, make sure to update the 3474 * corresponding fields in g_aoffVmcsMap in IEM. 3439 * corresponding fields in IEM (g_aoffVmcsMap), the corresponding saved 3440 * state structure in CPUM (g_aVmxHwvirtVmcs) and bump the SSM version. 3475 3441 */ 3476 3442 #pragma pack(1) -
TabularUnified trunk/include/VBox/vmm/hmvmxinline.h ¶
r78220 r79202 84 84 * @param uFieldEnc The VMCS field encoding. 85 85 * 86 * @remarks Warning! This function does not verify th e encoding is for a valid and87 * supported VMCS field.86 * @remarks Warning! This function does not verify that the encoding is for a valid 87 * and/or supported VMCS field. 88 88 */ 89 89 DECLINLINE(bool) HMVmxIsVmcsFieldReadOnly(uint32_t uFieldEnc) 90 90 { 91 91 /* See Intel spec. B.4.2 "Natural-Width Read-Only Data Fields". */ 92 return (RT_BF_GET(uFieldEnc, VMX_BF_VMCS _ENC_TYPE) == VMXVMCSFIELDTYPE_VMEXIT_INFO);92 return (RT_BF_GET(uFieldEnc, VMX_BF_VMCSFIELD_TYPE) == VMXVMCSFIELDTYPE_VMEXIT_INFO); 93 93 } 94 94
Note:
See TracChangeset
for help on using the changeset viewer.