VirtualBox

Changeset 105745 in vbox for trunk/include


Ignore:
Timestamp:
Aug 21, 2024 7:16:50 AM (3 months ago)
Author:
vboxsync
Message:

VMM/PGM: Some preparations for ARMv8 page table walking, introduce dedicated PGMMODE enumerations for ARMv8 and hide all accesses behind PGMMODE_XXX macros, bugref:10388

File:
1 edited

Legend:

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

    r105177 r105745  
    250250
    251251
     252/** @todo r=aeichner This doesn't seem to be used outside of the VMM module, so we might make
     253 *                   all APIs (PGMGetGuestMode(), etc.) internal and split this up into an
     254 *                   x86 and arm specific header. */
    252255/**
    253256 * Paging mode.
     
    259262    /** The usual invalid value. */
    260263    PGMMODE_INVALID = 0,
     264#ifndef VBOX_VMM_TARGET_ARMV8
    261265    /** Real mode. */
    262266    PGMMODE_REAL,
     
    283287    /** Special mode used by NEM to indicate no shadow paging necessary. */
    284288    PGMMODE_NONE,
     289#else
     290    /** Paging is not enabled by the guest. */
     291    PGMMODE_NONE,
     292    /** VMSAv8-32 Virtual Memory System Architecture v8 - 32-bit variant enabled. */
     293    PGMMODE_VMSA_V8_32,
     294    /** VMSAv8-64 Virtual Memory System Architecture v8 - 64-bit variant enabled. */
     295    PGMMODE_VMSA_V8_64,
     296#endif
    285297    /** The max number of modes */
    286298    PGMMODE_MAX,
     
    288300    PGMMODE_32BIT_HACK = 0x7fffffff
    289301} PGMMODE;
     302
    290303
    291304/**
     
    659672
    660673
     674#ifndef VBOX_VMM_TARGET_ARMV8
    661675/** Macro for checking if the guest is using paging.
    662676 * @param enmMode   PGMMODE_*.
    663677 * @remark  ASSUMES certain order of the PGMMODE_* values.
    664678 */
    665 #define PGMMODE_WITH_PAGING(enmMode) ((enmMode) >= PGMMODE_32_BIT)
     679# define PGMMODE_WITH_PAGING(enmMode) ((enmMode) >= PGMMODE_32_BIT)
    666680
    667681/** Macro for checking if it's one of the long mode modes.
    668682 * @param enmMode   PGMMODE_*.
    669683 */
    670 #define PGMMODE_IS_LONG_MODE(enmMode) ((enmMode) == PGMMODE_AMD64_NX || (enmMode) == PGMMODE_AMD64)
     684# define PGMMODE_IS_64BIT_MODE(enmMode) ((enmMode) == PGMMODE_AMD64_NX || (enmMode) == PGMMODE_AMD64)
    671685
    672686/** Macro for checking if it's one of the AMD64 nested modes.
    673687 * @param enmMode   PGMMODE_*.
    674688 */
    675 #define PGMMODE_IS_NESTED(enmMode)  (   (enmMode) == PGMMODE_NESTED_32BIT \
    676                                      || (enmMode) == PGMMODE_NESTED_PAE \
    677                                      || (enmMode) == PGMMODE_NESTED_AMD64)
     689# define PGMMODE_IS_NESTED(enmMode)  (   (enmMode) == PGMMODE_NESTED_32BIT \
     690                                      || (enmMode) == PGMMODE_NESTED_PAE \
     691                                      || (enmMode) == PGMMODE_NESTED_AMD64)
    678692
    679693/** Macro for checking if it's one of the PAE modes.
    680694 * @param enmMode   PGMMODE_*.
    681695 */
    682 #define PGMMODE_IS_PAE(enmMode)     (   (enmMode) == PGMMODE_PAE \
    683                                      || (enmMode) == PGMMODE_PAE_NX)
     696# define PGMMODE_IS_PAE(enmMode)     (   (enmMode) == PGMMODE_PAE \
     697                                      || (enmMode) == PGMMODE_PAE_NX)
     698#else
     699/** Macro for checking if the guest is using paging.
     700 * @param enmMode   PGMMODE_*.
     701 * @remark  ASSUMES certain order of the PGMMODE_* values.
     702 */
     703# define PGMMODE_WITH_PAGING(enmMode) ((enmMode) > PGMMODE_NONE)
     704
     705/** Macro for checking if it's the 64-bit translation mode.
     706 * @param enmMode   PGMMODE_*.
     707 */
     708# define PGMMODE_IS_64BIT_MODE(enmMode) ((enmMode) == PGMMODE_VMSA_V8_64)
     709#endif
     710
    684711
    685712/**
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