VirtualBox

Ignore:
Timestamp:
Aug 21, 2024 7:16:50 AM (5 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/src/VBox/VMM/VMMR3/DBGFMem.cpp

    r105352 r105745  
    8080    PVMCPU  pVCpu   = VMMGetCpuById(pVM, idCpu);
    8181    PGMMODE enmMode = PGMGetGuestMode(pVCpu);
    82     if (    enmMode == PGMMODE_REAL
    83         ||  enmMode == PGMMODE_PROTECTED
     82    if (    !PGMMODE_WITH_PAGING(enmMode)
    8483        ||  DBGFADDRESS_IS_PHYS(pAddress)
    8584        )
     
    9897        if (    (   pAddress->FlatPtr >= _4G
    9998                 || pAddress->FlatPtr + cbRange > _4G)
    100             &&  enmMode != PGMMODE_AMD64
    101             &&  enmMode != PGMMODE_AMD64_NX)
     99            &&  !PGMMODE_IS_64BIT_MODE(enmMode))
    102100            return VERR_DBGF_MEM_NOT_FOUND;
    103101#endif
     
    174172    PVMCPU  pVCpu   = VMMGetCpuById(pVM, idCpu);
    175173    PGMMODE enmMode = PGMGetGuestMode(pVCpu);
    176     if (    enmMode == PGMMODE_REAL
    177         ||  enmMode == PGMMODE_PROTECTED
    178         ||  DBGFADDRESS_IS_PHYS(pAddress) )
     174    if (    !PGMMODE_WITH_PAGING(enmMode)
     175        ||  DBGFADDRESS_IS_PHYS(pAddress))
    179176        rc = PGMPhysSimpleReadGCPhys(pVM, pvBuf, pAddress->FlatPtr, cbRead);
    180177    else
     
    183180        if (    (   pAddress->FlatPtr >= _4G
    184181                 || pAddress->FlatPtr + cbRead > _4G)
    185             &&  enmMode != PGMMODE_AMD64
    186             &&  enmMode != PGMMODE_AMD64_NX)
     182            &&  !PGMMODE_IS_64BIT_MODE(enmMode))
    187183            return VERR_PAGE_TABLE_NOT_PRESENT;
    188184#endif
     
    327323    PVMCPU  pVCpu   = VMMGetCpuById(pVM, idCpu);
    328324    PGMMODE enmMode = PGMGetGuestMode(pVCpu);
    329     if (    enmMode == PGMMODE_REAL
    330         ||  enmMode == PGMMODE_PROTECTED
    331         ||  DBGFADDRESS_IS_PHYS(pAddress) )
     325    if (   !PGMMODE_WITH_PAGING(enmMode)
     326        || DBGFADDRESS_IS_PHYS(pAddress))
    332327        rc = PGMPhysSimpleWriteGCPhys(pVM, pAddress->FlatPtr, pvBuf, cbWrite);
    333328    else
     
    336331        if (    (   pAddress->FlatPtr >= _4G
    337332                 || pAddress->FlatPtr + cbWrite > _4G)
    338             &&  enmMode != PGMMODE_AMD64
    339             &&  enmMode != PGMMODE_AMD64_NX)
     333            &&  !PGMMODE_IS_64BIT_MODE(enmMode))
    340334            return VERR_PAGE_TABLE_NOT_PRESENT;
    341335#endif
     
    512506    switch (enmMode)
    513507    {
     508#if !defined(VBOX_VMM_TARGET_ARMV8)
    514509        case PGMMODE_32_BIT:
    515510            return DBGFPGDMP_FLAGS_PSE;
     
    534529        default:
    535530            AssertFailedReturn(UINT32_MAX);
     531#else
     532        case PGMMODE_NONE:
     533            return 0;
     534        default:
     535            AssertFailedReturn(UINT32_MAX);
     536#endif
    536537    }
    537538}
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