VirtualBox

Ignore:
Timestamp:
Aug 28, 2012 2:18:03 PM (12 years ago)
Author:
vboxsync
Message:

PGMR0SharedPage.cpp: Must always clear all shadow page table mappings of a guest page which has been made into a shared one, even if we didn't get a new page. A private page converted to a shared one needs to be write protected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp

    r41836 r43042  
    102102                             GCPtrPage, PageDesc.GCPhys, PGM_PAGE_GET_HCPHYS(pPage), PageDesc.HCPhys));
    103103
     104                        /* Page was either replaced by an existing shared
     105                           version of it or converted into a read-only shared
     106                           page, so, clear all references. */
     107                        bool fFlush = false;
     108                        rc = pgmPoolTrackUpdateGCPhys(pVM, PageDesc.GCPhys, pPage, true /* clear the entries */, &fFlush);
     109                        Assert(   rc == VINF_SUCCESS
     110                               || (   VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3)
     111                                   && (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL)));
     112                        if (rc == VINF_SUCCESS)
     113                            fFlushTLBs |= fFlush;
     114                        fFlushRemTLBs = true;
     115
    104116                        if (PageDesc.HCPhys != PGM_PAGE_GET_HCPHYS(pPage))
    105117                        {
    106                             /* Page was replaced by an existing shared version
    107                                of it; clear all references first. */
    108                             bool fFlush = false;
    109                             rc = pgmPoolTrackUpdateGCPhys(pVM, PageDesc.GCPhys, pPage, true /* clear the entries */, &fFlush);
    110                             Assert(   rc == VINF_SUCCESS
    111                                    || (   VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3)
    112                                        && (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL)));
    113                             if (rc == VINF_SUCCESS)
    114                                 fFlushTLBs |= fFlush;
    115                             fFlushRemTLBs = true;
    116 
    117118                            /* Update the physical address and page id now. */
    118119                            PGM_PAGE_SET_HCPHYS(pVM, pPage, PageDesc.HCPhys);
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