VirtualBox

Changeset 92311 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Nov 10, 2021 9:05:02 AM (3 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:10092 Use bit 63 for NX in the PGMPTATTRS, adjusted guest page walk template and SLAT EPT page walk template code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r92257 r92311  
    23562356 *   - SUPPRESS_VE_XCPT (Suppress \#VE exception) - EPT bit 63 maps to bit 25.
    23572357 *
    2358  * Bits 11:9 and bit 43 are deliberately kept unused (they correspond to bits 11:9
    2359  * in the page-table structures and to bit 11 in the EPT structures respectively) as
    2360  * they're reserved for use by software and we may want to preserve them in the
    2361  * future.
     2358 * Bits 12, 11:9 and 43 are deliberately kept unused (correspond to bit PS and bits
     2359 * 11:9 in the regular page-table structures and to bit 11 in the EPT structures
     2360 * respectively) as bit 12 is the page-size bit and bits 11:9 are reserved for
     2361 * use by software and we may want to use/preserve them in the future.
    23622362 *
    23632363 * @{ */
     
    23662366typedef PGMPTATTRS *PPGMPTATTRS;
    23672367
    2368 /** Execute bit (!NX). */
    2369 #define PGM_PTATTRS_X_SHIFT                         0
    2370 #define PGM_PTATTRS_X_MASK                          RT_BIT_64(PGM_PTATTRS_X_SHIFT)
     2368/** Reserved bit. */
     2369#define PGM_PTATTRS_RSVD_0_SHIFT                    0
     2370#define PGM_PTATTRS_RSVD_0_MASK                     RT_BIT_64(PGM_PTATTRS_RSVD_0_SHIFT)
    23712371/** Read and write access bit. */
    23722372#define PGM_PTATTRS_RW_SHIFT                        1
     
    23932393#define PGM_PTATTRS_G_SHIFT                         8
    23942394#define PGM_PTATTRS_G_MASK                          RT_BIT_64(PGM_PTATTRS_G_SHIFT)
    2395 /** Reserved (bits 11:9) unused. */
    2396 #define PGM_PTATTRS_RSVD_11_9_SHIFT                 9
    2397 #define PGM_PTATTRS_RSVD_11_9_MASK                  UINT64_C(0x0000000000000e00)
     2395/** Reserved (bits 12:9) unused. */
     2396#define PGM_PTATTRS_RSVD_12_9_SHIFT                 9
     2397#define PGM_PTATTRS_RSVD_12_9_MASK                  UINT64_C(0x0000000000001e00)
    23982398/** Read access bit - EPT only. */
    2399 #define PGM_PTATTRS_EPT_R_SHIFT                     12
     2399#define PGM_PTATTRS_EPT_R_SHIFT                     13
    24002400#define PGM_PTATTRS_EPT_R_MASK                      RT_BIT_64(PGM_PTATTRS_EPT_R_SHIFT)
    24012401/** Write access bit - EPT only. */
    2402 #define PGM_PTATTRS_EPT_W_SHIFT                     13
     2402#define PGM_PTATTRS_EPT_W_SHIFT                     14
    24032403#define PGM_PTATTRS_EPT_W_MASK                      RT_BIT_64(PGM_PTATTRS_EPT_W_SHIFT)
    24042404/** Execute or execute access for supervisor-mode linear addresses - EPT only. */
    2405 #define PGM_PTATTRS_EPT_X_SUPER_SHIFT               14
     2405#define PGM_PTATTRS_EPT_X_SUPER_SHIFT               15
    24062406#define PGM_PTATTRS_EPT_X_SUPER_MASK                RT_BIT_64(PGM_PTATTRS_EPT_X_SUPER_SHIFT)
    24072407/** EPT memory type - EPT only. */
    2408 #define PGM_PTATTRS_EPT_MEMTYPE_SHIFT               15
    2409 #define PGM_PTATTRS_EPT_MEMTYPE_MASK                UINT64_C(0x0000000000038000)
     2408#define PGM_PTATTRS_EPT_MEMTYPE_SHIFT               16
     2409#define PGM_PTATTRS_EPT_MEMTYPE_MASK                UINT64_C(0x0000000000070000)
    24102410/** Ignore PAT memory type - EPT only. */
    2411 #define PGM_PTATTRS_EPT_IGNORE_PAT_SHIFT            18
     2411#define PGM_PTATTRS_EPT_IGNORE_PAT_SHIFT            19
    24122412#define PGM_PTATTRS_EPT_IGNORE_PAT_MASK             RT_BIT_64(PGM_PTATTRS_EPT_IGNORE_PAT_SHIFT)
    2413 /** Reserved (bits 21:19) unused. */
    2414 #define PGM_PTATTRS_RSVD_21_19_SHIFT                19
    2415 #define PGM_PTATTRS_RSVD_21_19_MASK                 UINT64_C(0x0000000000380000)
     2413/** Reserved (bits 22:20) unused. */
     2414#define PGM_PTATTRS_RSVD_22_20_SHIFT                20
     2415#define PGM_PTATTRS_RSVD_22_20_MASK                 UINT64_C(0x0000000000700000)
    24162416/** Execute access for user-mode linear addresses - EPT only. */
    2417 #define PGM_PTATTRS_EPT_X_USER_SHIFT                22
     2417#define PGM_PTATTRS_EPT_X_USER_SHIFT                23
    24182418#define PGM_PTATTRS_EPT_X_USER_MASK                 RT_BIT_64(PGM_PTATTRS_EPT_X_USER_SHIFT)
    24192419/** Reserved (bit 23) - unused. */
    2420 #define PGM_PTATTRS_RSVD_23_SHIFT                   23
    2421 #define PGM_PTATTRS_RSVD_23_MASK                    UINT64_C(0x0000000000800000)
     2420#define PGM_PTATTRS_RSVD_23_SHIFT                   24
     2421#define PGM_PTATTRS_RSVD_23_MASK                    UINT64_C(0x0000000001000000)
    24222422/** Supervisor shadow stack - EPT only. */
    2423 #define PGM_PTATTRS_EPT_SUPER_SHW_STACK_SHIFT       24
     2423#define PGM_PTATTRS_EPT_SUPER_SHW_STACK_SHIFT       25
    24242424#define PGM_PTATTRS_EPT_SUPER_SHW_STACK_MASK        RT_BIT_64(PGM_PTATTRS_EPT_SUPER_SHW_STACK_SHIFT)
    24252425/** Suppress \#VE exception - EPT only. */
    2426 #define PGM_PTATTRS_EPT_SUPPRESS_VE_XCPT_SHIFT      25
     2426#define PGM_PTATTRS_EPT_SUPPRESS_VE_XCPT_SHIFT      26
    24272427#define PGM_PTATTRS_EPT_SUPPRESS_VE_XCPT_MASK       RT_BIT_64(PGM_PTATTRS_EPT_SUPPRESS_VE_XCPT_SHIFT)
    2428 /** Reserved (bits 63:26) - unused. */
    2429 #define PGM_PTATTRS_RSVD_63_26_SHIFT                26
    2430 #define PGM_PTATTRS_RSVD_63_26_MASK                 UINT64_C(0xfffffffffc000000)
     2428/** Reserved (bits 62:27) - unused. */
     2429#define PGM_PTATTRS_RSVD_62_27_SHIFT                27
     2430#define PGM_PTATTRS_RSVD_62_27_MASK                 UINT64_C(0x7ffffffff8000000)
     2431/** No-execute bit. */
     2432#define PGM_PTATTRS_NX_SHIFT                        63
     2433#define PGM_PTATTRS_NX_MASK                         RT_BIT_64(PGM_PTATTRS_NX_SHIFT)
     2434
    24312435RT_BF_ASSERT_COMPILE_CHECKS(PGM_PTATTRS_, UINT64_C(0), UINT64_MAX,
    2432                             (X, RW, US, PWT, PCD, A, D, PAT, G, RSVD_11_9, EPT_R, EPT_W, EPT_X_SUPER, EPT_MEMTYPE, EPT_IGNORE_PAT,
    2433                              RSVD_21_19, EPT_X_USER, RSVD_23, EPT_SUPER_SHW_STACK, EPT_SUPPRESS_VE_XCPT, RSVD_63_26));
     2436                            (RSVD_0, RW, US, PWT, PCD, A, D, PAT, G, RSVD_12_9, EPT_R, EPT_W, EPT_X_SUPER, EPT_MEMTYPE,
     2437                             EPT_IGNORE_PAT, RSVD_22_20, EPT_X_USER, RSVD_23, EPT_SUPER_SHW_STACK, EPT_SUPPRESS_VE_XCPT,
     2438                             RSVD_62_27, NX));
    24342439
    24352440/** The bit position where the EPT specific attributes begin. */
    2436 #define PGM_PTATTRS_EPT_SHIFT                   PGM_PTATTRS_EPT_R_SHIFT
    2437 /** The mask of EPT bits (bits 63:ATTR_SHIFT). In the future we might choose to
     2441#define PGM_PTATTRS_EPT_SHIFT                       PGM_PTATTRS_EPT_R_SHIFT
     2442/** The mask of EPT bits (bits 26:ATTR_SHIFT). In the future we might choose to
    24382443 *  use higher unused bits for something else, in that case adjust this mask. */
    2439 #define PGM_PTATTRS_EPT_MASK                        UINT64_C(0xfffffffffffff000)
     2444#define PGM_PTATTRS_EPT_MASK                        UINT64_C(0x0000000007ffe000)
    24402445
    24412446/** The mask of all PGM page attribute bits for regular page-tables. */
    2442 #define PGM_PTATTRS_PT_VALID_MASK                   (  PGM_PTATTRS_X_MASK \
    2443                                                      | PGM_PTATTRS_RW_MASK \
     2447#define PGM_PTATTRS_PT_VALID_MASK                   (  PGM_PTATTRS_RW_MASK \
    24442448                                                     | PGM_PTATTRS_US_MASK \
    24452449                                                     | PGM_PTATTRS_PWT_MASK \
     
    24482452                                                     | PGM_PTATTRS_D_MASK \
    24492453                                                     | PGM_PTATTRS_PAT_MASK \
    2450                                                      | PGM_PTATTRS_G_MASK)
     2454                                                     | PGM_PTATTRS_G_MASK \
     2455                                                     | PGM_PTATTRS_NX_MASK)
    24512456
    24522457/** The mask of all PGM page attribute bits for EPT. */
    2453 #define PGM_PTATTRS_EPT_VALID_MASK                  (  PGM_PTATTRS_X_MASK \
    2454                                                      | PGM_PTATTRS_RW_MASK \
    2455                                                      | PGM_PTATTRS_US_MASK \
    2456                                                      | PGM_PTATTRS_A_MASK \
     2458#define PGM_PTATTRS_EPT_VALID_MASK                  (  PGM_PTATTRS_A_MASK \
    24572459                                                     | PGM_PTATTRS_D_MASK \
    24582460                                                     | PGM_PTATTRS_R_MASK \
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