VirtualBox

Changeset 20125 in vbox for trunk


Ignore:
Timestamp:
May 28, 2009 3:44:30 PM (16 years ago)
Author:
vboxsync
Message:

Prevent reuse of cached large pages with different access attributes.

Location:
trunk/src/VBox/VMM
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMBth.h

    r19627 r20125  
    167167
    168168    /* contruct a fake address. */
    169     GCPhysCR3 = RT_BIT_64(63);
     169    GCPhysCR3 = PGMPOOL_PHYS_NON_PAGED;
    170170    pVCpu->pgm.s.iShwUser      = SHW_POOL_ROOT_IDX;
    171171    pVCpu->pgm.s.iShwUserTable = GCPhysCR3 >> PAGE_SHIFT;
  • trunk/src/VBox/VMM/PGMInternal.h

    r20062 r20125  
    186186#endif
    187187
     188/** @} */
     189
     190/** @name PGM pool physical address flags
     191 *
     192 * These are bit markers for PGM pool physical addresses.
     193 * @{ */
     194#define PGMPOOL_PHYS_NON_PAGED          RT_BIT_64(63)
     195#define PGMPOOL_PHYS_ACCESS_USER        RT_BIT_64(62)       /* set = user, cleared = supervisor */
     196#define PGMPOOL_PHYS_ACCESS_RW          RT_BIT_64(61)       /* set = read/write, cleared = read-only. */
    188197/** @} */
    189198
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r20076 r20125  
    32333233            else
    32343234            {
    3235                 /* Temporariliy disabled phycial handler(s), since the recompiler
    3236                    doesn't get notified when it's reset we'll have to pretend its
     3235                /* Temporarily disabled physical handler(s), since the recompiler
     3236                   doesn't get notified when it's reset we'll have to pretend it's
    32373237                   operating normally. */
    32383238                if (pgmHandlerPhysicalIsAll(pVM, GCPhys))
     
    32663266            *ppv = (void *)((uintptr_t)pTlbe->pv | (GCPhys & PAGE_OFFSET_MASK));
    32673267            /** @todo mapping/locking hell; this isn't horribly efficient since
    3268              *        pgmPhysPageLoadIntoTlb will repeate the lookup we've done here. */
     3268             *        pgmPhysPageLoadIntoTlb will repeat the lookup we've done here. */
    32693269
    32703270            Log6(("PGMR3PhysTlbGCPhys2Ptr: GCPhys=%RGp rc=%Rrc pPage=%R[pgmpage] *ppv=%p\n", GCPhys, rc, pPage, *ppv));
  • trunk/src/VBox/VMM/PGMShw.h

    r19659 r20125  
    180180{
    181181#if PGM_SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT
    182     RTGCPHYS     GCPhysCR3 = RT_BIT_64(63);
     182    RTGCPHYS     GCPhysCR3 = PGMPOOL_PHYS_NON_PAGED;
    183183    PPGMPOOLPAGE pNewShwPageCR3;
    184184    PVM          pVM       = pVCpu->pVMR3;
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r20069 r20125  
    25852585            GCPhys |= (iPDDst & 1) * (PAGE_SIZE / 2);
    25862586# endif
     2587            /* Modify the physical address to distinguish between different access types to prevent incorrect reuse of cached entries. */
     2588            if (PdeSrc.n.u1Write)
     2589                GCPhys |= PGMPOOL_PHYS_ACCESS_RW;
     2590            if (PdeSrc.n.u1User)
     2591                GCPhys |= PGMPOOL_PHYS_ACCESS_USER;
     2592
    25872593            rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_PT, pShwPde->idx,      iPDDst, &pShwPage);
    25882594        }
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