VirtualBox

Changeset 17622 in vbox for trunk/src/VBox/VMM/PGMMap.cpp


Ignore:
Timestamp:
Mar 10, 2009 12:32:23 PM (16 years ago)
Author:
vboxsync
Message:

Simple check added to make sure we don't bounce back and forth between hypervisor mappings that have caused conflicts in the past.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMMap.cpp

    r17594 r17622  
    10701070}
    10711071
     1072/**
     1073 * Checks if a new mapping address wasn't previously used and caused a clash with guest mappings.
     1074 *
     1075 * @returns VBox status code.
     1076 * @param   pMapping            The mapping which conflicts.
     1077 * @param   GCPtr               New mapping address to try
     1078 */
     1079bool pgmR3MapIsKnownConflictAddress(PPGMMAPPING pMapping, RTGCPTR GCPtr)
     1080{
     1081    for (int i=0;i<RT_ELEMENTS(pMapping->GCPtrConflict);i++)
     1082    {
     1083        if (GCPtr == pMapping->GCPtrConflict[i])
     1084            return true;
     1085    }
     1086    return false;
     1087}
    10721088
    10731089/**
     
    10861102    STAM_PROFILE_START(&pVM->pgm.s.StatR3ResolveConflict, a);
    10871103
     1104    pMapping->GCPtrConflict[pMapping->cConflicts & (PGMMAPPING_CONFLICT_MAX-1)] = GCPtrOldMapping;
     1105    pMapping->cConflicts++;
     1106
    10881107    /*
    10891108     * Scan for free page directory entries.
     
    10981117        if (pPDSrc->a[iPDNew].n.u1Present)
    10991118            continue;
     1119
     1120        if (pgmR3MapIsKnownConflictAddress(pMapping, iPDNew << X86_PD_SHIFT))
     1121            continue;
     1122
    11001123        if (cPTs > 1)
    11011124        {
     
    11521175    STAM_PROFILE_START(&pVM->pgm.s.StatR3ResolveConflict, a);
    11531176
     1177    pMapping->GCPtrConflict[pMapping->cConflicts & (PGMMAPPING_CONFLICT_MAX-1)] = GCPtrOldMapping;
     1178    pMapping->cConflicts++;
     1179
    11541180    for (int iPDPTE = X86_PG_PAE_PDPE_ENTRIES - 1; iPDPTE >= 0; iPDPTE--)
    11551181    {
     
    11711197            /* Ugly assumption that mappings start on a 4 MB boundary. */
    11721198            if (iPDNew & 1)
     1199                continue;
     1200
     1201            if (pgmR3MapIsKnownConflictAddress(pMapping, ((RTGCPTR32)iPDPTE << X86_PDPT_SHIFT) + (iPDNew << X86_PD_PAE_SHIFT)))
    11731202                continue;
    11741203
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