Index: /trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp	(revision 64910)
+++ /trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp	(revision 64911)
@@ -2597,5 +2597,5 @@
         const size_t     cbRange = RT_OFFSETOF(PGMREGMMIORANGE, RamRange.aPages[cPagesTrackedByChunk]);
         PPGMREGMMIORANGE pNew    = NULL;
-        if (   cPagesTrackedByChunk > cPagesLeft
+        if (   cPagesTrackedByChunk > cPagesLeft /**< @todo r=klaus the first part of the condition is guaranteed false due to RT_MIN above */
             || cbRange >= _1M)
         {
@@ -2705,6 +2705,8 @@
         *ppNext = pNew;
         ASMCompilerBarrier();
+        cPagesLeft -= cPagesTrackedByChunk;
         ppNext = &pNew->pNextR3;
     }
+    Assert(cPagesLeft == 0);
 
     if (RT_SUCCESS(rc))
@@ -3491,5 +3493,5 @@
     }
 
-    /* 
+    /*
      * We're good, set the flags and invalid the mapping TLB.
      */
