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

« back to all changes in this revision

Viewing changes to src/VBox/VMM/PGMMap.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:
73
73
    }
74
74
    cb = RT_ALIGN_32(cb, _4M);
75
75
    RTGCPTR GCPtrLast = GCPtr + cb - 1;
76
 
    if (GCPtrLast < GCPtr)
77
 
    {
78
 
        AssertMsgFailed(("Range wraps! GCPtr=%x GCPtrLast=%x\n", GCPtr, GCPtrLast));
79
 
        return VERR_INVALID_PARAMETER;
80
 
    }
81
 
    if (pVM->pgm.s.fMappingsFixed)
82
 
    {
83
 
        AssertMsgFailed(("Mappings are fixed! It's not possible to add new mappings at this time!\n"));
84
 
        return VERR_PGM_MAPPINGS_FIXED;
85
 
    }
86
 
    if (!pfnRelocate)
87
 
    {
88
 
        AssertMsgFailed(("Callback is required\n"));
89
 
        return VERR_INVALID_PARAMETER;
90
 
    }
 
76
 
 
77
    AssertMsgReturn(GCPtrLast >= GCPtr, ("Range wraps! GCPtr=%x GCPtrLast=%x\n", GCPtr, GCPtrLast),
 
78
                    VERR_INVALID_PARAMETER);
 
79
    AssertMsgReturn(!pVM->pgm.s.fMappingsFixed, ("Mappings are fixed! It's not possible to add new mappings at this time!\n"),
 
80
                    VERR_PGM_MAPPINGS_FIXED);
 
81
    AssertPtrReturn(pfnRelocate, VERR_INVALID_PARAMETER);
91
82
 
92
83
    /*
93
84
     * Find list location.
141
132
    pNew->GCPtr         = GCPtr;
142
133
    pNew->GCPtrLast     = GCPtrLast;
143
134
    pNew->cb            = cb;
144
 
    pNew->pszDesc       = pszDesc;
145
135
    pNew->pfnRelocate   = pfnRelocate;
146
136
    pNew->pvUser        = pvUser;
 
137
    pNew->pszDesc       = pszDesc;
147
138
    pNew->cPTs          = cPTs;
148
139
 
149
140
    /*
267
258
             * and free the page tables and node memory.
268
259
             */
269
260
            MMHyperFree(pVM, pCur->aPTs[0].pPTR3);
270
 
            pgmR3MapClearPDEs(pVM, pCur, pCur->GCPtr >> X86_PD_SHIFT);
 
261
            if (pCur->GCPtr != NIL_RTGCPTR)
 
262
                pgmR3MapClearPDEs(pVM, pCur, pCur->GCPtr >> X86_PD_SHIFT);
271
263
            MMHyperFree(pVM, pCur);
272
264
 
273
265
            for (VMCPUID i = 0; i < pVM->cCpus; i++)
413
405
    /*
414
406
     * Loop until all mappings have been finalized.
415
407
     */
416
 
    /*unsigned    iPDNext = UINT32_C(0xc0000000) >> X86_PD_SHIFT;*/ /* makes CSAM/PATM freak out booting linux. :-/ */
417
408
#if 0
 
409
    unsigned    iPDNext = UINT32_C(0xc0000000) >> X86_PD_SHIFT; /* makes CSAM/PATM freak out booting linux. :-/ */
 
410
#elif 0
418
411
    unsigned    iPDNext = MM_HYPER_AREA_ADDRESS >> X86_PD_SHIFT;
419
412
#else
420
413
    unsigned    iPDNext = 1 << X86_PD_SHIFT; /* no hint, map them from the top. */
421
414
#endif
 
415
 
422
416
    PPGMMAPPING pCur;
423
417
    do
424
418
    {
503
497
 
504
498
 
505
499
/**
506
 
 * Fixes the guest context mappings in a range reserved from the Guest OS.
 
500
 * Fixates the guest context mappings in a range reserved from the Guest OS.
507
501
 *
508
502
 * @returns VBox status code.
509
503
 * @param   pVM         The VM.
512
506
 */
513
507
VMMR3DECL(int) PGMR3MappingsFix(PVM pVM, RTGCPTR GCPtrBase, uint32_t cb)
514
508
{
515
 
    Log(("PGMR3MappingsFix: GCPtrBase=%#x cb=%#x\n", GCPtrBase, cb));
 
509
    Log(("PGMR3MappingsFix: GCPtrBase=%RGv cb=%#x (fMappingsFixed=%RTbool fMappingsDisabled=%RTbool)\n",
 
510
         GCPtrBase, cb, pVM->pgm.s.fMappingsFixed, pVM->pgm.s.fMappingsDisabled));
516
511
 
517
 
    /* Ignore the additions mapping fix call in VT-x/AMD-V. */
518
 
    if (    pVM->pgm.s.fMappingsFixed
519
 
        &&  HWACCMIsEnabled(pVM))
 
512
    /*
 
513
     * Ignore the additions mapping fix call if disabled.
 
514
     */
 
515
    if (!pgmMapAreMappingsEnabled(&pVM->pgm.s))
 
516
    {
 
517
        Assert(HWACCMIsEnabled(pVM));
520
518
        return VINF_SUCCESS;
 
519
    }
521
520
 
522
 
    /* Only applies to VCPU 0 as we don't support SMP guests with raw mode. */
 
521
    /*
 
522
     * Only applies to VCPU 0 as we don't support SMP guests with raw mode.
 
523
     */
523
524
    Assert(pVM->cCpus == 1);
524
 
 
525
525
    PVMCPU pVCpu = &pVM->aCpus[0];
526
526
 
527
527
    /*
528
 
     * This is all or nothing at all. So, a tiny bit of paranoia first.
529
 
     */
530
 
    if (GCPtrBase & X86_PAGE_4M_OFFSET_MASK)
531
 
    {
532
 
        AssertMsgFailed(("GCPtrBase (%#x) has to be aligned on a 4MB address!\n", GCPtrBase));
533
 
        return VERR_INVALID_PARAMETER;
534
 
    }
535
 
    if (!cb || (cb & X86_PAGE_4M_OFFSET_MASK))
536
 
    {
537
 
        AssertMsgFailed(("cb (%#x) is 0 or not aligned on a 4MB address!\n", cb));
538
 
        return VERR_INVALID_PARAMETER;
539
 
    }
540
 
 
541
 
    /*
542
528
     * Before we do anything we'll do a forced PD sync to try make sure any
543
529
     * pending relocations because of these mappings have been resolved.
544
530
     */
545
531
    PGMSyncCR3(pVCpu, CPUMGetGuestCR0(pVCpu), CPUMGetGuestCR3(pVCpu), CPUMGetGuestCR4(pVCpu), true);
546
532
 
 
533
    return pgmR3MappingsFixInternal(pVM, GCPtrBase, cb);
 
534
}
 
535
 
 
536
 
 
537
/**
 
538
 * Internal worker for PGMR3MappingsFix and pgmR3Load.
 
539
 *
 
540
 * (This does not perform a SyncCR3 before the fixation like PGMR3MappingsFix.)
 
541
 *
 
542
 * @returns VBox status code.
 
543
 * @param   pVM         The VM.
 
544
 * @param   GCPtrBase   The address of the reserved range of guest memory.
 
545
 * @param   cb          The size of the range starting at GCPtrBase.
 
546
 */
 
547
int pgmR3MappingsFixInternal(PVM pVM, RTGCPTR GCPtrBase, uint32_t cb)
 
548
{
 
549
    /*
 
550
     * Check input arguments and pre-conditions.
 
551
     */
 
552
    AssertMsgReturn(!(GCPtrBase & X86_PAGE_4M_OFFSET_MASK), ("GCPtrBase (%#x) has to be aligned on a 4MB address!\n", GCPtrBase),
 
553
                    VERR_INVALID_PARAMETER);
 
554
    AssertMsgReturn(cb && !(cb & X86_PAGE_4M_OFFSET_MASK), ("cb (%#x) is 0 or not aligned on a 4MB address!\n", cb),
 
555
                    VERR_INVALID_PARAMETER);
 
556
    AssertReturn(pgmMapAreMappingsEnabled(&pVM->pgm.s), VERR_INTERNAL_ERROR_3);
 
557
    AssertReturn(pVM->cCpus == 1, VERR_INTERNAL_ERROR_4);
 
558
 
547
559
    /*
548
560
     * Check that it's not conflicting with a core code mapping in the intermediate page table.
549
561
     */
573
585
    /*
574
586
     * In PAE / PAE mode, make sure we don't cross page directories.
575
587
     */
 
588
    PVMCPU pVCpu = &pVM->aCpus[0];
576
589
    if (    (   pVCpu->pgm.s.enmGuestMode  == PGMMODE_PAE
577
590
             || pVCpu->pgm.s.enmGuestMode  == PGMMODE_PAE_NX)
578
591
        &&  (   pVCpu->pgm.s.enmShadowMode == PGMMODE_PAE
618
631
    pCur = pVM->pgm.s.pMappingsR3;
619
632
    while (pCur)
620
633
    {
621
 
        unsigned iPDOld = pCur->GCPtr >> X86_PD_SHIFT;
622
 
        iPDNew = GCPtrCur >> X86_PD_SHIFT;
 
634
        RTGCPTR const GCPtrOld = pCur->GCPtr;
623
635
 
624
636
        /*
625
637
         * Relocate the page table(s).
626
638
         */
627
 
        pgmR3MapClearPDEs(pVM, pCur, iPDOld);
628
 
        pgmR3MapSetPDEs(pVM, pCur, iPDNew);
 
639
        if (pCur->GCPtr != NIL_RTGCPTR)
 
640
            pgmR3MapClearPDEs(pVM, pCur, GCPtrOld >> X86_PD_SHIFT);
 
641
        pgmR3MapSetPDEs(pVM, pCur, GCPtrCur >> X86_PD_SHIFT);
629
642
 
630
643
        /*
631
644
         * Update the entry.
636
649
        /*
637
650
         * Callback to execute the relocation.
638
651
         */
639
 
        pCur->pfnRelocate(pVM, iPDOld << X86_PD_SHIFT, iPDNew << X86_PD_SHIFT, PGMRELOCATECALL_RELOCATE, pCur->pvUser);
 
652
        pCur->pfnRelocate(pVM, GCPtrOld, GCPtrCur, PGMRELOCATECALL_RELOCATE, pCur->pvUser);
640
653
 
641
654
        /*
642
655
         * Advance.
646
659
    }
647
660
 
648
661
    /*
649
 
     * Mark the mappings as fixed and return.
 
662
     * Mark the mappings as fixed at this new location and return.
650
663
     */
651
 
    pVM->pgm.s.fMappingsFixed    = true;
652
 
    pVM->pgm.s.GCPtrMappingFixed = GCPtrBase;
653
 
    pVM->pgm.s.cbMappingFixed    = cb;
 
664
    pVM->pgm.s.fMappingsFixed           = true;
 
665
    pVM->pgm.s.fMappingsFixedRestored   = false;
 
666
    pVM->pgm.s.GCPtrMappingFixed        = GCPtrBase;
 
667
    pVM->pgm.s.cbMappingFixed           = cb;
654
668
 
655
669
    for (VMCPUID i = 0; i < pVM->cCpus; i++)
656
670
    {
661
675
    return VINF_SUCCESS;
662
676
}
663
677
 
 
678
 
664
679
/**
665
 
 * Disable the hypervisor mappings in the shadow page tables (doesn't touch the intermediate table!)
 
680
 * Interface for disabling the guest mappings when switching to HWACCM mode
 
681
 * during VM creation and VM reset.
 
682
 *
 
683
 * (This doesn't touch the intermediate table!)
666
684
 *
667
685
 * @returns VBox status code.
668
686
 * @param   pVM         The VM.
669
687
 */
670
688
VMMR3DECL(int) PGMR3MappingsDisable(PVM pVM)
671
689
{
672
 
    uint32_t cb;
673
 
    int rc = PGMR3MappingsSize(pVM, &cb);
674
 
    AssertRCReturn(rc, rc);
675
 
 
676
 
    /* Only applies to VCPU 0. */
677
 
    PVMCPU pVCpu = &pVM->aCpus[0];
678
 
 
679
 
    pgmLock(pVM);                           /* to avoid assertions */
680
 
    rc = pgmMapDeactivateCR3(pVM, pVCpu->pgm.s.pShwPageCR3R3);
681
 
    pgmUnlock(pVM);
682
 
    AssertRCReturn(rc, rc);
683
 
 
684
 
    /*
685
 
     * Mark the mappings as fixed (using fake values) and disabled.
686
 
     */
687
 
    pVM->pgm.s.fDisableMappings  = true;
688
 
    pVM->pgm.s.fMappingsFixed    = true;
689
 
    pVM->pgm.s.GCPtrMappingFixed = MM_HYPER_AREA_ADDRESS;
690
 
    pVM->pgm.s.cbMappingFixed    = cb;
 
690
    AssertReturn(!pVM->pgm.s.fMappingsFixed,            VERR_INTERNAL_ERROR_4);
 
691
    AssertReturn(!pVM->pgm.s.fMappingsFixedRestored,    VERR_INTERNAL_ERROR_4);
 
692
    if (pVM->pgm.s.fMappingsDisabled)
 
693
        return VINF_SUCCESS;
 
694
 
 
695
    /*
 
696
     * Deactivate (only applies to Virtual CPU #0).
 
697
     */
 
698
    if (pVM->aCpus[0].pgm.s.pShwPageCR3R3)
 
699
    {
 
700
        pgmLock(pVM);                           /* to avoid assertions */
 
701
        int rc = pgmMapDeactivateCR3(pVM, pVM->aCpus[0].pgm.s.pShwPageCR3R3);
 
702
        pgmUnlock(pVM);
 
703
        AssertRCReturn(rc, rc);
 
704
    }
 
705
 
 
706
    /*
 
707
     * Mark the mappings as disabled and trigger a CR3 re-sync.
 
708
     */
 
709
    pVM->pgm.s.fMappingsDisabled = true;
691
710
    for (VMCPUID i = 0; i < pVM->cCpus; i++)
692
711
    {
693
712
        PVMCPU pVCpu = &pVM->aCpus[i];
700
719
 
701
720
/**
702
721
 * Unfixes the mappings.
703
 
 * After calling this function mapping conflict detection will be enabled.
 
722
 *
 
723
 * Unless PGMR3MappingsDisable is in effect, mapping conflict detection will be
 
724
 * enabled after this call.  If the mappings are fixed, a full CR3 resync will
 
725
 * take place afterwards.
704
726
 *
705
727
 * @returns VBox status code.
706
728
 * @param   pVM         The VM.
707
729
 */
708
730
VMMR3DECL(int) PGMR3MappingsUnfix(PVM pVM)
709
731
{
710
 
    Log(("PGMR3MappingsUnfix: fMappingsFixed=%d\n", pVM->pgm.s.fMappingsFixed));
711
 
 
712
 
    /* Ignore in VT-x/AMD-V mode. */
713
 
    if (HWACCMIsEnabled(pVM))
714
 
        return VINF_SUCCESS;
715
 
 
716
 
    pVM->pgm.s.fMappingsFixed    = false;
717
 
    pVM->pgm.s.GCPtrMappingFixed = 0;
718
 
    pVM->pgm.s.cbMappingFixed    = 0;
719
 
    for (VMCPUID i = 0; i < pVM->cCpus; i++)
 
732
    Log(("PGMR3MappingsUnfix: fMappingsFixed=%RTbool fMappingsDisabled=%RTbool\n", pVM->pgm.s.fMappingsFixed, pVM->pgm.s.fMappingsDisabled));
 
733
    if (   pgmMapAreMappingsEnabled(&pVM->pgm.s)
 
734
        && (    pVM->pgm.s.fMappingsFixed
 
735
            ||  pVM->pgm.s.fMappingsFixedRestored)
 
736
       )
720
737
    {
721
 
        PVMCPU pVCpu = &pVM->aCpus[i];
722
 
        VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
 
738
        bool const fResyncCR3 = pVM->pgm.s.fMappingsFixed;
 
739
 
 
740
        pVM->pgm.s.fMappingsFixed           = false;
 
741
        pVM->pgm.s.fMappingsFixedRestored   = false;
 
742
        pVM->pgm.s.GCPtrMappingFixed        = 0;
 
743
        pVM->pgm.s.cbMappingFixed           = 0;
 
744
 
 
745
        if (fResyncCR3)
 
746
            for (VMCPUID i = 0; i < pVM->cCpus; i++)
 
747
                VMCPU_FF_SET(&pVM->aCpus[i], VMCPU_FF_PGM_SYNC_CR3);
723
748
    }
724
749
    return VINF_SUCCESS;
725
750
}
726
751
 
727
752
 
728
753
/**
 
754
 * Checks if the mappings needs re-fixing after a restore.
 
755
 *
 
756
 * @returns true if they need, false if not.
 
757
 * @param   pVM                 The VM handle.
 
758
 */
 
759
VMMR3DECL(bool) PGMR3MappingsNeedReFixing(PVM pVM)
 
760
{
 
761
    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
 
762
    return pVM->pgm.s.fMappingsFixedRestored;
 
763
}
 
764
 
 
765
 
 
766
/**
729
767
 * Map pages into the intermediate context (switcher code).
730
 
 * These pages are mapped at both the give virtual address and at
731
 
 * the physical address (for identity mapping).
 
768
 *
 
769
 * These pages are mapped at both the give virtual address and at the physical
 
770
 * address (for identity mapping).
732
771
 *
733
772
 * @returns VBox status code.
734
773
 * @param   pVM         The virtual machine.
956
995
         * 32-bit.
957
996
         */
958
997
        pVM->pgm.s.pInterPD->a[iOldPDE].u        = 0;
 
998
 
959
999
        /*
960
1000
         * PAE.
961
1001
         */
1029
1069
 * @param   pVM                 VM handle.
1030
1070
 * @param   pMapping            The mapping to relocate.
1031
1071
 * @param   GCPtrOldMapping     The address of the start of the old mapping.
 
1072
 *                              NIL_RTGCPTR if not currently mapped.
1032
1073
 * @param   GCPtrNewMapping     The address of the start of the new mapping.
1033
1074
 */
1034
 
void pgmR3MapRelocate(PVM pVM, PPGMMAPPING pMapping, RTGCPTR GCPtrOldMapping, RTGCPTR GCPtrNewMapping)
 
1075
static void pgmR3MapRelocate(PVM pVM, PPGMMAPPING pMapping, RTGCPTR GCPtrOldMapping, RTGCPTR GCPtrNewMapping)
1035
1076
{
1036
 
    unsigned iPDOld = GCPtrOldMapping >> X86_PD_SHIFT;
1037
 
    unsigned iPDNew = GCPtrNewMapping >> X86_PD_SHIFT;
1038
 
 
1039
1077
    Log(("PGM: Relocating %s from %RGv to %RGv\n", pMapping->pszDesc, GCPtrOldMapping, GCPtrNewMapping));
1040
 
    AssertMsg(((unsigned)iPDOld << X86_PD_SHIFT) == pMapping->GCPtr, ("%RGv vs %RGv\n", (RTGCPTR)((unsigned)iPDOld << X86_PD_SHIFT), pMapping->GCPtr));
 
1078
    AssertMsg(GCPtrOldMapping == pMapping->GCPtr, ("%RGv vs %RGv\n", GCPtrOldMapping, pMapping->GCPtr));
 
1079
    AssertMsg((GCPtrOldMapping >> X86_PD_SHIFT) < X86_PG_ENTRIES, ("%RGv\n", GCPtrOldMapping));
 
1080
    AssertMsg((GCPtrNewMapping >> X86_PD_SHIFT) < X86_PG_ENTRIES, ("%RGv\n", GCPtrOldMapping));
1041
1081
 
1042
1082
    /*
1043
1083
     * Relocate the page table(s).
1044
1084
     */
1045
 
    pgmR3MapClearPDEs(pVM, pMapping, iPDOld);
1046
 
    pgmR3MapSetPDEs(pVM, pMapping, iPDNew);
 
1085
    if (GCPtrOldMapping != NIL_RTGCPTR)
 
1086
        pgmR3MapClearPDEs(pVM, pMapping, GCPtrOldMapping >> X86_PD_SHIFT);
 
1087
    pgmR3MapSetPDEs(pVM, pMapping, GCPtrNewMapping >> X86_PD_SHIFT);
1047
1088
 
1048
1089
    /*
1049
1090
     * Update and resort the mapping list.
1061
1102
    Assert(pCur);
1062
1103
 
1063
1104
    /* Find mapping which >= than pMapping. */
1064
 
    RTGCPTR     GCPtrNew = iPDNew << X86_PD_SHIFT;
 
1105
    RTGCPTR     GCPtrNew = GCPtrNewMapping;
1065
1106
    PPGMMAPPING pPrev = NULL;
1066
1107
    pCur = pVM->pgm.s.pMappingsR3;
1067
1108
    while (pCur && pCur->GCPtr < GCPtrNew)
1120
1161
    /*
1121
1162
     * Callback to execute the relocation.
1122
1163
     */
1123
 
    pMapping->pfnRelocate(pVM, iPDOld << X86_PD_SHIFT, iPDNew << X86_PD_SHIFT, PGMRELOCATECALL_RELOCATE, pMapping->pvUser);
 
1164
    pMapping->pfnRelocate(pVM, GCPtrOldMapping, GCPtrNewMapping, PGMRELOCATECALL_RELOCATE, pMapping->pvUser);
1124
1165
}
1125
1166
 
1126
1167
 
1203
1244
        /*
1204
1245
         * Ask for the mapping.
1205
1246
         */
1206
 
        RTGCPTR GCPtrNewMapping = iPDNew << X86_PD_SHIFT;
 
1247
        RTGCPTR GCPtrNewMapping = (RTGCPTR32)iPDNew << X86_PD_SHIFT;
1207
1248
 
1208
1249
        if (pMapping->pfnRelocate(pVM, GCPtrOldMapping, GCPtrNewMapping, PGMRELOCATECALL_SUGGEST, pMapping->pvUser))
1209
1250
        {
1291
1332
            /*
1292
1333
             * Ask for the mapping.
1293
1334
             */
1294
 
            RTGCPTR GCPtrNewMapping = ((RTGCPTR32)iPDPTE << X86_PDPT_SHIFT) + (iPDNew << X86_PD_PAE_SHIFT);
 
1335
            RTGCPTR GCPtrNewMapping = ((RTGCPTR32)iPDPTE << X86_PDPT_SHIFT) + ((RTGCPTR32)iPDNew << X86_PD_PAE_SHIFT);
1295
1336
 
1296
1337
            if (pMapping->pfnRelocate(pVM, GCPtrOldMapping, GCPtrNewMapping, PGMRELOCATECALL_SUGGEST, pMapping->pvUser))
1297
1338
            {
1401
1442
 */
1402
1443
DECLCALLBACK(void) pgmR3MapInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
1403
1444
{
1404
 
    pHlp->pfnPrintf(pHlp, pVM->pgm.s.fMappingsFixed
1405
 
                    ? "\nThe mappings are FIXED.\n"
1406
 
                    : "\nThe mappings are FLOATING.\n");
 
1445
    if (pVM->pgm.s.fMappingsDisabled)
 
1446
        pHlp->pfnPrintf(pHlp, "\nThe mappings are DISABLED.\n");
 
1447
    else if (pVM->pgm.s.fMappingsFixed)
 
1448
        pHlp->pfnPrintf(pHlp, "\nThe mappings are FIXED: %RGv-%RGv\n",
 
1449
                        pVM->pgm.s.GCPtrMappingFixed, pVM->pgm.s.GCPtrMappingFixed + pVM->pgm.s.cbMappingFixed - 1);
 
1450
    else if (pVM->pgm.s.fMappingsFixedRestored)
 
1451
        pHlp->pfnPrintf(pHlp, "\nThe mappings are FLOATING-RESTORED-FIXED: %RGv-%RGv\n",
 
1452
                        pVM->pgm.s.GCPtrMappingFixed, pVM->pgm.s.GCPtrMappingFixed + pVM->pgm.s.cbMappingFixed - 1);
 
1453
    else
 
1454
        pHlp->pfnPrintf(pHlp, "\nThe mappings are FLOATING.\n");
 
1455
 
1407
1456
    PPGMMAPPING pCur;
1408
1457
    for (pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3)
 
1458
    {
1409
1459
        pHlp->pfnPrintf(pHlp, "%RGv - %RGv  %s\n", pCur->GCPtr, pCur->GCPtrLast, pCur->pszDesc);
 
1460
        if (pCur->cConflicts > 0)
 
1461
        {
 
1462
            pHlp->pfnPrintf(pHlp, "  %u conflict%s: ", pCur->cConflicts, pCur->cConflicts == 1 ? "" : "s");
 
1463
            uint32_t cLeft = RT_MIN(pCur->cConflicts, RT_ELEMENTS(pCur->aGCPtrConflicts));
 
1464
            uint32_t i     = pCur->cConflicts;
 
1465
            while (cLeft-- > 0)
 
1466
            {
 
1467
                i = (i - 1) & (PGMMAPPING_CONFLICT_MAX - 1);
 
1468
                pHlp->pfnPrintf(pHlp, cLeft ? "%RGv, " : "%RGv\n", pCur->aGCPtrConflicts[i]);
 
1469
            }
 
1470
        }
 
1471
    }
1410
1472
}
1411
1473