Index: /trunk/src/VBox/VMM/DBGFAddrSpace.cpp
===================================================================
--- /trunk/src/VBox/VMM/DBGFAddrSpace.cpp	(revision 30077)
+++ /trunk/src/VBox/VMM/DBGFAddrSpace.cpp	(revision 30078)
@@ -39,4 +39,5 @@
 #define LOG_GROUP LOG_GROUP_DBGF
 #include <VBox/dbgf.h>
+#include <VBox/pdmapi.h>
 #include <VBox/mm.h>
 #include "DBGFInternal.h"
@@ -406,4 +407,53 @@
 
 /**
+ * @callback_method_impl{FNPDMR3ENUM}
+ */
+static DECLCALLBACK(int) dbgfR3AsLazyPopulateR0Callback(PVM pVM, const char *pszFilename, const char *pszName,
+                                                        RTUINTPTR ImageBase, size_t cbImage, bool fRC, void *pvArg)
+{
+    /* Only ring-0 modules. */
+    if (!fRC)
+    {
+        RTDBGMOD hDbgMod;
+        int rc = RTDbgModCreateFromImage(&hDbgMod, pszFilename, pszName, 0 /*fFlags*/);
+        if (RT_SUCCESS(rc))
+        {
+            rc = RTDbgAsModuleLink((RTDBGAS)pvArg, hDbgMod, ImageBase, 0 /*fFlags*/);
+            if (RT_FAILURE(rc))
+                LogRel(("DBGF: Failed to link module \"%s\" into DBGF_AS_R0 at %RTptr: %Rrc\n",
+                        pszName, ImageBase, rc));
+        }
+        else
+            LogRel(("DBGF: RTDbgModCreateFromImage failed with rc=%Rrc for module \"%s\" (%s)\n",
+                    rc, pszName, pszFilename));
+    }
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * Lazily populates the specified address space.
+ *
+ * @param   pVM                 The VM handle.
+ * @param   hAlias              The alias.
+ */
+static void dbgfR3AsLazyPopulate(PVM pVM, RTDBGAS hAlias)
+{
+    DBGF_AS_DB_LOCK_WRITE(pVM);
+    uintptr_t iAlias = DBGF_AS_ALIAS_2_INDEX(hAlias);
+    if (!pVM->dbgf.s.afAsAliasPopuplated[iAlias])
+    {
+        RTDBGAS hAs = pVM->dbgf.s.ahAsAliases[iAlias];
+        if (hAlias == DBGF_AS_R0)
+            PDMR3LdrEnumModules(pVM, dbgfR3AsLazyPopulateR0Callback, hAs);
+        /** @todo what do we do about DBGF_AS_RC?  */
+
+        pVM->dbgf.s.afAsAliasPopuplated[iAlias] = true;
+    }
+    DBGF_AS_DB_UNLOCK_WRITE(pVM);
+}
+
+
+/**
  * Resolves the address space handle into a real handle if it's an alias.
  *
@@ -447,4 +497,8 @@
         if (DBGF_AS_IS_FIXED_ALIAS(hAlias))
         {
+            /* Perform lazy address space population. */
+            if (!pVM->dbgf.s.afAsAliasPopuplated[iAlias])
+                dbgfR3AsLazyPopulate(pVM, hAlias);
+
             /* Won't ever change, no need to grab the lock. */
             hAlias = pVM->dbgf.s.ahAsAliases[iAlias];
@@ -927,5 +981,5 @@
             RTDbgModRelease(hMod);
     }
-    /* Temporary conversion. */
+    /* Temporary conversions. */
     else if (hDbgAs == DBGF_AS_GLOBAL)
     {
@@ -934,4 +988,32 @@
         if (RT_SUCCESS(rc))
             dbgfR3AsSymbolConvert(pSymbol, &DbgfSym);
+    }
+    else if (hDbgAs == DBGF_AS_R0)
+    {
+        RTR0PTR     R0PtrMod;
+        char        szNearSym[260];
+        RTR0PTR     R0PtrNearSym;
+        RTR0PTR     R0PtrNearSym2;
+        rc = PDMR3LdrQueryR0ModFromPC(pVM, pAddress->FlatPtr,
+                                      pSymbol->szName, sizeof(pSymbol->szName) / 2, &R0PtrMod,
+                                      &szNearSym[0],   sizeof(szNearSym),           &R0PtrNearSym,
+                                      NULL,            0,                           &R0PtrNearSym2);
+        if (RT_SUCCESS(rc))
+        {
+            pSymbol->offSeg     = pSymbol->Value = R0PtrNearSym;
+            pSymbol->cb         = R0PtrNearSym2 > R0PtrNearSym ? R0PtrNearSym2 - R0PtrNearSym : 0;
+            pSymbol->iSeg       = 0;
+            pSymbol->fFlags     = 0;
+            pSymbol->iOrdinal   = UINT32_MAX;
+            size_t offName = strlen(pSymbol->szName);
+            pSymbol->szName[offName++] = '!';
+            size_t cchNearSym = strlen(szNearSym);
+            if (cchNearSym + offName >= sizeof(pSymbol->szName))
+                cchNearSym = sizeof(pSymbol->szName) - offName - 1;
+            strncpy(&pSymbol->szName[offName], szNearSym, cchNearSym);
+            pSymbol->szName[offName + cchNearSym] = '\0';
+            if (poffDisp)
+                *poffDisp = pAddress->FlatPtr - pSymbol->Value;
+        }
     }
 
Index: /trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp	(revision 30077)
+++ /trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp	(revision 30078)
@@ -1245,10 +1245,6 @@
 VMMDECL(int) PGMPhysGCPhys2CCPtr(PVM pVM, RTGCPHYS GCPhys, void **ppv, PPGMPAGEMAPLOCK pLock)
 {
-#if !(defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)) // for provoking guru - DO NOT COMMIT THIS!
     int rc = pgmLock(pVM);
     AssertRCReturn(rc, rc);
-#else
-    int rc;
-#endif
 
 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
@@ -1329,7 +1325,5 @@
 
 #endif /* IN_RING3 || IN_RING0 */
-#if !(defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)) // for provoking guru - DO NOT COMMIT THIS!
     pgmUnlock(pVM);
-#endif
     return rc;
 }
