VirtualBox

Changeset 32778 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Sep 27, 2010 2:13:11 PM (14 years ago)
Author:
vboxsync
Message:

Sync the entire page table for new nested page tables. (partially syncing them doesn't really make sense)

File:
1 edited

Legend:

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

    r32564 r32778  
    31583158        AssertMsgFailedReturn(("rc=%Rrc\n", rc), VERR_INTERNAL_ERROR);
    31593159
     3160    if (rc == VINF_SUCCESS)
     3161    {
     3162        /* New page table; fully set it up. */
     3163        Assert(pPTDst);
     3164
     3165        /* Mask away the page offset. */
     3166        GCPtrPage &= ~((RTGCPTR)0xfff);
     3167
     3168        for (unsigned iPTDst = 0; iPTDst < RT_ELEMENTS(pPTDst->a); iPTDst++)
     3169        {
     3170            RTGCPTR GCPtrCurPage = (GCPtrPage & ~(RTGCPTR)(SHW_PT_MASK << SHW_PT_SHIFT)) | (iPTDst << PAGE_SHIFT);
     3171            GSTPTE  PteSrc;
     3172
     3173            /* Fake the page table entry */
     3174            PteSrc.u = GCPtrCurPage;
     3175            PteSrc.n.u1Present  = 1;
     3176            PteSrc.n.u1Dirty    = 1;
     3177            PteSrc.n.u1Accessed = 1;
     3178            PteSrc.n.u1Write    = 1;
     3179            PteSrc.n.u1User     = 1;
     3180
     3181            PGM_BTH_NAME(SyncPageWorker)(pVCpu, &pPTDst->a[iPTDst], PdeSrc, PteSrc, pShwPage, iPTDst);
     3182            Log2(("SyncPage: 4K+ %RGv PteSrc:{P=%d RW=%d U=%d raw=%08llx} PteDst=%08llx%s\n",
     3183                    GCPtrCurPage, PteSrc.n.u1Present,
     3184                    PteSrc.n.u1Write & PdeSrc.n.u1Write,
     3185                    PteSrc.n.u1User  & PdeSrc.n.u1User,
     3186                    (uint64_t)PteSrc.u,
     3187                    SHW_PTE_LOG64(pPTDst->a[iPTDst]),
     3188                    SHW_PTE_IS_TRACK_DIRTY(pPTDst->a[iPTDst]) ? " Track-Dirty" : ""));
     3189
     3190            if (RT_UNLIKELY(VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY)))
     3191                break;
     3192        }
     3193    }
     3194    /* else cached entry; assume it's still fully valid. */
     3195
     3196    /* Save the new PDE. */
    31603197    PdeDst.u &= X86_PDE_AVL_MASK;
    31613198    PdeDst.u |= pShwPage->Core.Key;
     
    31703207    ASMAtomicWriteSize(pPdeDst, PdeDst.u);
    31713208
    3172     rc = PGM_BTH_NAME(SyncPage)(pVCpu, PdeSrc, GCPtrPage, PGM_SYNC_NR_PAGES, 0 /* page not present */);
    31733209    STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a);
    31743210    return rc;
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