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

« back to all changes in this revision

Viewing changes to src/VBox/VMM/VMMAll/PGMAllMap.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:
388
388
{
389
389
    Log(("pgmMapClearShadowPDEs: old pde %x (cPTs=%x) (mappings enabled %d) fDeactivateCR3=%RTbool\n", iOldPDE, pMap->cPTs, pgmMapAreMappingsEnabled(&pVM->pgm.s), fDeactivateCR3));
390
390
 
 
391
    /*
 
392
     * Skip this if disabled or if it doesn't apply.
 
393
     */
391
394
    if (    !pgmMapAreMappingsEnabled(&pVM->pgm.s)
392
395
        ||  pVM->cCpus > 1)
393
396
        return;
601
604
    if (!pgmMapAreMappingsEnabled(&pVM->pgm.s))
602
605
        return;
603
606
 
 
607
    /* This only applies to raw mode where we only support 1 VCPU. */
604
608
    Assert(pVM->cCpus == 1);
605
 
 
606
 
    /* This only applies to raw mode where we only support 1 VCPU. */
607
609
    PVMCPU pVCpu = VMMGetCpu0(pVM);
608
610
    Assert(pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
609
611
 
632
634
int pgmMapActivateCR3(PVM pVM, PPGMPOOLPAGE pShwPageCR3)
633
635
{
634
636
    /*
635
 
     * Can skip this if mappings are disabled.
 
637
     * Skip this if disabled or if it doesn't apply.
636
638
     */
637
639
    if (    !pgmMapAreMappingsEnabled(&pVM->pgm.s)
638
640
        ||  pVM->cCpus > 1)
639
641
        return VINF_SUCCESS;
640
642
 
641
 
    /* Note. A log flush (in RC) can cause problems when called from MapCR3 (inconsistent state will trigger assertions). */
642
 
    Log4(("pgmMapActivateCR3: fixed mappings=%d idxShwPageCR3=%#x\n", pVM->pgm.s.fMappingsFixed, pShwPageCR3 ? pShwPageCR3->idx : NIL_PGMPOOL_IDX));
 
643
    /* Note! This might not be logged successfully in RC because we usually
 
644
             cannot flush the log at this point. */
 
645
    Log4(("pgmMapActivateCR3: fixed mappings=%RTbool idxShwPageCR3=%#x\n", pVM->pgm.s.fMappingsFixed, pShwPageCR3 ? pShwPageCR3->idx : NIL_PGMPOOL_IDX));
643
646
 
644
647
#ifdef VBOX_STRICT
645
648
    PVMCPU pVCpu = VMMGetCpu0(pVM);
668
671
int pgmMapDeactivateCR3(PVM pVM, PPGMPOOLPAGE pShwPageCR3)
669
672
{
670
673
    /*
671
 
     * Can skip this if mappings are disabled.
 
674
     * Skip this if disabled or if it doesn't apply.
672
675
     */
673
676
    if (    !pgmMapAreMappingsEnabled(&pVM->pgm.s)
674
677
        ||  pVM->cCpus > 1)
701
704
    /*
702
705
     * Can skip this if mappings are safely fixed.
703
706
     */
704
 
    if (pVM->pgm.s.fMappingsFixed)
 
707
    if (!pgmMapAreMappingsFloating(&pVM->pgm.s))
705
708
        return false;
706
709
 
707
710
    Assert(pVM->cCpus == 1);
787
790
 
788
791
 
789
792
/**
790
 
 * Checks and resolves (ring 3 only) guest conflicts with VMM GC mappings.
 
793
 * Checks and resolves (ring 3 only) guest conflicts with the guest mappings.
791
794
 *
792
795
 * @returns VBox status.
793
796
 * @param   pVM                 The virtual machine.
794
797
 */
795
 
VMMDECL(int) PGMMapResolveConflicts(PVM pVM)
 
798
int pgmMapResolveConflicts(PVM pVM)
796
799
{
797
 
    /*
798
 
     * Can skip this if mappings are safely fixed.
799
 
     */
800
 
    if (pVM->pgm.s.fMappingsFixed)
801
 
        return VINF_SUCCESS;
 
800
    /* The caller is expected to check these two conditions. */
 
801
    Assert(!pVM->pgm.s.fMappingsFixed);
 
802
    Assert(!pVM->pgm.s.fMappingsDisabled);
802
803
 
 
804
    /* This only applies to raw mode where we only support 1 VCPU. */
803
805
    Assert(pVM->cCpus == 1);
804
 
 
805
 
    /* This only applies to raw mode where we only support 1 VCPU. */
806
 
    PVMCPU pVCpu = &pVM->aCpus[0];
807
 
 
808
 
    PGMMODE const enmGuestMode = PGMGetGuestMode(pVCpu);
 
806
    PVMCPU          pVCpu        = &pVM->aCpus[0];
 
807
    PGMMODE const   enmGuestMode = PGMGetGuestMode(pVCpu);
809
808
    Assert(enmGuestMode <= PGMMODE_PAE_NX);
810
809
 
811
810
    if (enmGuestMode == PGMMODE_32_BIT)