VirtualBox

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


Ignore:
Timestamp:
Oct 6, 2011 8:49:36 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74324
Message:

PGM: Attempt at fixing the VERR_MAP_FAILED during state save problem on 32-bit hosts when assigning lots of memory to the guest. PGM should lock down guest RAM pages before use and release them afterwards like everyone else. Still quite some stuff left to do there, so I've deviced a little hack for tracking unlocked mappings and using this as input when deciding to do async or sync chunk unmapping at save/load time. See xtracker #5912 and public ticket 7929.

Location:
trunk/src/VBox/VMM/include
Files:
2 edited

Legend:

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

    r38708 r38953  
    257257#else
    258258# define PGM_GCPHYS_2_PTR_V2(pVM, pVCpu, GCPhys, ppv) \
    259      PGMPhysGCPhys2R3Ptr(pVM, GCPhys, 1 /* one page only */, (PRTR3PTR)(ppv)) /** @todo this isn't asserting, use PGMRamGCPhys2HCPtr! */
     259     pgmPhysGCPhys2R3Ptr(pVM, GCPhys, (PRTR3PTR)(ppv)) /** @todo this isn't asserting! */
    260260#endif
    261261
     
    305305#else
    306306# define PGM_GCPHYS_2_PTR_EX(pVM, GCPhys, ppv) \
    307      PGMPhysGCPhys2R3Ptr(pVM, GCPhys, 1 /* one page only */, (PRTR3PTR)(ppv)) /** @todo this isn't asserting, use PGMRamGCPhys2HCPtr! */
     307     pgmPhysGCPhys2R3Ptr(pVM, GCPhys, (PRTR3PTR)(ppv)) /** @todo this isn't asserting! */
    308308#endif
    309309
     
    31463146    /** The address of the ring-0 mapping cache if we're making use of it.  */
    31473147    RTR0PTR                         pvR0DynMapUsed;
    3148 #if HC_ARCH_BITS == 32
    3149     /** Alignment padding that makes the next member start on a 8 byte boundary. */
     3148
     3149    /** Hack: Number of deprecated page mapping locks taken by the current lock
     3150     *  owner via pgmPhysGCPhys2CCPtrInternalDepr. */
     3151    uint32_t                        cDeprecatedPageLocks;
     3152#if HC_ARCH_BITS == 64
     3153    /** Alignment padding.  */
    31503154    uint32_t                        u32Alignment2;
    31513155#endif
     3156
    31523157
    31533158    /** PGM critical section.
     
    31553160     * and the page flag updating (some of it anyway).
    31563161     */
    3157     PDMCRITSECT                     CritSect;
     3162    PDMCRITSECT                     CritSectX;
    31583163
    31593164    /**
     
    33413346AssertCompileMemberAlignment(PGM, GCPtrMappingFixed, sizeof(RTGCPTR));
    33423347AssertCompileMemberAlignment(PGM, HCPhysInterPD, 8);
    3343 AssertCompileMemberAlignment(PGM, CritSect, 8);
     3348AssertCompileMemberAlignment(PGM, CritSectX, 8);
    33443349AssertCompileMemberAlignment(PGM, ChunkR3Map, 8);
    33453350AssertCompileMemberAlignment(PGM, PhysTlbHC, 8);
     
    38543859 * @param   a_pVM           The VM handle.
    38553860 */
    3856 #define PGM_LOCK_ASSERT_OWNER(a_pVM)    Assert(PDMCritSectIsOwner(&(a_pVM)->pgm.s.CritSect))
     3861#define PGM_LOCK_ASSERT_OWNER(a_pVM)    Assert(PDMCritSectIsOwner(&(a_pVM)->pgm.s.CritSectX))
     3862/**
     3863 * Asserts that the caller owns the PDM lock.
     3864 * This is the internal variant of PGMIsLockOwner.
     3865 * @param   a_pVM           The VM handle.
     3866 * @param   a_pVCpu         The current CPU handle.
     3867 */
     3868#define PGM_LOCK_ASSERT_OWNER_EX(a_pVM, a_pVCpu)  Assert(PDMCritSectIsOwnerEx(&(a_pVM)->pgm.s.CritSectX, pVCpu))
    38573869
    38583870int             pgmR3MappingsFixInternal(PVM pVM, RTGCPTR GCPtrBase, uint32_t cb);
     
    38873899int             pgmPhysPageMapReadOnly(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void const **ppv);
    38883900int             pgmPhysPageMapByPageID(PVM pVM, uint32_t idPage, RTHCPHYS HCPhys, void **ppv);
    3889 int             pgmPhysGCPhys2CCPtrInternal(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void **ppv);
    3890 int             pgmPhysGCPhys2CCPtrInternalReadOnly(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, const void **ppv);
     3901int             pgmPhysGCPhys2R3Ptr(PVM pVM, RTGCPHYS GCPhys, PRTR3PTR pR3Ptr);
     3902int             pgmPhysGCPhys2CCPtrInternalDepr(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void **ppv);
     3903int             pgmPhysGCPhys2CCPtrInternal(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void **ppv, PPGMPAGEMAPLOCK pLock);
     3904int             pgmPhysGCPhys2CCPtrInternalReadOnly(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, const void **ppv, PPGMPAGEMAPLOCK pLock);
     3905void            pgmPhysReleaseInternalPageMappingLock(PVM pVM, PPGMPAGEMAPLOCK pLock);
    38913906VMMDECL(int)    pgmPhysHandlerRedirectToHC(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser);
    38923907VMMDECL(int)    pgmPhysRomWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser);
  • trunk/src/VBox/VMM/include/internal/pgm.h

    r35346 r38953  
    6565VMMDECL(int)        PGMPhysGCPtr2CCPtr(PVMCPU pVCpu, RTGCPTR GCPtr, void **ppv, PPGMPAGEMAPLOCK pLock);
    6666VMMDECL(int)        PGMPhysGCPtr2CCPtrReadOnly(PVMCPU pVCpu, RTGCPTR GCPtr, void const **ppv, PPGMPAGEMAPLOCK pLock);
    67 VMMDECL(int)        PGMPhysGCPhys2R3Ptr(PVM pVM, RTGCPHYS GCPhys, RTUINT cbRange, PRTR3PTR pR3Ptr);
    68 #ifdef VBOX_STRICT
    69 VMMDECL(RTR3PTR)    PGMPhysGCPhys2R3PtrAssert(PVM pVM, RTGCPHYS GCPhys, RTUINT cbRange);
    70 #endif
    7167VMMR3DECL(void)     PGMR3ResetNoMorePhysWritesFlag(PVM pVM);
    7268
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette