VirtualBox

Changeset 9874 in vbox


Ignore:
Timestamp:
Jun 23, 2008 1:45:00 PM (16 years ago)
Author:
vboxsync
Message:

Clear shadow pae pd & pdpte entries when changed.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r9858 r9874  
    8282# define GST_BIG_PAGE_SIZE          X86_PAGE_2M_SIZE
    8383# define GST_BIG_PAGE_OFFSET_MASK   X86_PAGE_2M_OFFSET_MASK
    84 # define GST_PDE_PG_MASK            X86_PDE_PAE_PG_MASK
     84# define GST_PDE_PG_MASK            X86_PDE_PAE_PG_MASK_FULL
    8585# define GST_PDE_BIG_PG_MASK        X86_PDE2M_PAE_PG_MASK
    8686# define GST_PD_SHIFT               X86_PD_PAE_SHIFT
     
    8989#  define GST_TOTAL_PD_ENTRIES      (X86_PG_PAE_ENTRIES * X86_PG_PAE_PDPE_ENTRIES)
    9090#  define GST_PDPE_ENTRIES          X86_PG_PAE_PDPE_ENTRIES
    91 #  define GST_PDPE_PG_MASK          X86_PDPE_PG_MASK
     91#  define GST_PDPE_PG_MASK          X86_PDPE_PG_MASK_FULL
    9292#  define GST_PDPT_SHIFT            X86_PDPT_SHIFT
    9393#  define GST_PDPT_MASK             X86_PDPT_MASK_PAE
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r9778 r9874  
    403403            case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    404404            {
    405                 const unsigned iShw = off / sizeof(X86PTEPAE);
     405                const unsigned iShw = off / sizeof(X86PDEPAE);
    406406                if (uShw.pPDPae->a[iShw].u & PGM_PDFLAGS_MAPPING)
    407407                {
     
    410410                    LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw=%#x!\n", iShw));
    411411                }
     412
     413                if (uShw.pPDPae->a[iShw].n.u1Present)
     414                {
     415                    LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw=%#x: %RX64 -> freeing it!\n", iShw, uShw.pPDPae->a[iShw].u));
     416                    pgmPoolFree(pPool->CTXSUFF(pVM), uShw.pPDPae->a[iShw].u & X86_PDE_PAE_PG_MASK, pPage->idx, iShw);
     417                    uShw.pPDPae->a[iShw].u = 0;
     418                }
     419
    412420                /* paranoia / a bit assumptive. */
    413                 else if (   pCpu
    414                          && (off & 7)
    415                          && (off & 7) + pgmPoolDisasWriteSize(pCpu) > sizeof(X86PTEPAE))
     421                if (   pCpu
     422                    && (off & 7)
     423                    && (off & 7) + pgmPoolDisasWriteSize(pCpu) > sizeof(X86PTEPAE))
    416424                {
    417425                    const unsigned iShw2 = (off + pgmPoolDisasWriteSize(pCpu) - 1) / sizeof(X86PTEPAE);
     
    424432                        LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw2=%#x!\n", iShw2));
    425433                    }
     434                    if (uShw.pPDPae->a[iShw2].n.u1Present)
     435                    {
     436                        LogFlow(("pgmPoolMonitorChainChanging: pae pd iShw2=%#x: %RX64 -> freeing it!\n", iShw2, uShw.pPDPae->a[iShw2].u));
     437                        pgmPoolFree(pPool->CTXSUFF(pVM), uShw.pPDPae->a[iShw2].u & X86_PDE_PAE_PG_MASK, pPage->idx, iShw2);
     438                        uShw.pPDPae->a[iShw2].u = 0;
     439                    }
    426440                }
    427 #if 0 /* useful when running PGMAssertCR3(), a bit too troublesome for general use (TLBs). */
    428                 if (    uShw.pPDPae->a[iShw].n.u1Present
    429                     &&  !VM_FF_ISSET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3))
    430                 {
    431                     LogFlow(("pgmPoolMonitorChainChanging: iShw=%#x: %RX32 -> freeing it!\n", iShw, uShw.pPDPae->a[iShw].u));
    432 # ifdef IN_GC       /* TLB load - we're pushing things a bit... */
    433                     ASMProbeReadByte(pvAddress);
    434 # endif
    435                     pgmPoolFree(pPool->CTXSUFF(pVM), uShwpPDPae->a[iShw].u & X86_PDE_PG_MASK, pPage->idx, iShw);
    436                     uShw.pPDPae->a[iShw].u = 0;
    437                 }
    438 #endif
    439441                break;
    440442            }
     
    479481                 * - messing with the bits of pd pointers without changing the physical address
    480482                 */
    481 #if 0 /* useful when running PGMAssertCR3(), a bit too troublesome for general use (TLBs). */
    482                 const unsigned iShw = off / sizeof(X86PDPE);
    483                 if (    uShw.pPDPT->a[iShw].n.u1Present
    484                     &&  !VM_FF_ISSET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3))
     483                if (!VM_FF_ISSET(pPool->CTXSUFF(pVM), VM_FF_PGM_SYNC_CR3))
    485484                {
    486                     LogFlow(("pgmPoolMonitorChainChanging: iShw=%#x: %RX64 -> freeing it!\n", iShw, uShw.pPDPT->a[iShw].u));
    487                     pgmPoolFree(pPool->CTXSUFF(pVM), uShw.pPDPT->a[iShw].u & X86_PDE_PAE_PG_MASK, pPage->idx, iShw);
    488                     uShw.pPDPT->a[iShw].u = 0;
     485                    const unsigned iShw = off / sizeof(X86PDPE);
     486                    if (uShw.pPDPT->a[iShw].n.u1Present)
     487                    {
     488                        LogFlow(("pgmPoolMonitorChainChanging: pdpt iShw=%#x: %RX64 -> freeing it!\n", iShw, uShw.pPDPT->a[iShw].u));
     489                        pgmPoolFree(pPool->CTXSUFF(pVM), uShw.pPDPT->a[iShw].u & X86_PDE_PAE_PG_MASK, pPage->idx, iShw);
     490                        uShw.pPDPT->a[iShw].u = 0;
     491                    }
     492                    /* paranoia / a bit assumptive. */
     493                    if (   pCpu
     494                        && (off & 7)
     495                        && (off & 7) + pgmPoolDisasWriteSize(pCpu) > sizeof(X86PDPE))
     496                    {
     497                        const unsigned iShw2 = (off + pgmPoolDisasWriteSize(pCpu) - 1) / sizeof(X86PDPE);
     498                        if (uShw.pPDPT->a[iShw2].n.u1Present)
     499                        {
     500                            LogFlow(("pgmPoolMonitorChainChanging: pdpt iShw2=%#x: %RX64 -> freeing it!\n", iShw2, uShw.pPDPT->a[iShw2].u));
     501                            pgmPoolFree(pPool->CTXSUFF(pVM), uShw.pPDPT->a[iShw2].u & X86_PDE_PAE_PG_MASK, pPage->idx, iShw2);
     502                            uShw.pPDPT->a[iShw2].u = 0;
     503                        }
     504                    }
    489505                }
    490 #endif
    491506                break;
    492507            }
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