VirtualBox

Changeset 91929 in vbox


Ignore:
Timestamp:
Oct 21, 2021 10:12:24 AM (3 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:10092 Laid out PGM_BF_PTWALK_EFF_* bitfields including the new EPT bits. There should be sufficient room for future bits like supervisor shadow stack, suppress VE exception etc.
Made it as a bitfield rather than just flags since EPT memory type fields occupy more than 1 bit and may be required in the future.

File:
1 edited

Legend:

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

    r91904 r91929  
    23542354/** @name PGMPTWALKCORE::fEffective bits.
    23552355 * @{ */
     2356#if 0
    23562357/** Effective execute bit (!NX).   */
    2357 #define PGMPTWALK_EFF_X     UINT32_C(1)
    2358 /** Effective write access bit. */
    2359 #define PGMPTWALK_EFF_RW    X86_PTE_RW
     2358#define PGMPTWALK_EFF_X                 RT_BIT_32(0)
     2359/** Effective read+write access bit. */
     2360#define PGMPTWALK_EFF_RW                X86_PTE_RW
    23602361/** Effective user-mode access bit. */
    2361 #define PGMPTWALK_EFF_US    X86_PTE_US
     2362#define PGMPTWALK_EFF_US                X86_PTE_US
    23622363/** Effective write through cache bit. */
    2363 #define PGMPTWALK_EFF_PWT   X86_PTE_PWT
     2364#define PGMPTWALK_EFF_PWT               X86_PTE_PWT
    23642365/** Effective cache disabled bit. */
    2365 #define PGMPTWALK_EFF_PCD   X86_PTE_PCD
     2366#define PGMPTWALK_EFF_PCD               X86_PTE_PCD
    23662367/** Effective accessed bit. */
    2367 #define PGMPTWALK_EFF_A     X86_PTE_A
     2368#define PGMPTWALK_EFF_A                 X86_PTE_A
    23682369/** The dirty bit of the final entry. */
    2369 #define PGMPTWALK_EFF_D     X86_PTE_D
     2370#define PGMPTWALK_EFF_D                 X86_PTE_D
    23702371/** The PAT bit of the final entry. */
    2371 #define PGMPTWALK_EFF_PAT   X86_PTE_PAT
     2372#define PGMPTWALK_EFF_PAT               X86_PTE_PAT
    23722373/** The global bit of the final entry. */
    2373 #define PGMPTWALK_EFF_G     X86_PTE_G
     2374#define PGMPTWALK_EFF_G                 X86_PTE_G
     2375#endif
     2376/** Effective execute bit (!NX). */
     2377#define PGM_BF_PTWALK_EFF_X_SHIFT                   0
     2378#define PGM_BF_PTWALK_EFF_X_MASK                    UINT32_C(0x00000001)
     2379/** Effective read+write access bit. */
     2380#define PGM_BF_PTWALK_EFF_RW_SHIFT                  1
     2381#define PGM_BF_PTWALK_EFF_RW_MASK                   UINT32_C(0x00000002)
     2382/** Effective user-mode access bit. */
     2383#define PGM_BF_PTWALK_EFF_US_SHIFT                  2
     2384#define PGM_BF_PTWALK_EFF_US_MASK                   UINT32_C(0x00000004)
     2385/** Effective write through cache bit. */
     2386#define PGM_BF_PTWALK_EFF_PWT_SHIFT                 3
     2387#define PGM_BF_PTWALK_EFF_PWT_MASK                  UINT32_C(0x00000008)
     2388/** Effective cache disabled bit. */
     2389#define PGM_BF_PTWALK_EFF_PCD_SHIFT                 4
     2390#define PGM_BF_PTWALK_EFF_PCD_MASK                  UINT32_C(0x00000010)
     2391/** Effective accessed bit. */
     2392#define PGM_BF_PTWALK_EFF_A_SHIFT                   5
     2393#define PGM_BF_PTWALK_EFF_A_MASK                    UINT32_C(0x00000020)
     2394/** The dirty bit of the final entry. */
     2395#define PGM_BF_PTWALK_EFF_D_SHIFT                   6
     2396#define PGM_BF_PTWALK_EFF_D_MASK                    UINT32_C(0x00000040)
     2397/** The PAT bit of the final entry. */
     2398#define PGM_BF_PTWALK_EFF_PAT_SHIFT                 7
     2399#define PGM_BF_PTWALK_EFF_PAT_MASK                  UINT32_C(0x00000080)
     2400/** The global bit of the final entry. */
     2401#define PGM_BF_PTWALK_EFF_G_SHIFT                   8
     2402#define PGM_BF_PTWALK_EFF_G_MASK                    UINT32_C(0x00000100)
     2403/** Reserved (bits 11:9) unused. */
     2404#define PGM_BF_PTWALK_EFF_RSVD_11_9_SHIFT           9
     2405#define PGM_BF_PTWALK_EFF_RSVD_11_9_MASK            UINT32_C(0x00000e00)
     2406/** Effective read access bit - EPT only. */
     2407#define PGM_BF_PTWALK_EFF_R_SHIFT                   12
     2408#define PGM_BF_PTWALK_EFF_R_MASK                    UINT32_C(0x00001000)
     2409/** Effective write access bit - EPT only. */
     2410#define PGM_BF_PTWALK_EFF_W_SHIFT                   13
     2411#define PGM_BF_PTWALK_EFF_W_MASK                    UINT32_C(0x00002000)
     2412/** Effective execute access for supervisor-mode - EPT only. */
     2413#define PGM_BF_PTWALK_EFF_X_SUPER_SHIFT             14
     2414#define PGM_BF_PTWALK_EFF_X_SUPER_MASK              UINT32_C(0x00004000)
     2415/** Reserved (bits 21:15) unused. */
     2416#define PGM_BF_PTWALK_EFF_RSVD_21_15_SHIFT          15
     2417#define PGM_BF_PTWALK_EFF_RSVD_21_15_MASK           UINT32_C(0x003f8000)
     2418/** Effective execute access for user-mode - EPT only. */
     2419#define PGM_BF_PTWALK_EFF_X_USER_SHIFT              22
     2420#define PGM_BF_PTWALK_EFF_X_USER_MASK               UINT32_C(0x00400000)
     2421/** Reserved (bits 31:23). */
     2422#define PGM_BF_PTWALK_EFF_RSVD_31_23_SHIFT          23
     2423#define PGM_BF_PTWALK_EFF_RSVD_31_23_MASK           UINT32_C(0xff800000)
     2424RT_BF_ASSERT_COMPILE_CHECKS(PGM_BF_PTWALK_EFF_, UINT32_C(0), UINT32_MAX,
     2425                            (X, RW, US, PWT, PCD, A, D, PAT, G, RSVD_11_9, R, W, X_SUPER, RSVD_21_15, X_USER, RSVD_31_23));
     2426AssertCompile(PGM_BF_PTWALK_EFF_RW_SHIFT  == X86_PTE_BIT_RW);
     2427AssertCompile(PGM_BF_PTWALK_EFF_US_SHIFT  == X86_PTE_BIT_US);
     2428AssertCompile(PGM_BF_PTWALK_EFF_PWT_SHIFT == X86_PTE_BIT_PWT);
     2429AssertCompile(PGM_BF_PTWALK_EFF_PCD_SHIFT == X86_PTE_BIT_PCD);
     2430AssertCompile(PGM_BF_PTWALK_EFF_A_SHIFT   == X86_PTE_BIT_A);
     2431AssertCompile(PGM_BF_PTWALK_EFF_D_SHIFT   == X86_PTE_BIT_D);
     2432AssertCompile(PGM_BF_PTWALK_EFF_PAT_SHIFT == X86_PTE_BIT_PAT);
     2433AssertCompile(PGM_BF_PTWALK_EFF_G_SHIFT  == X86_PTE_BIT_G);
     2434AssertCompile(PGM_BF_PTWALK_EFF_RW_MASK  == X86_PTE_RW);
     2435AssertCompile(PGM_BF_PTWALK_EFF_US_MASK  == X86_PTE_US);
     2436AssertCompile(PGM_BF_PTWALK_EFF_PWT_MASK == X86_PTE_PWT);
     2437AssertCompile(PGM_BF_PTWALK_EFF_PCD_MASK == X86_PTE_PCD);
     2438AssertCompile(PGM_BF_PTWALK_EFF_A_MASK   == X86_PTE_A);
     2439AssertCompile(PGM_BF_PTWALK_EFF_D_MASK   == X86_PTE_D);
     2440AssertCompile(PGM_BF_PTWALK_EFF_PAT_MASK == X86_PTE_PAT);
     2441AssertCompile(PGM_BF_PTWALK_EFF_G_MASK   == X86_PTE_G);
    23742442/** @} */
    23752443
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