~ubuntu-branches/ubuntu/vivid/virtualbox-ose/vivid

« back to all changes in this revision

Viewing changes to src/VBox/VMM/VMMAll/PGMAll.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-03-11 17:16:37 UTC
  • mfrom: (0.3.4 upstream) (0.4.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100311171637-43z64ia3ccpj8vqn
Tags: 3.1.4-dfsg-2ubuntu1
* Merge from Debian unstable (LP: #528561), remaining changes:
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
  - Replace *-source packages with transitional packages for *-dkms
* Fix crash in vboxvideo_drm with kernel 2.6.33 / backported drm code
  (LP: #535297)
* Add a list of linux-headers packages to the apport hook
* Update debian/patches/u02-lp-integration.dpatch with a
  DEP-3 compliant header
* Add ${misc:Depends} to virtualbox-ose-source and virtualbox-ose-guest-source
  Depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
722
722
    /*
723
723
     * Check for conflicts and pending CR3 monitoring updates.
724
724
     */
725
 
    if (!pVM->pgm.s.fMappingsFixed)
 
725
    if (pgmMapAreMappingsFloating(&pVM->pgm.s))
726
726
    {
727
727
        if (    pgmGetMapping(pVM, GCPtrPage)
728
728
            &&  PGMGstGetPage(pVCpu, GCPtrPage, NULL, NULL) != VERR_PAGE_TABLE_NOT_PRESENT)
751
751
    pgmUnlock(pVM);
752
752
    STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePage), a);
753
753
 
 
754
    /* Invalidate the TLB entry; might already be done by InvalidatePage (@todo) */
 
755
    PGM_INVL_PG(pVCpu, GCPtrPage);
 
756
 
754
757
#ifdef IN_RING3
755
758
    /*
756
759
     * Check if we have a pending update of the CR3 monitoring.
759
762
        &&  (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3))
760
763
    {
761
764
        pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3;
762
 
        Assert(!pVM->pgm.s.fMappingsFixed);
 
765
        Assert(!pVM->pgm.s.fMappingsFixed); Assert(!pVM->pgm.s.fMappingsDisabled);
763
766
    }
764
767
 
765
768
    /*
770
773
     */
771
774
    CSAMR3FlushPage(pVM, GCPtrPage);
772
775
#endif /* IN_RING3 */
 
776
 
 
777
    /* Ignore all irrelevant error codes. */
 
778
    if (    rc == VERR_PAGE_NOT_PRESENT                 
 
779
        ||  rc == VERR_PAGE_TABLE_NOT_PRESENT           
 
780
        ||  rc == VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT   
 
781
        ||  rc == VERR_PAGE_MAP_LEVEL4_NOT_PRESENT)     
 
782
        rc = VINF_SUCCESS;
 
783
 
773
784
    return rc;
774
785
}
775
786
 
1681
1692
        rc = PGM_BTH_PFN(MapCR3, pVCpu)(pVCpu, GCPhysCR3);
1682
1693
        if (RT_LIKELY(rc == VINF_SUCCESS))
1683
1694
        {
1684
 
            if (!pVM->pgm.s.fMappingsFixed)
1685
 
            {
 
1695
            if (pgmMapAreMappingsFloating(&pVM->pgm.s))
1686
1696
                pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3;
1687
 
            }
1688
1697
        }
1689
1698
        else
1690
1699
        {
1692
1701
            Assert(VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_PGM_SYNC_CR3));
1693
1702
            pVCpu->pgm.s.GCPhysCR3 = GCPhysOldCR3;
1694
1703
            pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_MAP_CR3;
1695
 
            if (!pVM->pgm.s.fMappingsFixed)
 
1704
            if (pgmMapAreMappingsFloating(&pVM->pgm.s))
1696
1705
                pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_MONITOR_CR3;
1697
1706
        }
1698
1707
 
1718
1727
        if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3)
1719
1728
        {
1720
1729
            pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3;
1721
 
            Assert(!pVM->pgm.s.fMappingsFixed);
 
1730
            Assert(!pVM->pgm.s.fMappingsFixed); Assert(!pVM->pgm.s.fMappingsDisabled);
1722
1731
        }
1723
1732
        if (fGlobal)
1724
1733
            STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,FlushTLBSameCR3Global));
1755
1764
    LogFlow(("PGMUpdateCR3: cr3=%RX64 OldCr3=%RX64\n", cr3, pVCpu->pgm.s.GCPhysCR3));
1756
1765
 
1757
1766
    /* We assume we're only called in nested paging mode. */
1758
 
    Assert(pVM->pgm.s.fMappingsFixed);
 
1767
    Assert(HWACCMIsNestedPagingActive(pVM) || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT);
 
1768
    Assert(pVM->pgm.s.fMappingsDisabled);
1759
1769
    Assert(!(pVCpu->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3));
1760
 
    Assert(HWACCMIsNestedPagingActive(pVM) || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT);
1761
1770
 
1762
1771
    /*
1763
1772
     * Remap the CR3 content and adjust the monitoring if CR3 was actually changed.
1904
1913
        if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3)
1905
1914
        {
1906
1915
            pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3;
1907
 
            Assert(!pVM->pgm.s.fMappingsFixed);
 
1916
            Assert(!pVM->pgm.s.fMappingsFixed); Assert(!pVM->pgm.s.fMappingsDisabled);
1908
1917
        }
1909
1918
    }
1910
1919