VirtualBox

Changeset 92046 in vbox for trunk/include


Ignore:
Timestamp:
Oct 25, 2021 4:05:10 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147855
Message:

VMM: Nested VMX: bugref:10092 EPT paging PDPTE walk bits.

File:
1 edited

Legend:

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

    r91971 r92046  
    415415 * The memory type is only applicable for leaf entries and MBZ for
    416416 * non-leaf (causes miconfiguration exit). */
    417 #define EPT_E_TYPE_MASK         UINT64_C(0x0038)
     417#define EPT_E_MEMTYPE_MASK      UINT64_C(0x0038)
    418418/** Bits 3-5 - Memory type shifted mask. */
    419 #define EPT_E_TYPE_SMASK        UINT64_C(0x0007)
     419#define EPT_E_MEMTYPE_SMASK     UINT64_C(0x0007)
    420420/** Bits 3-5 - Memory type shift count. */
    421 #define EPT_E_TYPE_SHIFT        3
     421#define EPT_E_MEMTYPE_SHIFT     3
    422422/** Bits 3-5 - Memory type: UC. */
    423 #define EPT_E_TYPE_UC           (UINT64_C(0) << EPT_E_TYPE_SHIFT)
     423#define EPT_E_MEMTYPE_UC        (UINT64_C(0) << EPT_E_MEMTYPE_SHIFT)
    424424/** Bits 3-5 - Memory type: WC. */
    425 #define EPT_E_TYPE_WC           (UINT64_C(1) << EPT_E_TYPE_SHIFT)
     425#define EPT_E_MEMTYPE_WC        (UINT64_C(1) << EPT_E_MEMTYPE_SHIFT)
    426426/** Bits 3-5 - Memory type: Invalid (2). */
    427 #define EPT_E_TYPE_INVALID_2    (UINT64_C(2) << EPT_E_TYPE_SHIFT)
     427#define EPT_E_MEMTYPE_INVALID_2 (UINT64_C(2) << EPT_E_MEMTYPE_SHIFT)
    428428/** Bits 3-5 - Memory type: Invalid (3). */
    429 #define EPT_E_TYPE_INVALID_3    (UINT64_C(3) << EPT_E_TYPE_SHIFT)
     429#define EPT_E_MEMTYPE_INVALID_3 (UINT64_C(3) << EPT_E_MEMTYPE_SHIFT)
    430430/** Bits 3-5 - Memory type: WT. */
    431 #define EPT_E_TYPE_WT           (UINT64_C(4) << EPT_E_TYPE_SHIFT)
     431#define EPT_E_MEMTYPE_WT        (UINT64_C(4) << EPT_E_MEMTYPE_SHIFT)
    432432/** Bits 3-5 - Memory type: WP. */
    433 #define EPT_E_TYPE_WP           (UINT64_C(5) << EPT_E_TYPE_SHIFT)
     433#define EPT_E_MEMTYPE_WP        (UINT64_C(5) << EPT_E_MEMTYPE_SHIFT)
    434434/** Bits 3-5 - Memory type: WB. */
    435 #define EPT_E_TYPE_WB           (UINT64_C(6) << EPT_E_TYPE_SHIFT)
     435#define EPT_E_MEMTYPE_WB        (UINT64_C(6) << EPT_E_MEMTYPE_SHIFT)
    436436/** Bits 3-5 - Memory type: Invalid (7). */
    437 #define EPT_E_TYPE_INVALID_7    (UINT64_C(7) << EPT_E_TYPE_SHIFT)
     437#define EPT_E_MEMTYPE_INVALID_7 (UINT64_C(7) << EPT_E_MEMTYPE_SHIFT)
    438438
    439439/** Bit 6 - Ignore page attribute table (leaf, MBZ). */
     
    468468/* Bit 61, 62 are always ignored at time of writing. */
    469469
    470 /** Bit 63 - Supress \#VE (leaf only, ignored).
     470/** Bit 63 - Suppress \#VE (leaf only, ignored).
    471471 * @note Ignored if EPT violation to \#VE conversion is disabled. */
    472 #define EPT_E_BIT_IGNORE_VE     63
    473 #define EPT_E_IGNORE_VE         RT_BIT_64(EPT_E_BIT_IGNORE_VE)     /**< @see EPT_E_BIT_IGNORE_VE*/
     472#define EPT_E_BIT_SUPPRESS_VE   63
     473#define EPT_E_SUPPRESS_VE       RT_BIT_64(EPT_E_BIT_SUPPRESS_VE)     /**< @see EPT_E_BIT_SUPPRESS_VE*/
     474/** @} */
     475
     476
     477/**@name Bit fields for common EPT attributes.
     478 @{ */
     479/** Read access. */
     480#define VMX_BF_EPT_PT_READ_SHIFT                        0
     481#define VMX_BF_EPT_PT_READ_MASK                         UINT64_C(0x0000000000000001)
     482/** Write access. */
     483#define VMX_BF_EPT_PT_WRITE_SHIFT                       1
     484#define VMX_BF_EPT_PT_WRITE_MASK                        UINT64_C(0x0000000000000002)
     485/** Execute access or execute access for supervisor-mode linear-addresses. */
     486#define VMX_BF_EPT_PT_EXECUTE_SHIFT                     2
     487#define VMX_BF_EPT_PT_EXECUTE_MASK                      UINT64_C(0x0000000000000004)
     488/** EPT memory type. */
     489#define VMX_BF_EPT_PT_MEMTYPE_SHIFT                     3
     490#define VMX_BF_EPT_PT_MEMTYPE_MASK                      UINT64_C(0x0000000000000038)
     491/** Ignore PAT. */
     492#define VMX_BF_EPT_PT_IGNORE_PAT_SHIFT                  6
     493#define VMX_BF_EPT_PT_IGNORE_PAT_MASK                   UINT64_C(0x0000000000000040)
     494/** Ignored (bit 7). */
     495#define VMX_BF_EPT_PT_IGN_7_SHIFT                       7
     496#define VMX_BF_EPT_PT_IGN_7_MASK                        UINT64_C(0x0000000000000080)
     497/** Accessed flag. */
     498#define VMX_BF_EPT_PT_ACCESSED_SHIFT                    8
     499#define VMX_BF_EPT_PT_ACCESSED_MASK                     UINT64_C(0x0000000000000100)
     500/** Dirty flag. */
     501#define VMX_BF_EPT_PT_DIRTY_SHIFT                       9
     502#define VMX_BF_EPT_PT_DIRTY_MASK                        UINT64_C(0x0000000000000200)
     503/** Execute access for user-mode linear addresses. */
     504#define VMX_BF_EPT_PT_EXECUTE_USER_SHIFT                10
     505#define VMX_BF_EPT_PT_EXECUTE_USER_MASK                 UINT64_C(0x0000000000000400)
     506/** Ignored (bit 59:11). */
     507#define VMX_BF_EPT_PT_IGN_59_11_SHIFT                   11
     508#define VMX_BF_EPT_PT_IGN_59_11_MASK                    UINT64_C(0x0ffffffffffff800)
     509/** Supervisor shadow stack. */
     510#define VMX_BF_EPT_PT_SUPER_SHW_STACK_SHIFT             60
     511#define VMX_BF_EPT_PT_SUPER_SHW_STACK_MASK              UINT64_C(0x1000000000000000)
     512/** Ignored (bits 62:61). */
     513#define VMX_BF_EPT_PT_IGN_62_61_SHIFT                   61
     514#define VMX_BF_EPT_PT_IGN_62_61_MASK                    UINT64_C(0x6000000000000000)
     515/** Suppress \#VE. */
     516#define VMX_BF_EPT_PT_SUPPRESS_VE_SHIFT                 63
     517#define VMX_BF_EPT_PT_SUPPRESS_VE_MASK                  UINT64_C(0x8000000000000000)
     518RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_EPT_PT_, UINT64_C(0), UINT64_MAX,
     519                            (READ, WRITE, EXECUTE, MEMTYPE, IGNORE_PAT, IGN_7, ACCESSED, DIRTY, EXECUTE_USER, IGN_59_11,
     520                            SUPER_SHW_STACK, IGN_62_61, SUPPRESS_VE));
    474521/** @} */
    475522
     
    582629AssertCompileSize(EPTPDPTEBITS, 8);
    583630
     631/** Bit 7 - - EPT - PDPTE maps a 1GB page. */
     632#define EPT_PDPTE1G_SIZE_MASK       RT_BIT_64(7)
    584633/** Bits 12-51 - - EPT - Physical Page number of the next level. */
    585 #define EPT_PDPTE_PG_MASK       X86_PDPE_PG_MASK
     634#define EPT_PDPTE_PG_MASK           X86_PDPE_PG_MASK
     635/** Bits 12-51 - - EPT - Physical Page number of the next level. */
     636#define EPT_PDPTE1G_PG_MASK         X86_PDPE_PG_MASK
     637
    586638/** The page shift to get the PDPT index. */
    587 #define EPT_PDPT_SHIFT          X86_PDPT_SHIFT
     639#define EPT_PDPT_SHIFT              X86_PDPT_SHIFT
    588640/** The PDPT index mask (apply to a shifted page address). */
    589 #define EPT_PDPT_MASK           X86_PDPT_MASK_AMD64
     641#define EPT_PDPT_MASK               X86_PDPT_MASK_AMD64
    590642/** Bits 3-7 - - EPT - PDPTE MBZ Mask. */
    591 #define EPT_PDPTE_MBZ_MASK      UINT64_C(0x00000000000000f8)
     643#define EPT_PDPTE_MBZ_MASK          UINT64_C(0x00000000000000f8)
    592644/** Bits 12-29 - - EPT - 1GB PDPTE MBZ Mask. */
    593 #define EPT_PDPTE1G_MBZ_MASK    UINT64_C(0x000000003ffff000)
     645#define EPT_PDPTE1G_MBZ_MASK        UINT64_C(0x000000003ffff000)
     646/** Mask of all possible EPT PDPTE (1GB) attribute bits. */
     647#define EPT_PDPTE1G_ATTR_MASK       (  EPT_E_READ | EPT_E_WRITE | EPT_E_EXECUTE | EPT_E_MEMTYPE_MASK | EPT_E_IGNORE_PAT \
     648                                     | EPT_E_ACCESSED | EPT_E_DIRTY | EPT_E_USER_EXECUTE)
     649/** Mask of all possible EPT PDPTE attribute bits. */
     650#define EPT_PDPTE_ATTR_MASK         (EPT_E_READ | EPT_E_WRITE | EPT_E_EXECUTE | EPT_E_ACCESSED | EPT_E_USER_EXECUTE)
    594651/** */
    595652
     
    665722/** Bits 3-7 - EPT - PDE MBZ Mask. */
    666723#define EPT_PDE_MBZ_MASK        UINT64_C(0x00000000000000f8)
    667 
    668724
    669725
     
    819875typedef const EPTPT *PCEPTPT;
    820876
     877/** EPTP page mask for the EPT PML4 table. */
     878#define EPT_EPTP_PG_MASK        X86_CR3_AMD64_PAGE_MASK
    821879/** @} */
    822880
Note: See TracChangeset for help on using the changeset viewer.

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