VirtualBox

Changeset 91357 in vbox


Ignore:
Timestamp:
Sep 24, 2021 9:28:57 AM (3 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Nested VMX: bugref:10092 Cleaned up bit fields for EPTP.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/hm_vmx.h

    r91344 r91357  
    17571757
    17581758/** @name Extended Page Table Pointer (EPTP)
    1759  * @{
    1760  */
    1761 /** Uncachable EPT paging structure memory type. */
    1762 #define VMX_EPT_MEMTYPE_UC                                      0
    1763 /** Write-back EPT paging structure memory type. */
    1764 #define VMX_EPT_MEMTYPE_WB                                      6
    1765 /** Shift value to get the EPT page walk length (bits 5-3) */
    1766 #define VMX_EPT_PAGE_WALK_LENGTH_SHIFT                          3
    1767 /** Mask value to get the EPT page walk length (bits 5-3) */
    1768 #define VMX_EPT_PAGE_WALK_LENGTH_MASK                           7
    1769 /** Default EPT page-walk length (1 less than the actual EPT page-walk
    1770  *  length) */
    1771 #define VMX_EPT_PAGE_WALK_LENGTH_DEFAULT                        3
     1759 * In accordance with the VT-x spec.
     1760 * See Intel spec. 23.6.11 "Extended-Page-Table Pointer (EPTP)".
     1761 * @{
     1762 */
     1763/** EPTP memory type: Uncachable. */
     1764#define VMX_EPTP_MEMTYPE_UC                                     0
     1765/** EPTP memory type: Write Back. */
     1766#define VMX_EPTP_MEMTYPE_WB                                     6
     1767/** Page-walk length for PML4 (4-level paging). */
     1768#define VMX_EPTP_PAGE_WALK_LENGTH_4                             3
     1769
     1770/** Bit fields for EPTP. */
     1771#define VMX_BF_EPTP_MEMTYPE_SHIFT                               0
     1772#define VMX_BF_EPTP_MEMTYPE_MASK                                UINT64_C(0x0000000000000007)
     1773#define VMX_BF_EPTP_PAGE_WALK_LENGTH_SHIFT                      3
     1774#define VMX_BF_EPTP_PAGE_WALK_LENGTH_MASK                       UINT64_C(0x0000000000000038)
     1775#define VMX_BF_EPTP_ACCESS_DIRTY_SHIFT                          6
     1776#define VMX_BF_EPTP_ACCESS_DIRTY_MASK                           UINT64_C(0x0000000000000040)
     1777#define VMX_BF_EPTP_SUPER_SHW_STACK_SHIFT                       7
     1778#define VMX_BF_EPTP_SUPER_SHW_STACK_MASK                        UINT64_C(0x0000000000000080)
     1779#define VMX_BF_EPTP_RSVD_8_11_SHIFT                             8
     1780#define VMX_BF_EPTP_RSVD_8_11_MASK                              UINT64_C(0x0000000000000f00)
     1781#define VMX_BF_EPTP_PML4_ADDR_SHIFT                             12
     1782#define VMX_BF_EPTP_PML4_ADDR_MASK                              UINT64_C(0xfffffffffffff000)
     1783RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_EPTP_, UINT64_C(0), UINT64_MAX,
     1784                            (MEMTYPE, PAGE_WALK_LENGTH, ACCESS_DIRTY, SUPER_SHW_STACK, RSVD_8_11, PML4_ADDR));
    17721785/** @} */
    17731786
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r91343 r91357  
    58815881
    58825882            /* VMX_EPT_MEMTYPE_WB support is already checked in hmR0VmxSetupTaggedTlb(). */
    5883             pVmcsInfo->HCPhysEPTP |= VMX_EPT_MEMTYPE_WB
    5884                                   |  (VMX_EPT_PAGE_WALK_LENGTH_DEFAULT << VMX_EPT_PAGE_WALK_LENGTH_SHIFT);
     5883            pVmcsInfo->HCPhysEPTP |= RT_BF_MAKE(VMX_BF_EPTP_MEMTYPE,          VMX_EPTP_MEMTYPE_WB)
     5884                                  |  RT_BF_MAKE(VMX_BF_EPTP_PAGE_WALK_LENGTH, VMX_EPTP_PAGE_WALK_LENGTH_4);
    58855885
    58865886            /* Validate. See Intel spec. 26.2.1 "Checks on VMX Controls" */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette