Index: trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- trunk/src/VBox/Runtime/Makefile.kmk	(revision 9227)
+++ trunk/src/VBox/Runtime/Makefile.kmk	(revision 9228)
@@ -207,4 +207,5 @@
 	common/table/avlhcphys.cpp \
 	common/table/avllu32.cpp \
+	common/table/avlou32.cpp \
 	common/table/avlogcphys.cpp \
 	common/table/avlogcptr.cpp \
@@ -1270,4 +1271,5 @@
 	common/string/strprintf.cpp \
 	common/table/avllu32.cpp \
+	common/table/avlou32.cpp \
 	common/table/avlogcphys.cpp \
 	common/table/avlogcptr.cpp \
Index: trunk/src/VBox/VMM/PATM/CSAM.cpp
===================================================================
--- trunk/src/VBox/VMM/PATM/CSAM.cpp	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/CSAM.cpp	(revision 9228)
@@ -578,5 +578,5 @@
     if (rc != VINF_SUCCESS)
     {
-////        AssertMsgRC(rc, ("MMR3PhysGCVirt2HCVirtEx failed for %VGv\n", pGCPtr));
+////        AssertMsgRC(rc, ("MMR3PhysGCVirt2HCVirtEx failed for %VRv\n", pGCPtr));
         STAM_PROFILE_STOP(&pVM->csam.s.StatTimeAddrConv, a);
         return NULL;
@@ -738,5 +738,5 @@
             if (pCurInstrHC == NULL)
             {
-                Log(("CSAMGCVirtToHCVirt failed for %VGv\n", pCurInstrGC));
+                Log(("CSAMGCVirtToHCVirt failed for %VRv\n", pCurInstrGC));
                 break;
             }
@@ -772,38 +772,38 @@
         {
         case OP_STR:
-            Log(("Privileged instruction at %VGv: str!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: str!!\n", pCurInstrGC));
             break;
         case OP_LSL:
-            Log(("Privileged instruction at %VGv: lsl!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: lsl!!\n", pCurInstrGC));
             break;
         case OP_LAR:
-            Log(("Privileged instruction at %VGv: lar!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: lar!!\n", pCurInstrGC));
             break;
         case OP_SGDT:
-            Log(("Privileged instruction at %VGv: sgdt!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: sgdt!!\n", pCurInstrGC));
             break;
         case OP_SLDT:
-            Log(("Privileged instruction at %VGv: sldt!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: sldt!!\n", pCurInstrGC));
             break;
         case OP_SIDT:
-            Log(("Privileged instruction at %VGv: sidt!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: sidt!!\n", pCurInstrGC));
             break;
         case OP_SMSW:
-            Log(("Privileged instruction at %VGv: smsw!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: smsw!!\n", pCurInstrGC));
             break;
         case OP_VERW:
-            Log(("Privileged instruction at %VGv: verw!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: verw!!\n", pCurInstrGC));
             break;
         case OP_VERR:
-            Log(("Privileged instruction at %VGv: verr!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: verr!!\n", pCurInstrGC));
             break;
         case OP_CPUID:
-            Log(("Privileged instruction at %VGv: cpuid!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: cpuid!!\n", pCurInstrGC));
             break;
         case OP_PUSH:
-            Log(("Privileged instruction at %VGv: push cs!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: push cs!!\n", pCurInstrGC));
             break;
         case OP_IRET:
-            Log(("Privileged instruction at %VGv: iret!!\n", pCurInstrGC));
+            Log(("Privileged instruction at %VRv: iret!!\n", pCurInstrGC));
             break;
         }
@@ -834,8 +834,8 @@
             {
             case OP_JMP:
-                Log(("Control Flow instruction at %VGv: jmp!!\n", pCurInstrGC));
+                Log(("Control Flow instruction at %VRv: jmp!!\n", pCurInstrGC));
                 break;
             case OP_CALL:
-                Log(("Control Flow instruction at %VGv: call!!\n", pCurInstrGC));
+                Log(("Control Flow instruction at %VRv: call!!\n", pCurInstrGC));
                 break;
             }
@@ -919,5 +919,5 @@
                 if (pCurInstrHC == NULL)
                 {
-                    Log(("CSAMGCVirtToHCVirt failed for %VGv\n", pCurInstrGC));
+                    Log(("CSAMGCVirtToHCVirt failed for %VRv\n", pCurInstrGC));
                     goto done;
                 }
@@ -935,5 +935,5 @@
                 if (VBOX_FAILURE(rc2))
                 {
-                    Log(("Disassembly failed at %VGv with %Vrc (probably page not present) -> return to caller\n", pCurInstrGC, rc2));
+                    Log(("Disassembly failed at %VRv with %Vrc (probably page not present) -> return to caller\n", pCurInstrGC, rc2));
                     goto done;
                 }
@@ -949,5 +949,5 @@
                     {
                         /// @todo fault in the page
-                        Log(("Page for current instruction %VGv is not present!!\n", pCurInstrGC));
+                        Log(("Page for current instruction %VRv is not present!!\n", pCurInstrGC));
                         goto done;
                     }
@@ -1003,5 +1003,5 @@
 
                         /* Analyse the function. */
-                        Log(("Found new function at %VGv\n", pCurInstrGC));
+                        Log(("Found new function at %VRv\n", pCurInstrGC));
                         STAM_COUNTER_INC(&pVM->csam.s.StatScanNextFunction);
                         csamAnalyseCallCodeStream(pVM, pInstrGC, pCurInstrGC, fCode32, pfnCSAMR3Analyse, pUserData, pCacheRec);
@@ -1029,5 +1029,5 @@
 
                         /* Analyse the function. */
-                        Log(("Found new function at %VGv\n", pCurInstrGC));
+                        Log(("Found new function at %VRv\n", pCurInstrGC));
                         STAM_COUNTER_INC(&pVM->csam.s.StatScanNextFunction);
                         csamAnalyseCallCodeStream(pVM, pInstrGC, pCurInstrGC, fCode32, pfnCSAMR3Analyse, pUserData, pCacheRec);
@@ -1082,5 +1082,5 @@
 #endif
 
-    LogFlow(("csamAnalyseCodeStream: code at %VGv depth=%d\n", pCurInstrGC, pCacheRec->depth));
+    LogFlow(("csamAnalyseCodeStream: code at %VRv depth=%d\n", pCurInstrGC, pCacheRec->depth));
 
     pVM->csam.s.fScanningStarted = true;
@@ -1095,5 +1095,5 @@
     if (pCacheRec->depth > 512)
     {
-        LogFlow(("CSAM: maximum calldepth reached for %VGv\n", pCurInstrGC));
+        LogFlow(("CSAM: maximum calldepth reached for %VRv\n", pCurInstrGC));
         pCacheRec->depth--;
         return VINF_SUCCESS;    //let's not go on forever
@@ -1120,5 +1120,5 @@
         else
         {
-            LogFlow(("Code at %VGv has been scanned before\n", pCurInstrGC));
+            LogFlow(("Code at %VRv has been scanned before\n", pCurInstrGC));
             rc = VINF_SUCCESS;
             goto done;
@@ -1128,5 +1128,5 @@
         if (pCurInstrHC == NULL)
         {
-            Log(("CSAMGCVirtToHCVirt failed for %VGv\n", pCurInstrGC));
+            Log(("CSAMGCVirtToHCVirt failed for %VRv\n", pCurInstrGC));
             rc = VERR_PATCHING_REFUSED;
             goto done;
@@ -1145,5 +1145,5 @@
         if (VBOX_FAILURE(rc2))
         {
-            Log(("Disassembly failed at %VGv with %Vrc (probably page not present) -> return to caller\n", pCurInstrGC, rc2));
+            Log(("Disassembly failed at %VRv with %Vrc (probably page not present) -> return to caller\n", pCurInstrGC, rc2));
             rc = VINF_SUCCESS;
             goto done;
@@ -1162,5 +1162,5 @@
             {
                 /// @todo fault in the page
-                Log(("Page for current instruction %VGv is not present!!\n", pCurInstrGC));
+                Log(("Page for current instruction %VRv is not present!!\n", pCurInstrGC));
                 rc = VWRN_CONTINUE_ANALYSIS;
                 goto next_please;
@@ -1224,5 +1224,5 @@
                 if (!PGMGstIsPagePresent(pVM, addr))
                 {
-                    Log(("Page for current instruction %VGv is not present!!\n", addr));
+                    Log(("Page for current instruction %VRv is not present!!\n", addr));
                     rc = VWRN_CONTINUE_ANALYSIS;
                     goto next_please;
@@ -1297,5 +1297,5 @@
                        break;
 
-                    Log(("Jump to %VGv\n", addr));
+                    Log(("Jump to %VRv\n", addr));
 
                     pJmpPage = NULL;
@@ -1358,5 +1358,5 @@
     if (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT)
     {
-        Log(("csamR3CalcPageHash: page %VGv not present!!\n", pInstr));
+        Log(("csamR3CalcPageHash: page %VRv not present!!\n", pInstr));
         return ~0ULL;
     }
@@ -1366,5 +1366,5 @@
     if (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT)
     {
-        Log(("csamR3CalcPageHash: page %VGv not present!!\n", pInstr));
+        Log(("csamR3CalcPageHash: page %VRv not present!!\n", pInstr));
         return ~0ULL;
     }
@@ -1374,5 +1374,5 @@
     if (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT)
     {
-        Log(("csamR3CalcPageHash: page %VGv not present!!\n", pInstr));
+        Log(("csamR3CalcPageHash: page %VRv not present!!\n", pInstr));
         return ~0ULL;
     }
@@ -1382,5 +1382,5 @@
     if (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT)
     {
-        Log(("csamR3CalcPageHash: page %VGv not present!!\n", pInstr));
+        Log(("csamR3CalcPageHash: page %VRv not present!!\n", pInstr));
         return ~0ULL;
     }
@@ -1390,5 +1390,5 @@
     if (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT)
     {
-        Log(("csamR3CalcPageHash: page %VGv not present!!\n", pInstr));
+        Log(("csamR3CalcPageHash: page %VRv not present!!\n", pInstr));
         return ~0ULL;
     }
@@ -1456,5 +1456,5 @@
     else
     if (rc != VERR_PAGE_NOT_PRESENT && rc != VERR_PAGE_TABLE_NOT_PRESENT)
-        AssertMsgFailed(("PGMR3GetPage %VGv failed with %Vrc\n", addr, rc));
+        AssertMsgFailed(("PGMR3GetPage %VRv failed with %Vrc\n", addr, rc));
 
     pPageRec = (PCSAMPAGEREC)RTAvlPVGet(&pVM->csam.s.pPageTree, (AVLPVKEY)addr);
@@ -1469,5 +1469,5 @@
         }
 
-        Log(("CSAMR3FlushPage: page %VGv has changed -> FLUSH (rc=%Vrc) (Phys: %VGp vs %VGp)\n", addr, rc, GCPhys, pPageRec->page.GCPhys));
+        Log(("CSAMR3FlushPage: page %VRv has changed -> FLUSH (rc=%Vrc) (Phys: %VGp vs %VGp)\n", addr, rc, GCPhys, pPageRec->page.GCPhys));
 
         STAM_COUNTER_ADD(&pVM->csam.s.StatNrFlushes, 1);
@@ -1608,5 +1608,5 @@
     bool         ret;
 
-    Log(("New page record for %VGv\n", GCPtr & PAGE_BASE_GC_MASK));
+    Log(("New page record for %VRv\n", GCPtr & PAGE_BASE_GC_MASK));
 
     pPage = (PCSAMPAGEREC)MMR3HeapAllocZ(pVM, MM_TAG_CSAM_PATCH, sizeof(CSAMPAGEREC));
@@ -1646,7 +1646,7 @@
                                              (fMonitorInvalidation) ? CSAMCodePageInvalidate : 0, CSAMCodePageWriteHandler, "CSAMGCCodePageWriteHandler", 0,
                                              csamGetMonitorDescription(enmTag));
-        AssertMsg(VBOX_SUCCESS(rc) || rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT, ("PGMR3HandlerVirtualRegisterEx %VGv failed with %Vrc\n", GCPtr, rc));
+        AssertMsg(VBOX_SUCCESS(rc) || rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT, ("PGMR3HandlerVirtualRegisterEx %VRv failed with %Vrc\n", GCPtr, rc));
         if (VBOX_FAILURE(rc))
-            Log(("PGMR3HandlerVirtualRegisterEx for %VGv failed with %Vrc\n", GCPtr, rc));
+            Log(("PGMR3HandlerVirtualRegisterEx for %VRv failed with %Vrc\n", GCPtr, rc));
 
         /* Could fail, because it's already monitored. Don't treat that condition as fatal. */
@@ -1667,5 +1667,5 @@
     }
 
-    Log(("csamCreatePageRecord %VGv HCPhys=%VGp\n", GCPtr, pPage->page.GCPhys));
+    Log(("csamCreatePageRecord %VRv HCPhys=%VGp\n", GCPtr, pPage->page.GCPhys));
 
 #ifdef VBOX_WITH_STATISTICS
@@ -1717,5 +1717,5 @@
     pPageAddrGC &= PAGE_BASE_GC_MASK;
 
-    Log(("CSAMR3MonitorPage %VGv %d\n", pPageAddrGC, enmTag));
+    Log(("CSAMR3MonitorPage %VRv %d\n", pPageAddrGC, enmTag));
 
     /** @todo implicit assumption */
@@ -1751,12 +1751,12 @@
     if (!pPageRec->page.fMonitorActive)
     {
-        Log(("CSAMR3MonitorPage: activate monitoring for %VGv\n", pPageAddrGC));
+        Log(("CSAMR3MonitorPage: activate monitoring for %VRv\n", pPageAddrGC));
 
         rc = PGMR3HandlerVirtualRegister(pVM, PGMVIRTHANDLERTYPE_WRITE, pPageAddrGC, pPageAddrGC + (PAGE_SIZE - 1) /* inclusive! */,
                                          (fMonitorInvalidation) ? CSAMCodePageInvalidate : 0, CSAMCodePageWriteHandler, "CSAMGCCodePageWriteHandler", 0,
                                          csamGetMonitorDescription(enmTag));
-        AssertMsg(VBOX_SUCCESS(rc) || rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT, ("PGMR3HandlerVirtualRegisterEx %VGv failed with %Vrc\n", pPageAddrGC, rc));
+        AssertMsg(VBOX_SUCCESS(rc) || rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT, ("PGMR3HandlerVirtualRegisterEx %VRv failed with %Vrc\n", pPageAddrGC, rc));
         if (VBOX_FAILURE(rc))
-            Log(("PGMR3HandlerVirtualRegisterEx for %VGv failed with %Vrc\n", pPageAddrGC, rc));
+            Log(("PGMR3HandlerVirtualRegisterEx for %VRv failed with %Vrc\n", pPageAddrGC, rc));
 
         /* Could fail, because it's already monitored. Don't treat that condition as fatal. */
@@ -1800,5 +1800,5 @@
 //        AssertMsg(     (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT)
 //                ||  !(fPageShw & X86_PTE_RW)
-//                ||   (pPageRec->page.GCPhys == 0), ("Shadow page flags for %VGv (%VHp) aren't readonly (%VX64)!!\n", pPageAddrGC, GCPhys, fPageShw));
+//                ||   (pPageRec->page.GCPhys == 0), ("Shadow page flags for %VRv (%VHp) aren't readonly (%VX64)!!\n", pPageAddrGC, GCPhys, fPageShw));
     }
 #endif
@@ -1829,5 +1829,5 @@
     pPageAddrGC &= PAGE_BASE_GC_MASK;
 
-    Log(("CSAMR3UnmonitorPage %VGv %d\n", pPageAddrGC, enmTag));
+    Log(("CSAMR3UnmonitorPage %VRv %d\n", pPageAddrGC, enmTag));
 
     Assert(enmTag == CSAM_TAG_REM);
@@ -1853,5 +1853,5 @@
     PCSAMPAGEREC pPageRec;
 
-    Log(("csamRemovePageRecord %VGv\n", GCPtr));
+    Log(("csamRemovePageRecord %VRv\n", GCPtr));
     pPageRec = (PCSAMPAGEREC)RTAvlPVRemove(&pVM->csam.s.pPageTree, (AVLPVKEY)GCPtr);
 
@@ -2038,5 +2038,5 @@
 static void csamMarkCode(PVM pVM, PCSAMPAGE pPage, RTGCPTR32 pInstr, uint32_t opsize, bool fScanned)
 {
-    LogFlow(("csamMarkCodeAsScanned %VGv opsize=%d\n", pInstr, opsize));
+    LogFlow(("csamMarkCodeAsScanned %VRv opsize=%d\n", pInstr, opsize));
     CSAMMarkPage(pVM, pInstr, fScanned);
 
@@ -2055,5 +2055,5 @@
         if (pPage->uSize >= PAGE_SIZE)
         {
-            Log(("Scanned full page (%VGv) -> free bitmap\n", pInstr & PAGE_BASE_GC_MASK));
+            Log(("Scanned full page (%VRv) -> free bitmap\n", pInstr & PAGE_BASE_GC_MASK));
             MMR3HeapFree(pPage->pBitmap);
             pPage->pBitmap = NULL;
@@ -2088,5 +2088,5 @@
     }
 
-    Log(("CSAMR3MarkCode: %VGv size=%d fScanned=%d\n", pInstr, opsize, fScanned));
+    Log(("CSAMR3MarkCode: %VRv size=%d fScanned=%d\n", pInstr, opsize, fScanned));
     csamMarkCode(pVM, pPage, pInstr, opsize, fScanned);
     return VINF_SUCCESS;
@@ -2190,5 +2190,5 @@
         Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
 
-        Log(("CSAMR3FlushDirtyPages: flush %VGv (modifypage rc=%Vrc)\n", pVM->csam.s.pvDirtyBasePage[i], rc));
+        Log(("CSAMR3FlushDirtyPages: flush %VRv (modifypage rc=%Vrc)\n", pVM->csam.s.pvDirtyBasePage[i], rc));
 
         pPageRec = (PCSAMPAGEREC)RTAvlPVGet(&pVM->csam.s.pPageTree, (AVLPVKEY)GCPtr);
@@ -2227,5 +2227,5 @@
         GCPtr = GCPtr & PAGE_BASE_GC_MASK;
 
-        Log(("csamR3FlushCodePages: %VGv\n", GCPtr));
+        Log(("csamR3FlushCodePages: %VRv\n", GCPtr));
         PGMShwSetPage(pVM, GCPtr, 1, 0);
         /* Resync the page to make sure instruction fetch will fault */
@@ -2302,5 +2302,5 @@
                 PCSAMPAGE pPage = NULL;
 
-                Log(("CSAMCheckGates: checking previous call instruction %VGv\n", pHandler));
+                Log(("CSAMCheckGates: checking previous call instruction %VRv\n", pHandler));
                 STAM_PROFILE_START(&pVM->csam.s.StatTime, a);
                 rc = csamAnalyseCodeStream(pVM, pHandler, pHandler, true, CSAMR3AnalyseCallback, pPage, &cacheRec);
@@ -2384,5 +2384,5 @@
             {
                 /* Refuse to patch a handler whose idt cs selector isn't wide open. */
-                Log(("CSAMCheckGates: check gate %d failed due to rc %Vrc GCPtrBase=%VGv limit=%x\n", iGate, rc, selInfo.GCPtrBase, selInfo.cbLimit));
+                Log(("CSAMCheckGates: check gate %d failed due to rc %Vrc GCPtrBase=%VRv limit=%x\n", iGate, rc, selInfo.GCPtrBase, selInfo.cbLimit));
                 continue;
             }
@@ -2391,9 +2391,9 @@
             if (pGuestIdte->Gen.u5Type2 == VBOX_IDTE_TYPE2_TRAP_32)
             {
-                Log(("CSAMCheckGates: check trap gate %d at %04X:%08X (flat %VGv)\n", iGate, pGuestIdte->Gen.u16SegSel, (pGuestIdte->Gen.u16OffsetHigh << 16) | pGuestIdte->Gen.u16OffsetLow, pHandler));
+                Log(("CSAMCheckGates: check trap gate %d at %04X:%08X (flat %VRv)\n", iGate, pGuestIdte->Gen.u16SegSel, (pGuestIdte->Gen.u16OffsetHigh << 16) | pGuestIdte->Gen.u16OffsetLow, pHandler));
             }
             else
             {
-                Log(("CSAMCheckGates: check interrupt gate %d at %04X:%08X (flat %VGv)\n", iGate, pGuestIdte->Gen.u16SegSel, (pGuestIdte->Gen.u16OffsetHigh << 16) | pGuestIdte->Gen.u16OffsetLow, pHandler));
+                Log(("CSAMCheckGates: check interrupt gate %d at %04X:%08X (flat %VRv)\n", iGate, pGuestIdte->Gen.u16SegSel, (pGuestIdte->Gen.u16OffsetHigh << 16) | pGuestIdte->Gen.u16OffsetLow, pHandler));
             }
 
@@ -2455,5 +2455,5 @@
             }
 
-            Log(("Installing %s gate handler for 0x%X at %VGv\n", (pGuestIdte->Gen.u5Type2 == VBOX_IDTE_TYPE2_TRAP_32) ? "trap" : "intr", iGate, pHandler));
+            Log(("Installing %s gate handler for 0x%X at %VRv\n", (pGuestIdte->Gen.u5Type2 == VBOX_IDTE_TYPE2_TRAP_32) ? "trap" : "intr", iGate, pHandler));
 
             rc = PATMR3InstallPatch(pVM, pHandler, fPatchFlags);
@@ -2491,5 +2491,5 @@
     }
 
-    Log(("CSAMR3RecordCallAddress %VGv\n", GCPtrCall));
+    Log(("CSAMR3RecordCallAddress %VRv\n", GCPtrCall));
 
     pVM->csam.s.pvCallInstruction[pVM->csam.s.iCallInstruction++] = GCPtrCall;
Index: trunk/src/VBox/VMM/PATM/PATM.cpp
===================================================================
--- trunk/src/VBox/VMM/PATM/PATM.cpp	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/PATM.cpp	(revision 9228)
@@ -64,10 +64,10 @@
 *******************************************************************************/
 
-static int          patmDisableUnusablePatch(PVM pVM, RTGCPTR32 pInstrGC, RTGCPTR32 pConflictAddr, PPATCHINFO pPatch);
+static int          patmDisableUnusablePatch(PVM pVM, RTRCPTR pInstrGC, RTRCPTR pConflictAddr, PPATCHINFO pPatch);
 static int          patmActivateInt3Patch(PVM pVM, PPATCHINFO pPatch);
 static int          patmDeactivateInt3Patch(PVM pVM, PPATCHINFO pPatch);
 
 #ifdef LOG_ENABLED // keep gcc quiet
-static bool         patmIsCommonIDTHandlerPatch(PVM pVM, RTGCPTR32 pInstrGC);
+static bool         patmIsCommonIDTHandlerPatch(PVM pVM, RTRCPTR pInstrGC);
 #endif
 #ifdef VBOX_WITH_STATISTICS
@@ -81,9 +81,9 @@
 
 static int               patmReinit(PVM pVM);
-static DECLCALLBACK(int) RelocatePatches(PAVLOGCPTRNODECORE pNode, void *pParam);
+static DECLCALLBACK(int) RelocatePatches(PAVLOU32NODECORE pNode, void *pParam);
 static DECLCALLBACK(int) patmVirtPageHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser);
 
 #ifdef VBOX_WITH_DEBUGGER
-static DECLCALLBACK(int) DisableAllPatches(PAVLOGCPTRNODECORE pNode, void *pVM);
+static DECLCALLBACK(int) DisableAllPatches(PAVLOU32NODECORE pNode, void *pVM);
 static DECLCALLBACK(int) patmr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
 static DECLCALLBACK(int) patmr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
@@ -126,5 +126,5 @@
 
     /* PATM stack page for call instruction execution. (2 parts: one for our private stack and one to store the original return address */
-    pVM->patm.s.pGCStackHC  = (RTGCPTR32 *)(pVM->patm.s.pPatchMemHC + PATCH_MEMORY_SIZE + PAGE_SIZE);
+    pVM->patm.s.pGCStackHC  = (RTRCPTR *)(pVM->patm.s.pPatchMemHC + PATCH_MEMORY_SIZE + PAGE_SIZE);
     pVM->patm.s.pGCStackGC  = MMHyperHC2GC(pVM, pVM->patm.s.pGCStackHC);
 
@@ -324,5 +324,6 @@
     memset(pVM->patm.s.pGCStateHC, 0, PAGE_SIZE);
     AssertReleaseMsg(pVM->patm.s.pGCStateGC, ("Impossible! MMHyperHC2GC(%p) failed!\n", pVM->patm.s.pGCStateGC));
-    Log(("Patch memory allocated at %p - %VGv\n", pVM->patm.s.pPatchMemHC, pVM->patm.s.pPatchMemGC));
+    
+    Log(("Patch memory allocated at %p - %VRv\n", pVM->patm.s.pPatchMemHC, pVM->patm.s.pPatchMemGC));
     pVM->patm.s.pGCStateHC->uVMFlags = X86_EFL_IF;
 
@@ -409,8 +410,8 @@
 PATMR3DECL(void) PATMR3Relocate(PVM pVM)
 {
-    RTGCPTR32         GCPtrNew = MMHyperHC2GC(pVM, pVM->patm.s.pGCStateHC);
-    RTGCINTPTR      delta = GCPtrNew - pVM->patm.s.pGCStateGC;
-
-    Log(("PATMR3Relocate from %VGv to %VGv - delta %08X\n", pVM->patm.s.pGCStateGC, GCPtrNew, delta));
+    RTRCPTR     GCPtrNew = MMHyperHC2GC(pVM, pVM->patm.s.pGCStateHC);
+    RTRCINTPTR  delta = GCPtrNew - pVM->patm.s.pGCStateGC;
+
+    Log(("PATMR3Relocate from %VRv to %VRv - delta %08X\n", pVM->patm.s.pGCStateGC, GCPtrNew, delta));
     if (delta)
     {
@@ -423,5 +424,5 @@
         pVM->patm.s.deltaReloc = delta;
 
-        RTAvloGCPtrDoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, RelocatePatches, (void *)pVM);
+        RTAvloU32DoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, RelocatePatches, (void *)pVM);
 
         rc = CPUMQueryGuestCtxPtr(pVM, &pCtx);
@@ -484,5 +485,5 @@
     while (true)
     {
-        PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloGCPtrRemoveBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, 0, true);
+        PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloU32RemoveBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, 0, true);
         if (pPatchRec)
         {
@@ -533,5 +534,5 @@
         for (int i=0;i<orgsize;i++)
         {
-            int rc = PATMR3QueryOpcode(pDisInfo->pVM, (RTGCPTR32)pSrc, pDest);
+            int rc = PATMR3QueryOpcode(pDisInfo->pVM, (RTRCPTR)pSrc, pDest);
             if (VBOX_SUCCESS(rc))
             {
@@ -575,5 +576,5 @@
 
 /**
- * Callback function for RTAvloGCPtrDoWithAll
+ * Callback function for RTAvloU32DoWithAll
  *
  * Updates all fixups in the patches
@@ -583,9 +584,9 @@
  * @param   pParam      The VM to operate on.
  */
-static DECLCALLBACK(int) RelocatePatches(PAVLOGCPTRNODECORE pNode, void *pParam)
+static DECLCALLBACK(int) RelocatePatches(PAVLOU32NODECORE pNode, void *pParam)
 {
     PPATMPATCHREC   pPatch = (PPATMPATCHREC)pNode;
     PVM             pVM = (PVM)pParam;
-    RTGCINTPTR      delta;
+    RTRCINTPTR      delta;
 #ifdef LOG_ENABLED
     DISCPUSTATE     cpu;
@@ -615,5 +616,5 @@
 
     Log(("Nr of fixups %d\n", pPatch->patch.nrFixups));
-    delta = (RTGCINTPTR)pVM->patm.s.deltaReloc;
+    delta = (RTRCINTPTR)pVM->patm.s.deltaReloc;
 
     /*
@@ -635,8 +636,8 @@
         {
         case FIXUP_ABSOLUTE:
-            Log(("Absolute fixup at %VGv %VHv -> %VHv at %VGv\n", pRec->pSource, *(RTGCUINTPTR32*)pRec->pRelocPos, *(RTGCINTPTR*)pRec->pRelocPos + delta, pRec->pRelocPos));
+            Log(("Absolute fixup at %VRv %VHv -> %VHv at %VRv\n", pRec->pSource, *(RTRCUINTPTR *)pRec->pRelocPos, *(RTRCINTPTR*)pRec->pRelocPos + delta, pRec->pRelocPos));
             if (!pRec->pSource || PATMIsPatchGCAddr(pVM, pRec->pSource))
             {
-                *(RTGCUINTPTR32 *)pRec->pRelocPos += delta;
+                *(RTRCUINTPTR *)pRec->pRelocPos += delta;
             }
             else
@@ -649,14 +650,14 @@
 
                 memcpy(oldInstr, pPatch->patch.aPrivInstr, pPatch->patch.cbPrivInstr);
-                *(RTGCPTR32 *)&oldInstr[pPatch->patch.cbPrivInstr - sizeof(RTGCPTR32)] = pRec->pDest;
+                *(RTRCPTR *)&oldInstr[pPatch->patch.cbPrivInstr - sizeof(RTRCPTR)] = pRec->pDest;
 
                 rc = PGMPhysReadGCPtr(pVM, curInstr, pPatch->patch.pPrivInstrGC, pPatch->patch.cbPrivInstr);
                 Assert(VBOX_SUCCESS(rc) || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
 
-                pRec->pDest = (RTGCPTR32)((RTGCUINTPTR32)pRec->pDest + delta);
+                pRec->pDest = (RTRCPTR)((RTRCUINTPTR)pRec->pDest + delta);
 
                 if (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT)
                 {
-                    RTGCPTR32 pPage = pPatch->patch.pPrivInstrGC & PAGE_BASE_GC_MASK;
+                    RTRCPTR pPage = pPatch->patch.pPrivInstrGC & PAGE_BASE_GC_MASK;
 
                     Log(("PATM: Patch page not present -> check later!\n"));
@@ -677,5 +678,5 @@
                 if (VBOX_SUCCESS(rc))
                 {
-                    *(RTGCPTR32 *)&curInstr[pPatch->patch.cbPrivInstr - sizeof(RTGCPTR32)] = pRec->pDest;
+                    *(RTRCPTR *)&curInstr[pPatch->patch.cbPrivInstr - sizeof(RTRCPTR)] = pRec->pDest;
                     rc = PGMPhysWriteGCPtrDirty(pVM, pRec->pSource, curInstr, pPatch->patch.cbPrivInstr);
                     AssertRC(rc);
@@ -686,5 +687,5 @@
         case FIXUP_REL_JMPTOPATCH:
         {
-            RTGCPTR32 pTarget = (RTGCPTR32)((RTGCINTPTR)pRec->pDest + delta);
+            RTRCPTR pTarget = (RTRCPTR)((RTRCINTPTR)pRec->pDest + delta);
 
             if (    pPatch->patch.uState == PATCH_ENABLED
@@ -693,7 +694,7 @@
                 uint8_t    oldJump[SIZEOF_NEAR_COND_JUMP32];
                 uint8_t    temp[SIZEOF_NEAR_COND_JUMP32];
-                RTGCPTR32    pJumpOffGC;
-                RTGCINTPTR displ   = (RTGCINTPTR)pTarget - (RTGCINTPTR)pRec->pSource;
-                RTGCINTPTR displOld= (RTGCINTPTR)pRec->pDest - (RTGCINTPTR)pRec->pSource;
+                RTRCPTR    pJumpOffGC;
+                RTRCINTPTR displ   = (RTRCINTPTR)pTarget - (RTRCINTPTR)pRec->pSource;
+                RTRCINTPTR displOld= (RTRCINTPTR)pRec->pDest - (RTRCINTPTR)pRec->pSource;
 
                 Log(("Relative fixup (g2p) %08X -> %08X at %08X (source=%08x, target=%08x)\n", *(int32_t*)pRec->pRelocPos, displ, pRec->pRelocPos, pRec->pSource, pRec->pDest));
@@ -708,5 +709,5 @@
                     oldJump[0] = pPatch->patch.aPrivInstr[0];
                     oldJump[1] = pPatch->patch.aPrivInstr[1];
-                    *(RTGCUINTPTR32 *)&oldJump[2] = displOld;
+                    *(RTRCUINTPTR *)&oldJump[2] = displOld;
                 }
                 else
@@ -716,5 +717,5 @@
                     pJumpOffGC = pPatch->patch.pPrivInstrGC + 1;    //one byte opcode
                     oldJump[0] = 0xE9;
-                    *(RTGCUINTPTR32 *)&oldJump[1] = displOld;
+                    *(RTRCUINTPTR *)&oldJump[1] = displOld;
                 }
                 else
@@ -733,5 +734,5 @@
                 if (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT)
                 {
-                    RTGCPTR32 pPage = pPatch->patch.pPrivInstrGC & PAGE_BASE_GC_MASK;
+                    RTRCPTR pPage = pPatch->patch.pPrivInstrGC & PAGE_BASE_GC_MASK;
 
                     rc = PGMR3HandlerVirtualRegister(pVM, PGMVIRTHANDLERTYPE_ALL, pPage, pPage + (PAGE_SIZE - 1) /* inclusive! */, 0, patmVirtPageHandler, "PATMGCMonitorPage", 0, "PATMMonitorPatchJump");
@@ -770,10 +771,10 @@
         case FIXUP_REL_JMPTOGUEST:
         {
-            RTGCPTR32    pSource = (RTGCPTR32)((RTGCINTPTR)pRec->pSource + delta);
-            RTGCINTPTR displ   = (RTGCINTPTR)pRec->pDest - (RTGCINTPTR)pSource;
+            RTRCPTR    pSource = (RTRCPTR)((RTRCINTPTR)pRec->pSource + delta);
+            RTRCINTPTR displ   = (RTRCINTPTR)pRec->pDest - (RTRCINTPTR)pSource;
 
             Assert(!(pPatch->patch.flags & PATMFL_GLOBAL_FUNCTIONS));
             Log(("Relative fixup (p2g) %08X -> %08X at %08X (source=%08x, target=%08x)\n", *(int32_t*)pRec->pRelocPos, displ, pRec->pRelocPos, pRec->pSource, pRec->pDest));
-            *(RTGCUINTPTR32 *)pRec->pRelocPos = displ;
+            *(RTRCUINTPTR *)pRec->pRelocPos = displ;
             pRec->pSource = pSource;
             break;
@@ -830,5 +831,5 @@
 #ifdef VBOX_WITH_DEBUGGER
 /**
- * Callback function for RTAvloGCPtrDoWithAll
+ * Callback function for RTAvloU32DoWithAll
  *
  * Enables the patch that's being enumerated
@@ -838,9 +839,9 @@
  * @param   pVM         The VM to operate on.
  */
-static DECLCALLBACK(int) EnableAllPatches(PAVLOGCPTRNODECORE pNode, void *pVM)
+static DECLCALLBACK(int) EnableAllPatches(PAVLOU32NODECORE pNode, void *pVM)
 {
     PPATMPATCHREC pPatch = (PPATMPATCHREC)pNode;
 
-    PATMR3EnablePatch((PVM)pVM, (RTGCPTR32)pPatch->Core.Key);
+    PATMR3EnablePatch((PVM)pVM, (RTRCPTR)pPatch->Core.Key);
     return 0;
 }
@@ -850,5 +851,5 @@
 #ifdef VBOX_WITH_DEBUGGER
 /**
- * Callback function for RTAvloGCPtrDoWithAll
+ * Callback function for RTAvloU32DoWithAll
  *
  * Disables the patch that's being enumerated
@@ -858,9 +859,9 @@
  * @param   pVM         The VM to operate on.
  */
-static DECLCALLBACK(int) DisableAllPatches(PAVLOGCPTRNODECORE pNode, void *pVM)
+static DECLCALLBACK(int) DisableAllPatches(PAVLOU32NODECORE pNode, void *pVM)
 {
     PPATMPATCHREC pPatch = (PPATMPATCHREC)pNode;
 
-    PATMR3DisablePatch((PVM)pVM, (RTGCPTR32)pPatch->Core.Key);
+    PATMR3DisablePatch((PVM)pVM, (RTRCPTR)pPatch->Core.Key);
     return 0;
 }
@@ -891,5 +892,5 @@
  * @param   pcb         Size of the patch memory block
  */
-PATMR3DECL(RTGCPTR32) PATMR3QueryPatchMemGC(PVM pVM, uint32_t *pcb)
+PATMR3DECL(RTRCPTR) PATMR3QueryPatchMemGC(PVM pVM, uint32_t *pcb)
 {
     if (pcb)
@@ -946,5 +947,5 @@
  * @param   pAddrGC     GC pointer
  */
-PATMR3DECL(R3PTRTYPE(void *)) PATMR3GCPtrToHCPtr(PVM pVM, RTGCPTR32 pAddrGC)
+PATMR3DECL(R3PTRTYPE(void *)) PATMR3GCPtrToHCPtr(PVM pVM, RTRCPTR pAddrGC)
 {
     if (pVM->patm.s.pPatchMemGC <= pAddrGC && pVM->patm.s.pPatchMemGC + pVM->patm.s.cbPatchMem > pAddrGC)
@@ -1057,6 +1058,6 @@
                 {
                     uint8_t *pPatchHC;
-                    RTGCPTR32  pPatchGC;
-                    RTGCPTR32  pOrgInstrGC;
+                    RTRCPTR  pPatchGC;
+                    RTRCPTR  pOrgInstrGC;
 
                     pOrgInstrGC = PATMR3PatchToGCPtr(pVM, pInstrGC, 0);
@@ -1090,8 +1091,8 @@
         }
         /* Our jumps *always* have a dword displacement (to make things easier). */
-        Assert(sizeof(uint32_t) == sizeof(RTGCPTR32));
-        displ =  pBranchTargetGC - (pInstrGC + pRec->offDispl + sizeof(RTGCPTR32));
-        *(RTGCPTR32 *)(pRec->pJumpHC + pRec->offDispl) = displ;
-        Log(("Set branch target %d to %08X : %08x - (%08x + %d + %d)\n", nrJumpRecs, displ, pBranchTargetGC, pInstrGC, pRec->offDispl, sizeof(RTGCPTR32)));
+        Assert(sizeof(uint32_t) == sizeof(RTRCPTR));
+        displ =  pBranchTargetGC - (pInstrGC + pRec->offDispl + sizeof(RTRCPTR));
+        *(RTRCPTR *)(pRec->pJumpHC + pRec->offDispl) = displ;
+        Log(("Set branch target %d to %08X : %08x - (%08x + %d + %d)\n", nrJumpRecs, displ, pBranchTargetGC, pInstrGC, pRec->offDispl, sizeof(RTRCPTR)));
     }
     Assert(nrJumpRecs == pPatch->nrJumpRecs);
@@ -1107,5 +1108,5 @@
  *
  */
-static void patmAddIllegalInstrRecord(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pInstrGC)
+static void patmAddIllegalInstrRecord(PVM pVM, PPATCHINFO pPatch, RTRCPTR pInstrGC)
 {
     PAVLPVNODECORE pRec;
@@ -1120,5 +1121,5 @@
 }
 
-static bool patmIsIllegalInstr(PPATCHINFO pPatch, RTGCPTR32 pInstrGC)
+static bool patmIsIllegalInstr(PPATCHINFO pPatch, RTRCPTR pInstrGC)
 {
     PAVLPVNODECORE pRec;
@@ -1142,5 +1143,5 @@
  */
  /** @note Be extremely careful with this function. Make absolutely sure the guest address is correct! (to avoid executing instructions twice!) */
-void patmr3AddP2GLookupRecord(PVM pVM, PPATCHINFO pPatch, uint8_t *pPatchInstrHC, RTGCPTR32 pInstrGC, PATM_LOOKUP_TYPE enmType, bool fDirty)
+void patmr3AddP2GLookupRecord(PVM pVM, PPATCHINFO pPatch, uint8_t *pPatchInstrHC, RTRCPTR pInstrGC, PATM_LOOKUP_TYPE enmType, bool fDirty)
 {
     bool ret;
@@ -1178,5 +1179,5 @@
     if (enmType == PATM_LOOKUP_BOTHDIR)
     {
-        pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGet(&pPatch->Guest2PatchAddrTree, pInstrGC);
+        pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlU32Get(&pPatch->Guest2PatchAddrTree, pInstrGC);
         if (!pGuestToPatchRec)
         {
@@ -1185,5 +1186,5 @@
             pGuestToPatchRec->PatchOffset = PatchOffset;
 
-            ret = RTAvlGCPtrInsert(&pPatch->Guest2PatchAddrTree, &pGuestToPatchRec->Core);
+            ret = RTAvlU32Insert(&pPatch->Guest2PatchAddrTree, &pGuestToPatchRec->Core);
             Assert(ret);
         }
@@ -1201,8 +1202,8 @@
  * @param   pPatchInstrGC   Guest context pointer to patch block
  */
-void patmr3RemoveP2GLookupRecord(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pPatchInstrGC)
+void patmr3RemoveP2GLookupRecord(PVM pVM, PPATCHINFO pPatch, RTRCPTR pPatchInstrGC)
 {
     PAVLU32NODECORE     pNode;
-    PAVLGCPTRNODECORE   pNode2;
+    PAVLU32NODECORE     pNode2;
     PRECPATCHTOGUEST    pPatchToGuestRec;
     uint32_t            PatchOffset = pPatchInstrGC - pVM->patm.s.pPatchMemGC;  /* Offset in memory reserved for PATM. */
@@ -1217,5 +1218,5 @@
 
             Assert(pGuestToPatchRec->Core.Key);
-            pNode2 = RTAvlGCPtrRemove(&pPatch->Guest2PatchAddrTree, pGuestToPatchRec->Core.Key);
+            pNode2 = RTAvlU32Remove(&pPatch->Guest2PatchAddrTree, pGuestToPatchRec->Core.Key);
             Assert(pNode2);
         }
@@ -1299,5 +1300,5 @@
     if (pPatch->cbPatchBlockSize >= MAX_PATCH_SIZE)
     {
-        Log(("Code block too big (%x) for patch at %VGv!!\n", pPatch->cbPatchBlockSize, pCurInstrGC));
+        Log(("Code block too big (%x) for patch at %VRv!!\n", pPatch->cbPatchBlockSize, pCurInstrGC));
         fIllegalInstr = true;
         patmAddIllegalInstrRecord(pVM, pPatch, pCurInstrGC);
@@ -1423,5 +1424,5 @@
     {
         // The end marker for this kind of patch is any instruction at a location outside our patch jump
-        Log(("End of block at %VGv size %d\n", pCurInstrGC, pCpu->opsize));
+        Log(("End of block at %VRv size %d\n", pCurInstrGC, pCpu->opsize));
         return VINF_SUCCESS;
     }
@@ -1455,5 +1456,5 @@
     if (pPatch->cbPatchBlockSize >= MAX_PATCH_SIZE)
     {
-        Log(("Code block too big (%x) for function patch at %VGv!!\n", pPatch->cbPatchBlockSize, pCurInstrGC));
+        Log(("Code block too big (%x) for function patch at %VRv!!\n", pPatch->cbPatchBlockSize, pCurInstrGC));
         fIllegalInstr = true;
         patmAddIllegalInstrRecord(pVM, pPatch, pCurInstrGC);
@@ -1552,5 +1553,5 @@
     bool fInhibitIRQInstr = false;  /* did the instruction cause PATMFL_INHIBITIRQS to be set? */
 
-    LogFlow(("patmRecompileCallback %VGv %VGv\n", pInstrGC, pCurInstrGC));
+    LogFlow(("patmRecompileCallback %VRv %VRv\n", pInstrGC, pCurInstrGC));
 
     if (    patmGuestGCPtrToPatchGCPtr(pVM, pPatch, pCurInstrGC) != 0
@@ -1561,5 +1562,5 @@
          * no need to record this instruction as it's glue code that never crashes (it had better not!)
          */
-        Log(("patmRecompileCallback: jump to code we've recompiled before %VGv!\n", pCurInstrGC));
+        Log(("patmRecompileCallback: jump to code we've recompiled before %VRv!\n", pCurInstrGC));
         return patmPatchGenRelJump(pVM, pPatch, pCurInstrGC, OP_JMP, !!(pCpu->prefix & PREFIX_OPSIZE));
     }
@@ -1594,5 +1595,5 @@
     if (patmIsIllegalInstr(pPatch, pCurInstrGC))
     {
-        Log(("Illegal instruction at %VGv -> mark with int 3\n", pCurInstrGC));
+        Log(("Illegal instruction at %VRv -> mark with int 3\n", pCurInstrGC));
         rc = patmPatchGenIllegalInstr(pVM, pPatch);
         goto end;
@@ -1659,5 +1660,5 @@
                 &&  (pCpu->param1.base.reg_seg == USE_REG_SS))
             {
-                Log(("Force recompilation of next instruction for OP_MOV at %VGv\n", pCurInstrGC));
+                Log(("Force recompilation of next instruction for OP_MOV at %VRv\n", pCurInstrGC));
                 pPatch->flags |= PATMFL_RECOMPILE_NEXT;
                 /** @todo this could cause a fault (ring 0 selector being loaded in ring 1) */
@@ -1684,5 +1685,5 @@
             Assert(pCpu->pCurInstr->optype & OPTYPE_INHIBIT_IRQS);
 
-            Log(("Force recompilation of next instruction for OP_MOV at %VGv\n", pCurInstrGC));
+            Log(("Force recompilation of next instruction for OP_MOV at %VRv\n", pCurInstrGC));
             pPatch->flags |= PATMFL_RECOMPILE_NEXT;
         }
@@ -1691,5 +1692,5 @@
     case OP_STI:
     {
-        RTGCPTR32 pNextInstrGC = 0;   /* by default no inhibit irq */
+        RTRCPTR pNextInstrGC = 0;   /* by default no inhibit irq */
 
         /** In a sequence of instructions that inhibit irqs, only the first one actually inhibits irqs. */
@@ -1699,5 +1700,5 @@
             fInhibitIRQInstr = true;
             pNextInstrGC     = pCurInstrGC + pCpu->opsize;
-            Log(("Inhibit irqs for instruction OP_STI at %VGv\n", pCurInstrGC));
+            Log(("Inhibit irqs for instruction OP_STI at %VRv\n", pCurInstrGC));
         }
         rc = patmPatchGenSti(pVM, pPatch, pCurInstrGC, pNextInstrGC);
@@ -1796,5 +1797,5 @@
 
     case OP_IRET:
-        Log(("IRET at %VGv\n", pCurInstrGC));
+        Log(("IRET at %VRv\n", pCurInstrGC));
         rc = patmPatchGenIret(pVM, pPatch, pCurInstrGC, !!(pCpu->prefix & PREFIX_OPSIZE));
         if (VBOX_SUCCESS(rc))
@@ -1855,5 +1856,5 @@
         if (pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS && pCpu->param1.size == 4 /* no far calls! */)
         {
-            rc = patmPatchGenCall(pVM, pPatch, pCpu, pCurInstrGC, (RTGCPTR32)0xDEADBEEF, true);
+            rc = patmPatchGenCall(pVM, pPatch, pCpu, pCurInstrGC, (RTRCPTR)0xDEADBEEF, true);
             if (VBOX_SUCCESS(rc))
             {
@@ -1931,11 +1932,11 @@
     {
         int     rc2;
-        RTGCPTR32 pNextInstrGC = pCurInstrGC + pCpu->opsize;
+        RTRCPTR pNextInstrGC = pCurInstrGC + pCpu->opsize;
 
         pPatch->flags &= ~PATMFL_INHIBIT_IRQS;
-        Log(("Clear inhibit IRQ flag at %VGv\n", pCurInstrGC));
+        Log(("Clear inhibit IRQ flag at %VRv\n", pCurInstrGC));
         if (pPatch->flags & PATMFL_GENERATE_JUMPTOGUEST)
         {
-            Log(("patmRecompileCallback: generate jump back to guest (%VGv) after fused instruction\n", pNextInstrGC));
+            Log(("patmRecompileCallback: generate jump back to guest (%VRv) after fused instruction\n", pNextInstrGC));
 
             rc2 = patmPatchGenJumpToGuest(pVM, pPatch, pNextInstrGC, true /* clear inhibit irq flag */);
@@ -1960,8 +1961,8 @@
            )
         {
-            RTGCPTR32 pNextInstrGC = pCurInstrGC + pCpu->opsize;
+            RTRCPTR pNextInstrGC = pCurInstrGC + pCpu->opsize;
 
             // The end marker for this kind of patch is any instruction at a location outside our patch jump
-            Log(("patmRecompileCallback: end found for single instruction patch at %VGv opsize %d\n", pNextInstrGC, pCpu->opsize));
+            Log(("patmRecompileCallback: end found for single instruction patch at %VRv opsize %d\n", pNextInstrGC, pCpu->opsize));
 
             rc = patmPatchGenJumpToGuest(pVM, pPatch, pNextInstrGC);
@@ -1982,5 +1983,5 @@
  *
  */
-static void patmPatchAddDisasmJump(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pInstrGC)
+static void patmPatchAddDisasmJump(PVM pVM, PPATCHINFO pPatch, RTRCPTR pInstrGC)
 {
     PAVLPVNODECORE pRec;
@@ -2002,5 +2003,5 @@
  *
  */
-static bool patmIsKnownDisasmJump(PPATCHINFO pPatch, RTGCPTR32 pInstrGC)
+static bool patmIsKnownDisasmJump(PPATCHINFO pPatch, RTRCPTR pInstrGC)
 {
     PAVLPVNODECORE pRec;
@@ -2032,5 +2033,5 @@
         DISCPUSTATE cpu;
         uint8_t    *pOrgJumpHC;
-        RTGCPTR32     pOrgJumpGC;
+        RTRCPTR     pOrgJumpGC;
         uint32_t    dummy;
 
@@ -2110,8 +2111,8 @@
         if (PATMIsPatchGCAddr(pVM, pCurInstrGC))
         {
-            RTGCPTR32 pOrgInstrGC = patmPatchGCPtr2GuestGCPtr(pVM, pPatch, pCurInstrGC);
+            RTRCPTR pOrgInstrGC = patmPatchGCPtr2GuestGCPtr(pVM, pPatch, pCurInstrGC);
 
             if (pOrgInstrGC != pPatch->pTempInfo->pLastDisasmInstrGC)
-                Log(("DIS %VGv<-%s", pOrgInstrGC, szOutput));
+                Log(("DIS %VRv<-%s", pOrgInstrGC, szOutput));
             else
                 Log(("DIS           %s", szOutput));
@@ -2145,6 +2146,6 @@
            )
         {
-            RTGCPTR32 pTargetGC = PATMResolveBranch(&cpu, pCurInstrGC);
-            RTGCPTR32 pOrgTargetGC;
+            RTRCPTR pTargetGC = PATMResolveBranch(&cpu, pCurInstrGC);
+            RTRCPTR pOrgTargetGC;
 
             if (pTargetGC == 0)
@@ -2231,5 +2232,5 @@
  *
  */
-PATMR3DECL(int) PATMR3DetectConflict(PVM pVM, RTGCPTR32 pInstrGC, RTGCPTR32 pConflictGC)
+PATMR3DECL(int) PATMR3DetectConflict(PVM pVM, RTRCPTR pInstrGC, RTRCPTR pConflictGC)
 {
     PPATCHINFO pTargetPatch = PATMFindActivePatchByEntrypoint(pVM, pConflictGC, true /* include patch hints */);
@@ -2268,5 +2269,5 @@
         cpu.mode = (pPatch->flags & PATMFL_CODE32) ? CPUMODE_32BIT : CPUMODE_16BIT;
 
-        ////Log(("patmRecompileCodeStream %VGv %VGv\n", pInstrGC, pCurInstrGC));
+        ////Log(("patmRecompileCodeStream %VRv %VRv\n", pInstrGC, pCurInstrGC));
 
         pCurInstrHC = PATMGCVirtToHCVirt(pVM, pPatch, pCurInstrGC);
@@ -2303,7 +2304,7 @@
                 uint32_t    opsizenext;
                 uint8_t *pNextInstrHC;
-                RTGCPTR32  pNextInstrGC = pCurInstrGC + opsize;
-
-                Log(("patmRecompileCodeStream: irqs inhibited by instruction %VGv\n", pNextInstrGC));
+                RTRCPTR  pNextInstrGC = pCurInstrGC + opsize;
+
+                Log(("patmRecompileCodeStream: irqs inhibited by instruction %VRv\n", pNextInstrGC));
 
                 /* Certain instructions (e.g. sti) force the next instruction to be executed before any interrupts can occur.
@@ -2378,5 +2379,5 @@
             }
 
-            Log(("Jump encountered target %VGv\n", addr));
+            Log(("Jump encountered target %VRv\n", addr));
 
             /* We don't check if the branch target lies in a valid page as we've already done that in the analysis phase. */
@@ -2407,5 +2408,5 @@
                 if(pTargetPatch)
                 {
-                    Log(("Found active patch at target %VGv (%VGv) -> temporarily disabling it!!\n", addr, pTargetPatch->pPrivInstrGC));
+                    Log(("Found active patch at target %VRv (%VRv) -> temporarily disabling it!!\n", addr, pTargetPatch->pPrivInstrGC));
                     PATMR3DisablePatch(pVM, pTargetPatch->pPrivInstrGC);
                 }
@@ -2520,5 +2521,5 @@
         }
         temp[0] = 0xE9;  //jmp
-        *(uint32_t *)&temp[1] = (RTGCUINTPTR32)PATCHCODE_PTR_GC(pPatch) - ((RTGCUINTPTR32)pPatch->pPrivInstrGC + SIZEOF_NEARJUMP32);    //return address
+        *(uint32_t *)&temp[1] = (RTRCUINTPTR)PATCHCODE_PTR_GC(pPatch) - ((RTRCUINTPTR)pPatch->pPrivInstrGC + SIZEOF_NEARJUMP32);    //return address
     }
     rc = PGMPhysWriteGCPtrDirty(pVM, pPatch->pPrivInstrGC, temp, pPatch->cbPatchJump);
@@ -2593,5 +2594,5 @@
  * @param   pPatch      Patch record
  */
-static int patmGenCallToPatch(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pTargetGC, bool fAddFixup = true)
+static int patmGenCallToPatch(PVM pVM, PPATCHINFO pPatch, RTRCPTR pTargetGC, bool fAddFixup = true)
 {
     uint8_t  temp[8];
@@ -2640,5 +2641,5 @@
  *
  */
-PATMR3DECL(int) PATMR3PatchBlock(PVM pVM, RTGCPTR32 pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC,
+PATMR3DECL(int) PATMR3PatchBlock(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC,
                                  uint32_t uOpcode, uint32_t uOpSize, PPATMPATCHREC pPatchRec)
 {
@@ -2647,5 +2648,5 @@
     DISCPUSTATE cpu;
     uint32_t orgOffsetPatchMem = ~0;
-    RTGCPTR32 pInstrStart;
+    RTRCPTR pInstrStart;
 #ifdef LOG_ENABLED
     uint32_t opsize;
@@ -2758,7 +2759,7 @@
      * Insert into patch to guest lookup tree
      */
-    LogFlow(("Insert %VGv patch offset %VGv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
+    LogFlow(("Insert %VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
     pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
-    rc = RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
+    rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
     AssertMsg(rc, ("RTAvlULInsert failed for %x\n", pPatchRec->CoreOffset.Key));
     if (!rc)
@@ -2792,5 +2793,5 @@
         /*uint8_t ASMInt3 = 0xCC; - unused */
 
-        Log(("PATMR3PatchBlock %VGv -> int 3 callable patch.\n", pPatch->pPrivInstrGC));
+        Log(("PATMR3PatchBlock %VRv -> int 3 callable patch.\n", pPatch->pPrivInstrGC));
         /* Replace first opcode byte with 'int 3'. */
         rc = patmActivateInt3Patch(pVM, pPatch);
@@ -2825,5 +2826,5 @@
     pPatch->pTempInfo->nrIllegalInstr = 0;
 
-    Log(("Successfully installed %s patch at %VGv\n", patmGetInstructionString(pPatch->opcode, pPatch->flags), pInstrGC));
+    Log(("Successfully installed %s patch at %VRv\n", patmGetInstructionString(pPatch->opcode, pPatch->flags), pInstrGC));
 
     pPatch->uState = PATCH_ENABLED;
@@ -2832,5 +2833,5 @@
 failure:
     if (pPatchRec->CoreOffset.Key)
-        RTAvloGCPtrRemove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchRec->CoreOffset.Key);
+        RTAvloU32Remove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchRec->CoreOffset.Key);
 
     patmEmptyTree(pVM, &pPatch->FixupTree);
@@ -2867,5 +2868,5 @@
  *
  */
-static int patmIdtHandler(PVM pVM, RTGCPTR32 pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC,
+static int patmIdtHandler(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC,
                           uint32_t uOpSize, PPATMPATCHREC pPatchRec)
 {
@@ -2874,5 +2875,5 @@
     DISCPUSTATE cpuPush, cpuJmp;
     uint32_t opsize;
-    RTGCPTR32  pCurInstrGC = pInstrGC;
+    RTRCPTR  pCurInstrGC = pInstrGC;
     uint8_t *pCurInstrHC = pInstrHC;
     uint32_t orgOffsetPatchMem = ~0;
@@ -2888,5 +2889,5 @@
     if (disret && cpuPush.pCurInstr->opcode == OP_PUSH)
     {
-        RTGCPTR32  pJmpInstrGC;
+        RTRCPTR  pJmpInstrGC;
         int      rc;
 
@@ -2901,5 +2902,5 @@
            )
         {
-            PPATMPATCHREC pJmpPatch = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pJmpInstrGC);
+            PPATMPATCHREC pJmpPatch = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pJmpInstrGC);
             if (pJmpPatch == 0)
             {
@@ -2908,5 +2909,5 @@
                 if (rc != VINF_SUCCESS)
                     goto failure;
-                pJmpPatch = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pJmpInstrGC);
+                pJmpPatch = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pJmpInstrGC);
                 Assert(pJmpPatch);
             }
@@ -2962,12 +2963,12 @@
             Log(("Patch code ends -----------------------------------------------------\n"));
 #endif
-            Log(("Successfully installed IDT handler patch at %VGv\n", pInstrGC));
+            Log(("Successfully installed IDT handler patch at %VRv\n", pInstrGC));
 
             /*
              * Insert into patch to guest lookup tree
              */
-            LogFlow(("Insert %VGv patch offset %VGv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
+            LogFlow(("Insert %VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
             pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
-            rc = RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
+            rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
             AssertMsg(rc, ("RTAvlULInsert failed for %x\n", pPatchRec->CoreOffset.Key));
 
@@ -2994,5 +2995,5 @@
  *
  */
-static int patmInstallTrapTrampoline(PVM pVM, RTGCPTR32 pInstrGC, PPATMPATCHREC pPatchRec)
+static int patmInstallTrapTrampoline(PVM pVM, RTRCPTR pInstrGC, PPATMPATCHREC pPatchRec)
 {
     PPATCHINFO pPatch = &pPatchRec->patch;
@@ -3045,12 +3046,12 @@
     Log(("TRAP handler patch: %s", szOutput));
 #endif
-    Log(("Successfully installed Trap Trampoline patch at %VGv\n", pInstrGC));
+    Log(("Successfully installed Trap Trampoline patch at %VRv\n", pInstrGC));
 
     /*
      * Insert into patch to guest lookup tree
      */
-    LogFlow(("Insert %VGv patch offset %VGv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
+    LogFlow(("Insert %VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
     pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
-    rc = RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
+    rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
     AssertMsg(rc, ("RTAvlULInsert failed for %x\n", pPatchRec->CoreOffset.Key));
 
@@ -3082,9 +3083,9 @@
  *
  */
-static bool patmIsCommonIDTHandlerPatch(PVM pVM, RTGCPTR32 pInstrGC)
+static bool patmIsCommonIDTHandlerPatch(PVM pVM, RTRCPTR pInstrGC)
 {
     PPATMPATCHREC pRec;
 
-    pRec = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
+    pRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
     if (pRec && pRec->patch.flags & PATMFL_IDTHANDLER_WITHOUT_ENTRYPOINT)
         return true;
@@ -3103,5 +3104,5 @@
  *
  */
-static int patmDuplicateFunction(PVM pVM, RTGCPTR32 pInstrGC, PPATMPATCHREC pPatchRec)
+static int patmDuplicateFunction(PVM pVM, RTRCPTR pInstrGC, PPATMPATCHREC pPatchRec)
 {
     PPATCHINFO pPatch = &pPatchRec->patch;
@@ -3110,5 +3111,5 @@
     uint32_t orgOffsetPatchMem = ~0;
 
-    Log(("patmDuplicateFunction %VGv\n", pInstrGC));
+    Log(("patmDuplicateFunction %VRv\n", pInstrGC));
     /* Save original offset (in case of failures later on). */
     orgOffsetPatchMem = pVM->patm.s.offPatchMem;
@@ -3165,8 +3166,8 @@
      * Insert into patch to guest lookup tree
      */
-    LogFlow(("Insert %VGv patch offset %VGv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
+    LogFlow(("Insert %VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
     pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
-    rc = RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
-    AssertMsg(rc, ("RTAvloGCPtrInsert failed for %x\n", pPatchRec->CoreOffset.Key));
+    rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
+    AssertMsg(rc, ("RTAvloU32Insert failed for %x\n", pPatchRec->CoreOffset.Key));
     if (!rc)
     {
@@ -3189,5 +3190,5 @@
 #endif
 
-    Log(("Successfully installed function duplication patch at %VGv\n", pInstrGC));
+    Log(("Successfully installed function duplication patch at %VRv\n", pInstrGC));
 
     patmEmptyTree(pVM, &pPatch->pTempInfo->IllegalInstrTree);
@@ -3200,5 +3201,5 @@
 failure:
     if (pPatchRec->CoreOffset.Key)
-        RTAvloGCPtrRemove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchRec->CoreOffset.Key);
+        RTAvloU32Remove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchRec->CoreOffset.Key);
 
     patmEmptyTree(pVM, &pPatch->FixupTree);
@@ -3220,5 +3221,5 @@
 
     pVM->patm.s.ulCallDepth--;
-    Log(("patmDupicateFunction %VGv failed!!\n", pInstrGC));
+    Log(("patmDupicateFunction %VRv failed!!\n", pInstrGC));
     return rc;
 }
@@ -3233,12 +3234,12 @@
  *
  */
-static int patmCreateTrampoline(PVM pVM, RTGCPTR32 pInstrGC, PPATMPATCHREC pPatchRec)
+static int patmCreateTrampoline(PVM pVM, RTRCPTR pInstrGC, PPATMPATCHREC pPatchRec)
 {
     PPATCHINFO  pPatch = &pPatchRec->patch;
-    RTGCPTR32     pPage, pPatchTargetGC = 0;
+    RTRCPTR     pPage, pPatchTargetGC = 0;
     uint32_t    orgOffsetPatchMem = ~0;
     int         rc = VERR_PATCHING_REFUSED;
 
-    Log(("patmCreateTrampoline %VGv\n", pInstrGC));
+    Log(("patmCreateTrampoline %VRv\n", pInstrGC));
     /* Save original offset (in case of failures later on). */
     orgOffsetPatchMem = pVM->patm.s.offPatchMem;
@@ -3248,5 +3249,5 @@
     pPage = pInstrGC & PAGE_BASE_GC_MASK;
 
-    PPATMPATCHPAGE pPatchPage = (PPATMPATCHPAGE)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, (RTGCPTR32)pPage);
+    PPATMPATCHPAGE pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, (RTRCPTR)pPage);
     if (pPatchPage)
     {
@@ -3271,5 +3272,5 @@
                         pPatchToGuestRec->fJumpTarget = true;
                         Assert(pPatchTargetGC != pPatch->pPrivInstrGC);
-                        Log(("patmCreateTrampoline: generating jump to code inside patch at %VGv\n", pPatch->pPrivInstrGC));
+                        Log(("patmCreateTrampoline: generating jump to code inside patch at %VRv\n", pPatch->pPrivInstrGC));
                         pPatch->flags |= PATMFL_EXTERNAL_JUMP_INSIDE;
                         break;
@@ -3303,8 +3304,8 @@
      * Insert into patch to guest lookup tree
      */
-    LogFlow(("Insert %VGv patch offset %VGv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
+    LogFlow(("Insert %VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));
     pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
-    rc = RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
-    AssertMsg(rc, ("RTAvloGCPtrInsert failed for %x\n", pPatchRec->CoreOffset.Key));
+    rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
+    AssertMsg(rc, ("RTAvloU32Insert failed for %x\n", pPatchRec->CoreOffset.Key));
     if (!rc)
     {
@@ -3333,5 +3334,5 @@
 failure:
     if (pPatchRec->CoreOffset.Key)
-        RTAvloGCPtrRemove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchRec->CoreOffset.Key);
+        RTAvloU32Remove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchRec->CoreOffset.Key);
 
     patmEmptyTree(pVM, &pPatch->FixupTree);
@@ -3367,7 +3368,7 @@
 PATMR3DECL(int) PATMR3DuplicateFunctionRequest(PVM pVM, PCPUMCTX pCtx)
 {
-    RTGCPTR32     pBranchTarget, pPage;
+    RTRCPTR     pBranchTarget, pPage;
     int         rc;
-    RTGCPTR32     pPatchTargetGC = 0;
+    RTRCPTR     pPatchTargetGC = 0;
 
     pBranchTarget = pCtx->edx;
@@ -3377,5 +3378,5 @@
     pPage = pBranchTarget & PAGE_BASE_GC_MASK;
 
-    PPATMPATCHPAGE pPatchPage = (PPATMPATCHPAGE)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, (RTGCPTR32)pPage);
+    PPATMPATCHPAGE pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, (RTRCPTR)pPage);
     if (pPatchPage)
     {
@@ -3421,5 +3422,5 @@
     {
         pCtx->eax = pPatchTargetGC;
-        pCtx->eax = pCtx->eax - (RTGCUINTPTR32)pVM->patm.s.pPatchMemGC;   /* make it relative */
+        pCtx->eax = pCtx->eax - (RTRCUINTPTR)pVM->patm.s.pPatchMemGC;   /* make it relative */
     }
     else
@@ -3448,9 +3449,9 @@
  *
  */
-static int patmReplaceFunctionCall(PVM pVM, DISCPUSTATE *pCpu, RTGCPTR32 pInstrGC, PPATCHINFO pPatch)
+static int patmReplaceFunctionCall(PVM pVM, DISCPUSTATE *pCpu, RTRCPTR pInstrGC, PPATCHINFO pPatch)
 {
     int           rc = VERR_PATCHING_REFUSED;
     DISCPUSTATE   cpu;
-    RTGCPTR32       pTargetGC;
+    RTRCPTR       pTargetGC;
     PPATMPATCHREC pPatchFunction;
     uint32_t      opsize;
@@ -3477,5 +3478,5 @@
     }
 
-    pPatchFunction = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pTargetGC);
+    pPatchFunction = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pTargetGC);
     if (pPatchFunction == NULL)
     {
@@ -3503,10 +3504,10 @@
             }
 
-            pPatchFunction = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pTargetGC);
+            pPatchFunction = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pTargetGC);
             break;
         }
         if (pPatchFunction == 0)
         {
-            AssertMsgFailed(("Unable to find duplicate function %VGv\n", pTargetGC));
+            AssertMsgFailed(("Unable to find duplicate function %VRv\n", pTargetGC));
             rc = VERR_PATCHING_REFUSED;
             goto failure;
@@ -3536,5 +3537,5 @@
 #endif
 
-    Log(("Successfully installed function replacement patch at %VGv\n", pInstrGC));
+    Log(("Successfully installed function replacement patch at %VRv\n", pInstrGC));
 
     pPatch->uState = PATCH_ENABLED;
@@ -3560,5 +3561,5 @@
  *
  */
-static int patmPatchMMIOInstr(PVM pVM, RTGCPTR32 pInstrGC, DISCPUSTATE *pCpu, PPATCHINFO pPatch)
+static int patmPatchMMIOInstr(PVM pVM, RTRCPTR pInstrGC, DISCPUSTATE *pCpu, PPATCHINFO pPatch)
 {
     uint8_t *pPB;
@@ -3581,5 +3582,5 @@
 
     /* Add relocation record for cached data access. */
-    if (patmPatchAddReloc32(pVM, pPatch, &pPB[pCpu->opsize - sizeof(RTGCPTR32)], FIXUP_ABSOLUTE, pPatch->pPrivInstrGC, pVM->patm.s.mmio.pCachedData) != VINF_SUCCESS)
+    if (patmPatchAddReloc32(pVM, pPatch, &pPB[pCpu->opsize - sizeof(RTRCPTR)], FIXUP_ABSOLUTE, pPatch->pPrivInstrGC, pVM->patm.s.mmio.pCachedData) != VINF_SUCCESS)
     {
         Log(("Relocation failed for cached mmio address!!\n"));
@@ -3599,5 +3600,5 @@
 
     /* Replace address with that of the cached item. */
-    rc = PGMPhysWriteGCPtrDirty(pVM, pInstrGC + pCpu->opsize - sizeof(RTGCPTR32), &pVM->patm.s.mmio.pCachedData, sizeof(RTGCPTR32));
+    rc = PGMPhysWriteGCPtrDirty(pVM, pInstrGC + pCpu->opsize - sizeof(RTRCPTR), &pVM->patm.s.mmio.pCachedData, sizeof(RTRCPTR));
     AssertRC(rc);
     if (VBOX_FAILURE(rc))
@@ -3635,5 +3636,5 @@
  *
  */
-static int patmPatchPATMMMIOInstr(PVM pVM, RTGCPTR32 pInstrGC, PPATCHINFO pPatch)
+static int patmPatchPATMMMIOInstr(PVM pVM, RTRCPTR pInstrGC, PPATCHINFO pPatch)
 {
     DISCPUSTATE   cpu;
@@ -3667,5 +3668,5 @@
 
     /* Add relocation record for cached data access. */
-    if (patmPatchAddReloc32(pVM, pPatch, &pInstrHC[cpu.opsize - sizeof(RTGCPTR32)], FIXUP_ABSOLUTE) != VINF_SUCCESS)
+    if (patmPatchAddReloc32(pVM, pPatch, &pInstrHC[cpu.opsize - sizeof(RTRCPTR)], FIXUP_ABSOLUTE) != VINF_SUCCESS)
     {
         Log(("Relocation failed for cached mmio address!!\n"));
@@ -3673,5 +3674,5 @@
     }
     /* Replace address with that of the cached item. */
-    *(RTGCPTR32 *)&pInstrHC[cpu.opsize - sizeof(RTGCPTR32)] = pVM->patm.s.mmio.pCachedData;
+    *(RTRCPTR *)&pInstrHC[cpu.opsize - sizeof(RTRCPTR)] = pVM->patm.s.mmio.pCachedData;
 
     /* Lowest and highest address for write monitoring. */
@@ -3748,5 +3749,5 @@
  *
  */
-PATMR3DECL(int) PATMR3PatchInstrInt3(PVM pVM, RTGCPTR32 pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATCHINFO pPatch)
+PATMR3DECL(int) PATMR3PatchInstrInt3(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATCHINFO pPatch)
 {
     uint8_t ASMInt3 = 0xCC;
@@ -3803,5 +3804,5 @@
  *
  */
-int patmPatchJump(PVM pVM, RTGCPTR32 pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATMPATCHREC pPatchRec)
+int patmPatchJump(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATMPATCHREC pPatchRec)
 {
     PPATCHINFO pPatch = &pPatchRec->patch;
@@ -3878,7 +3879,7 @@
      * references the target instruction in the conflict patch.
      */
-    RTGCPTR32 pJmpDest = PATMR3GuestGCPtrToPatchGCPtr(pVM, pInstrGC + pCpu->opsize + (int32_t)pCpu->param1.parval);
-
-    AssertMsg(pJmpDest, ("PATMR3GuestGCPtrToPatchGCPtr failed for %VGv\n", pInstrGC + pCpu->opsize + (int32_t)pCpu->param1.parval));
+    RTRCPTR pJmpDest = PATMR3GuestGCPtrToPatchGCPtr(pVM, pInstrGC + pCpu->opsize + (int32_t)pCpu->param1.parval);
+
+    AssertMsg(pJmpDest, ("PATMR3GuestGCPtrToPatchGCPtr failed for %VRv\n", pInstrGC + pCpu->opsize + (int32_t)pCpu->param1.parval));
     pPatch->pPatchJumpDestGC = pJmpDest;
 
@@ -3896,5 +3897,5 @@
 #endif
 
-    Log(("Successfully installed %s patch at %VGv\n", patmGetInstructionString(pPatch->opcode, pPatch->flags), pInstrGC));
+    Log(("Successfully installed %s patch at %VRv\n", patmGetInstructionString(pPatch->opcode, pPatch->flags), pInstrGC));
 
     STAM_COUNTER_INC(&pVM->patm.s.StatInstalledJump);
@@ -3924,10 +3925,10 @@
  * @param   flags       Patch flags
  */
-PATMR3DECL(int) PATMR3AddHint(PVM pVM, RTGCPTR32 pInstrGC, uint32_t flags)
+PATMR3DECL(int) PATMR3AddHint(PVM pVM, RTRCPTR pInstrGC, uint32_t flags)
 {
     Assert(pInstrGC);
     Assert(flags == PATMFL_CODE32);
 
-    Log(("PATMR3AddHint %VGv\n", pInstrGC));
+    Log(("PATMR3AddHint %VRv\n", pInstrGC));
     return PATMR3InstallPatch(pVM, pInstrGC, PATMFL_CODE32 | PATMFL_INSTR_HINT);
 }
@@ -3943,5 +3944,5 @@
  * @note    returns failure if patching is not allowed or possible
  */
-PATMR3DECL(int) PATMR3InstallPatch(PVM pVM, RTGCPTR32 pInstrGC, uint64_t flags)
+PATMR3DECL(int) PATMR3InstallPatch(PVM pVM, RTRCPTR pInstrGC, uint64_t flags)
 {
     DISCPUSTATE cpu;
@@ -3966,5 +3967,5 @@
     {
         PPATCHINFO pConflictPatch = PATMFindActivePatchByEntrypoint(pVM, pInstrGC);
-        AssertReleaseMsg(pConflictPatch == 0, ("Unable to patch overwritten instruction at %VGv (%VGv)\n", pInstrGC, pConflictPatch->pPrivInstrGC));
+        AssertReleaseMsg(pConflictPatch == 0, ("Unable to patch overwritten instruction at %VRv (%VRv)\n", pInstrGC, pConflictPatch->pPrivInstrGC));
         if (pConflictPatch != 0)
             return VERR_PATCHING_REFUSED;
@@ -3986,8 +3987,8 @@
     if (CPUMGetGuestCPL(pVM, CPUMCTX2CORE(pCtx)) == 0)
     {
-        RTGCPTR32 pInstrGCFlat = SELMToFlat(pVM, pCtx->eflags, pCtx->cs, &pCtx->csHid, pInstrGC);
+        RTRCPTR pInstrGCFlat = SELMToFlat(pVM, pCtx->eflags, pCtx->cs, &pCtx->csHid, pInstrGC);
         if (pInstrGCFlat != pInstrGC)
         {
-            Log(("PATMR3InstallPatch: code selector not wide open: %04x:%VGv != %VGv eflags=%08x\n", pCtx->cs, pInstrGCFlat, pInstrGC, pCtx->eflags.u32));
+            Log(("PATMR3InstallPatch: code selector not wide open: %04x:%VRv != %VRv eflags=%08x\n", pCtx->cs, pInstrGCFlat, pInstrGC, pCtx->eflags.u32));
             return VERR_PATCHING_REFUSED;
         }
@@ -4005,13 +4006,13 @@
         && (flags & PATMFL_MMIO_ACCESS))
     {
-        RTGCUINTPTR32 offset;
+        RTRCUINTPTR offset;
         void         *pvPatchCoreOffset;
 
         /* Find the patch record. */
         offset = pInstrGC - pVM->patm.s.pPatchMemGC;
-        pvPatchCoreOffset = RTAvloGCPtrGetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, offset, false);
+        pvPatchCoreOffset = RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, offset, false);
         if (pvPatchCoreOffset == NULL)
         {
-            AssertMsgFailed(("PATMR3InstallPatch: patch not found at address %VGv!!\n", pInstrGC));
+            AssertMsgFailed(("PATMR3InstallPatch: patch not found at address %VRv!!\n", pInstrGC));
             return VERR_PATCH_NOT_FOUND;    //fatal error
         }
@@ -4023,5 +4024,5 @@
     AssertReturn(!PATMIsPatchGCAddr(pVM, pInstrGC), VERR_PATCHING_REFUSED);
 
-    pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
+    pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
     if (pPatchRec)
     {
@@ -4034,5 +4035,5 @@
         if (pPatchRec->patch.uState == PATCH_DISABLE_PENDING)
         {
-            Log(("PATMR3InstallPatch: disable operation is pending for patch at %VGv\n", pPatchRec->patch.pPrivInstrGC));
+            Log(("PATMR3InstallPatch: disable operation is pending for patch at %VRv\n", pPatchRec->patch.pPrivInstrGC));
             PATMR3DisablePatch(pVM, pPatchRec->patch.pPrivInstrGC);
             Assert(pPatchRec->patch.uState == PATCH_DISABLED);
@@ -4044,9 +4045,9 @@
             if (pPatchRec->patch.flags & PATMFL_INSTR_HINT)
             {
-                Log(("Enabling HINTED patch %VGv\n", pInstrGC));
+                Log(("Enabling HINTED patch %VRv\n", pInstrGC));
                 pPatchRec->patch.flags &= ~PATMFL_INSTR_HINT;
             }
             else
-                Log(("Enabling patch %VGv again\n", pInstrGC));
+                Log(("Enabling patch %VRv again\n", pInstrGC));
 
             /** @todo we shouldn't disable and enable patches too often (it's relatively cheap, but pointless if it always happens) */
@@ -4067,5 +4068,5 @@
             {
                 /* Patch must have been overwritten; remove it and pretend nothing happened. */
-                Log(("Patch an existing patched instruction?!? (%VGv)\n", pInstrGC));
+                Log(("Patch an existing patched instruction?!? (%VRv)\n", pInstrGC));
                 if (pPatchRec->patch.flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_IDTHANDLER|PATMFL_MMIO_ACCESS|PATMFL_INT3_REPLACEMENT|PATMFL_INT3_REPLACEMENT_BLOCK))
                 {
@@ -4080,5 +4081,5 @@
         else
         {
-            AssertMsg(pPatchRec->patch.uState == PATCH_REFUSED || pPatchRec->patch.uState == PATCH_UNUSABLE, ("Patch an existing patched instruction?!? (%VGv, state=%d)\n", pInstrGC, pPatchRec->patch.uState));
+            AssertMsg(pPatchRec->patch.uState == PATCH_REFUSED || pPatchRec->patch.uState == PATCH_UNUSABLE, ("Patch an existing patched instruction?!? (%VRv, state=%d)\n", pInstrGC, pPatchRec->patch.uState));
             /* already tried it once! */
             return VERR_PATCHING_REFUSED;
@@ -4094,5 +4095,5 @@
     pPatchRec->Core.Key = pInstrGC;
     pPatchRec->patch.uState = PATCH_REFUSED;   //default
-    rc = RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pPatchRec->Core);
+    rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pPatchRec->Core);
     Assert(rc);
 
@@ -4128,10 +4129,10 @@
          * Close proximity to an unusable patch is a possible hint that this patch would turn out to be dangerous too!
          */
-        PPATMPATCHREC pPatchNear = (PPATMPATCHREC)RTAvloGCPtrGetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, (pInstrGC + SIZEOF_NEARJUMP32 - 1), false);
+        PPATMPATCHREC pPatchNear = (PPATMPATCHREC)RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, (pInstrGC + SIZEOF_NEARJUMP32 - 1), false);
         if (pPatchNear)
         {
             if (pPatchNear->patch.uState == PATCH_UNUSABLE && pInstrGC < pPatchNear->patch.pPrivInstrGC && pInstrGC + SIZEOF_NEARJUMP32 > pPatchNear->patch.pPrivInstrGC)
             {
-                Log(("Dangerous patch; would overwrite the ususable patch at %VGv\n", pPatchNear->patch.pPrivInstrGC));
+                Log(("Dangerous patch; would overwrite the ususable patch at %VRv\n", pPatchNear->patch.pPrivInstrGC));
 
                 pPatchRec->patch.uState = PATCH_UNUSABLE;
@@ -4237,5 +4238,5 @@
             {
                 if (rc == VINF_SUCCESS)
-                    Log(("PATMR3InstallPatch GUEST: %s %VGv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0));
+                    Log(("PATMR3InstallPatch GUEST: %s %VRv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0));
                 return rc;
             }
@@ -4255,5 +4256,5 @@
             if (rc == VINF_SUCCESS)
             {
-                Log(("PATMR3InstallPatch GUEST: %s %VGv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0));
+                Log(("PATMR3InstallPatch GUEST: %s %VRv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0));
                 return VINF_SUCCESS;
             }
@@ -4292,5 +4293,5 @@
         case OP_PUSHF:
         case OP_CLI:
-            Log(("PATMR3InstallPatch %s %VGv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0));
+            Log(("PATMR3InstallPatch %s %VRv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0));
             rc = PATMR3PatchBlock(pVM, pInstrGC, pInstrHC, cpu.pCurInstr->opcode, opsize, pPatchRec);
             break;
@@ -4335,6 +4336,6 @@
             pVM->patm.s.pPatchedInstrGCHighest = pPatchRec->patch.pInstrGCHighest;
 
-        Log(("Patch  lowest %VGv highest %VGv\n", pPatchRec->patch.pInstrGCLowest, pPatchRec->patch.pInstrGCHighest));
-        Log(("Global lowest %VGv highest %VGv\n", pVM->patm.s.pPatchedInstrGCLowest, pVM->patm.s.pPatchedInstrGCHighest));
+        Log(("Patch  lowest %VRv highest %VRv\n", pPatchRec->patch.pInstrGCLowest, pPatchRec->patch.pInstrGCHighest));
+        Log(("Global lowest %VRv highest %VRv\n", pVM->patm.s.pPatchedInstrGCLowest, pVM->patm.s.pPatchedInstrGCHighest));
 
         STAM_COUNTER_ADD(&pVM->patm.s.StatInstalled, 1);
@@ -4355,23 +4356,23 @@
         {
             STAMR3RegisterCallback(pVM, &pPatchRec->patch, STAMVISIBILITY_NOT_GUI, STAMUNIT_GOOD_BAD, patmResetStat, patmPrintStat, "Patch statistics",
-                                   "/PATM/Stats/Patch/0x%VGv", pPatchRec->patch.pPrivInstrGC);
+                                   "/PATM/Stats/Patch/0x%VRv", pPatchRec->patch.pPrivInstrGC);
 #ifndef DEBUG_sandervl
             /* Full breakdown for the GUI. */
             STAMR3RegisterF(pVM, &pVM->patm.s.pStatsHC[pPatchRec->patch.uPatchIdx], STAMTYPE_RATIO_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_GOOD_BAD, PATMPatchType(pVM, &pPatchRec->patch),
-                            "/PATM/Stats/PatchBD/0x%VGv", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.cbPatchBlockSize,STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,      NULL, "/PATM/Stats/PatchBD/0x%VGv/cbPatchBlockSize", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.cbPatchJump,     STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,      NULL, "/PATM/Stats/PatchBD/0x%VGv/cbPatchJump", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.cbPrivInstr,     STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,      NULL, "/PATM/Stats/PatchBD/0x%VGv/cbPrivInstr", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.cCodeWrites,     STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VGv/cCodeWrites", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.cInvalidWrites,  STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VGv/cInvalidWrites", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.cTraps,          STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VGv/cTraps", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.flags,           STAMTYPE_X32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,       NULL, "/PATM/Stats/PatchBD/0x%VGv/flags", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.nrJumpRecs,      STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VGv/nrJumpRecs", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.nrFixups,        STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VGv/nrFixups", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.opcode,          STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VGv/opcode", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.uOldState,       STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,       NULL, "/PATM/Stats/PatchBD/0x%VGv/uOldState", pPatchRec->patch.pPrivInstrGC);
-            STAMR3RegisterF(pVM, &pPatchRec->patch.uOpMode,         STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,       NULL, "/PATM/Stats/PatchBD/0x%VGv/uOpMode", pPatchRec->patch.pPrivInstrGC);
+                            "/PATM/Stats/PatchBD/0x%VRv", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.cbPatchBlockSize,STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,      NULL, "/PATM/Stats/PatchBD/0x%VRv/cbPatchBlockSize", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.cbPatchJump,     STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,      NULL, "/PATM/Stats/PatchBD/0x%VRv/cbPatchJump", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.cbPrivInstr,     STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,      NULL, "/PATM/Stats/PatchBD/0x%VRv/cbPrivInstr", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.cCodeWrites,     STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VRv/cCodeWrites", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.cInvalidWrites,  STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VRv/cInvalidWrites", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.cTraps,          STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VRv/cTraps", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.flags,           STAMTYPE_X32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,       NULL, "/PATM/Stats/PatchBD/0x%VRv/flags", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.nrJumpRecs,      STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VRv/nrJumpRecs", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.nrFixups,        STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VRv/nrFixups", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.opcode,          STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%VRv/opcode", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.uOldState,       STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,       NULL, "/PATM/Stats/PatchBD/0x%VRv/uOldState", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.uOpMode,         STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,       NULL, "/PATM/Stats/PatchBD/0x%VRv/uOpMode", pPatchRec->patch.pPrivInstrGC);
             /// @todo change the state to be a callback so we can get a state mnemonic instead.
-            STAMR3RegisterF(pVM, &pPatchRec->patch.uState,          STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,       NULL, "/PATM/Stats/PatchBD/0x%VGv/uState", pPatchRec->patch.pPrivInstrGC);
+            STAMR3RegisterF(pVM, &pPatchRec->patch.uState,          STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE,       NULL, "/PATM/Stats/PatchBD/0x%VRv/uState", pPatchRec->patch.pPrivInstrGC);
 #endif
         }
@@ -4389,5 +4390,5 @@
  * @param   pInstrGC    Instruction address
  */
-static uint32_t patmGetInstrSize(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pInstrGC)
+static uint32_t patmGetInstrSize(PVM pVM, PPATCHINFO pPatch, RTRCPTR pInstrGC)
 {
     uint8_t *pInstrHC;
@@ -4416,12 +4417,12 @@
  * @param   pPatch      Patch record
  */
-int patmAddPatchToPage(PVM pVM, RTGCUINTPTR32 pPage, PPATCHINFO pPatch)
+int patmAddPatchToPage(PVM pVM, RTRCUINTPTR pPage, PPATCHINFO pPatch)
 {
     PPATMPATCHPAGE pPatchPage;
     int            rc;
 
-    Log(("patmAddPatchToPage: insert patch %VHv to page %VGv\n", pPatch, pPage));
-
-    pPatchPage = (PPATMPATCHPAGE)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, pPage);
+    Log(("patmAddPatchToPage: insert patch %VHv to page %VRv\n", pPatch, pPage));
+
+    pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, pPage);
     if (pPatchPage)
     {
@@ -4466,5 +4467,5 @@
         pPatchPage->aPatch[0] = pPatch;
 
-        rc = RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, &pPatchPage->Core);
+        rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, &pPatchPage->Core);
         Assert(rc);
         pVM->patm.s.cPageRecords++;
@@ -4475,15 +4476,15 @@
 
     /* Get the closest guest instruction (from below) */
-    PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage, true);
+    PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlU32GetBestFit(&pPatch->Guest2PatchAddrTree, pPage, true);
     Assert(pGuestToPatchRec);
     if (pGuestToPatchRec)
     {
-        LogFlow(("patmAddPatchToPage: lowest patch page address %VGv current lowest %VGv\n", pGuestToPatchRec->Core.Key, pPatchPage->pLowestAddrGC));
+        LogFlow(("patmAddPatchToPage: lowest patch page address %VRv current lowest %VRv\n", pGuestToPatchRec->Core.Key, pPatchPage->pLowestAddrGC));
         if (    pPatchPage->pLowestAddrGC == 0
-            ||  pPatchPage->pLowestAddrGC > (RTGCPTR32)pGuestToPatchRec->Core.Key)
-        {
-            RTGCUINTPTR32 offset;
-
-            pPatchPage->pLowestAddrGC = (RTGCPTR32)pGuestToPatchRec->Core.Key;
+            ||  pPatchPage->pLowestAddrGC > (RTRCPTR)pGuestToPatchRec->Core.Key)
+        {
+            RTRCUINTPTR offset;
+
+            pPatchPage->pLowestAddrGC = (RTRCPTR)pGuestToPatchRec->Core.Key;
 
             offset = pPatchPage->pLowestAddrGC & PAGE_OFFSET_MASK;
@@ -4492,13 +4493,13 @@
             {
                 /* Get the closest guest instruction (from above) */
-                pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage-1, false);
+                pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlU32GetBestFit(&pPatch->Guest2PatchAddrTree, pPage-1, false);
 
                 if (pGuestToPatchRec)
                 {
-                    uint32_t size = patmGetInstrSize(pVM, pPatch, (RTGCPTR32)pGuestToPatchRec->Core.Key);
-                    if ((RTGCUINTPTR32)pGuestToPatchRec->Core.Key + size  > pPage)
+                    uint32_t size = patmGetInstrSize(pVM, pPatch, (RTRCPTR)pGuestToPatchRec->Core.Key);
+                    if ((RTRCUINTPTR)pGuestToPatchRec->Core.Key + size  > pPage)
                     {
                         pPatchPage->pLowestAddrGC = pPage;
-                        LogFlow(("patmAddPatchToPage: new lowest %VGv\n", pPatchPage->pLowestAddrGC));
+                        LogFlow(("patmAddPatchToPage: new lowest %VRv\n", pPatchPage->pLowestAddrGC));
                     }
                 }
@@ -4508,18 +4509,18 @@
 
     /* Get the closest guest instruction (from above) */
-    pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage+PAGE_SIZE-1, false);
+    pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlU32GetBestFit(&pPatch->Guest2PatchAddrTree, pPage+PAGE_SIZE-1, false);
     Assert(pGuestToPatchRec);
     if (pGuestToPatchRec)
     {
-        LogFlow(("patmAddPatchToPage: highest patch page address %VGv current lowest %VGv\n", pGuestToPatchRec->Core.Key, pPatchPage->pHighestAddrGC));
+        LogFlow(("patmAddPatchToPage: highest patch page address %VRv current lowest %VRv\n", pGuestToPatchRec->Core.Key, pPatchPage->pHighestAddrGC));
         if (    pPatchPage->pHighestAddrGC == 0
-            ||  pPatchPage->pHighestAddrGC <= (RTGCPTR32)pGuestToPatchRec->Core.Key)
-        {
-            pPatchPage->pHighestAddrGC = (RTGCPTR32)pGuestToPatchRec->Core.Key;
+            ||  pPatchPage->pHighestAddrGC <= (RTRCPTR)pGuestToPatchRec->Core.Key)
+        {
+            pPatchPage->pHighestAddrGC = (RTRCPTR)pGuestToPatchRec->Core.Key;
             /* Increase by instruction size. */
             uint32_t size = patmGetInstrSize(pVM, pPatch, pPatchPage->pHighestAddrGC);
 ////            Assert(size);
             pPatchPage->pHighestAddrGC += size;
-            LogFlow(("patmAddPatchToPage: new highest %VGv\n", pPatchPage->pHighestAddrGC));
+            LogFlow(("patmAddPatchToPage: new highest %VRv\n", pPatchPage->pHighestAddrGC));
         }
     }
@@ -4536,10 +4537,10 @@
  * @param   pPatch      Patch record
  */
-int patmRemovePatchFromPage(PVM pVM, RTGCUINTPTR32 pPage, PPATCHINFO pPatch)
+int patmRemovePatchFromPage(PVM pVM, RTRCUINTPTR pPage, PPATCHINFO pPatch)
 {
     PPATMPATCHPAGE pPatchPage;
     int            rc;
 
-    pPatchPage = (PPATMPATCHPAGE)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, pPage);
+    pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, pPage);
     Assert(pPatchPage);
 
@@ -4549,5 +4550,5 @@
     Assert(pPatchPage->cCount <= pPatchPage->cMaxPatches);
 
-    Log(("patmRemovePatchPage: remove patch %VHv from page %VGv\n", pPatch, pPage));
+    Log(("patmRemovePatchPage: remove patch %VHv from page %VRv\n", pPatch, pPage));
     if (pPatchPage->cCount > 1)
     {
@@ -4568,5 +4569,5 @@
             memcpy(&pPatchPage->aPatch[i], &pPatchPage->aPatch[i+1], sizeof(PPATCHINFO)*(pPatchPage->cCount - (i+1)));
         }
-        AssertMsg(i < pPatchPage->cCount, ("Unable to find patch %VHv in page %VGv\n", pPatch, pPage));
+        AssertMsg(i < pPatchPage->cCount, ("Unable to find patch %VHv in page %VRv\n", pPatch, pPage));
 
         pPatchPage->cCount--;
@@ -4576,8 +4577,8 @@
         PPATMPATCHPAGE pPatchNode;
 
-        Log(("patmRemovePatchFromPage %VGv\n", pPage));
+        Log(("patmRemovePatchFromPage %VRv\n", pPage));
 
         STAM_COUNTER_INC(&pVM->patm.s.StatPatchPageRemoved);
-        pPatchNode = (PPATMPATCHPAGE)RTAvloGCPtrRemove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, pPage);
+        pPatchNode = (PPATMPATCHPAGE)RTAvloU32Remove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, pPage);
         Assert(pPatchNode && pPatchNode == pPatchPage);
 
@@ -4602,9 +4603,9 @@
 {
     int           rc;
-    RTGCUINTPTR32 pPatchPageStart, pPatchPageEnd, pPage;
+    RTRCUINTPTR pPatchPageStart, pPatchPageEnd, pPage;
 
     /* Insert the pages that contain patched instructions into a lookup tree for detecting self-modifying code. */
-    pPatchPageStart = (RTGCUINTPTR32)pPatch->pInstrGCLowest  & PAGE_BASE_GC_MASK;
-    pPatchPageEnd   = (RTGCUINTPTR32)pPatch->pInstrGCHighest & PAGE_BASE_GC_MASK;
+    pPatchPageStart = (RTRCUINTPTR)pPatch->pInstrGCLowest  & PAGE_BASE_GC_MASK;
+    pPatchPageEnd   = (RTRCUINTPTR)pPatch->pInstrGCHighest & PAGE_BASE_GC_MASK;
 
     /** @todo optimize better (large gaps between current and next used page) */
@@ -4612,5 +4613,5 @@
     {
         /* Get the closest guest instruction (from above) */
-        PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage, true);
+        PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlU32GetBestFit(&pPatch->Guest2PatchAddrTree, pPage, true);
         if (    pGuestToPatchRec
             &&  PAGE_ADDRESS(pGuestToPatchRec->Core.Key) == PAGE_ADDRESS(pPage)
@@ -4636,14 +4637,14 @@
 {
     int         rc;
-    RTGCUINTPTR32 pPatchPageStart, pPatchPageEnd, pPage;
+    RTRCUINTPTR pPatchPageStart, pPatchPageEnd, pPage;
 
     /* Insert the pages that contain patched instructions into a lookup tree for detecting self-modifying code. */
-    pPatchPageStart = (RTGCUINTPTR32)pPatch->pInstrGCLowest  & PAGE_BASE_GC_MASK;
-    pPatchPageEnd   = (RTGCUINTPTR32)pPatch->pInstrGCHighest & PAGE_BASE_GC_MASK;
+    pPatchPageStart = (RTRCUINTPTR)pPatch->pInstrGCLowest  & PAGE_BASE_GC_MASK;
+    pPatchPageEnd   = (RTRCUINTPTR)pPatch->pInstrGCHighest & PAGE_BASE_GC_MASK;
 
     for(pPage = pPatchPageStart; pPage <= pPatchPageEnd; pPage += PAGE_SIZE)
     {
         /* Get the closest guest instruction (from above) */
-        PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pPage, true);
+        PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlU32GetBestFit(&pPatch->Guest2PatchAddrTree, pPage, true);
         if (    pGuestToPatchRec
             &&  PAGE_ADDRESS(pGuestToPatchRec->Core.Key) == PAGE_ADDRESS(pPage) /** @todo bird: PAGE_ADDRESS is for the current context really. check out these. */
@@ -4668,9 +4669,9 @@
  *
  */
-PATMR3DECL(int) PATMR3PatchWrite(PVM pVM, RTGCPTR32 GCPtr, uint32_t cbWrite)
-{
-    RTGCUINTPTR32          pWritePageStart, pWritePageEnd, pPage;
-
-    Log(("PATMR3PatchWrite %VGv %x\n", GCPtr, cbWrite));
+PATMR3DECL(int) PATMR3PatchWrite(PVM pVM, RTRCPTR GCPtr, uint32_t cbWrite)
+{
+    RTRCUINTPTR          pWritePageStart, pWritePageEnd, pPage;
+
+    Log(("PATMR3PatchWrite %VRv %x\n", GCPtr, cbWrite));
 
     Assert(VM_IS_EMT(pVM));
@@ -4684,11 +4685,11 @@
     STAM_PROFILE_ADV_START(&pVM->patm.s.StatPatchWrite, a);
 
-    pWritePageStart =  (RTGCUINTPTR32)GCPtr & PAGE_BASE_GC_MASK;
-    pWritePageEnd   = ((RTGCUINTPTR32)GCPtr + cbWrite - 1) & PAGE_BASE_GC_MASK;
+    pWritePageStart =  (RTRCUINTPTR)GCPtr & PAGE_BASE_GC_MASK;
+    pWritePageEnd   = ((RTRCUINTPTR)GCPtr + cbWrite - 1) & PAGE_BASE_GC_MASK;
 
     for (pPage = pWritePageStart; pPage <= pWritePageEnd; pPage += PAGE_SIZE)
     {
 loop_start:
-        PPATMPATCHPAGE pPatchPage = (PPATMPATCHPAGE)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, (RTGCPTR32)pPage);
+        PPATMPATCHPAGE pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, (RTRCPTR)pPage);
         if (pPatchPage)
         {
@@ -4697,5 +4698,5 @@
 
             /* Quick check to see if the write is in the patched part of the page */
-            if (    pPatchPage->pLowestAddrGC  > (RTGCPTR32)((RTGCUINTPTR32)GCPtr + cbWrite - 1)
+            if (    pPatchPage->pLowestAddrGC  > (RTRCPTR)((RTRCUINTPTR)GCPtr + cbWrite - 1)
                 ||  pPatchPage->pHighestAddrGC < GCPtr)
             {
@@ -4708,5 +4709,5 @@
                 {
                     PPATCHINFO pPatch = pPatchPage->aPatch[i];
-                    RTGCPTR32 pPatchInstrGC;
+                    RTRCPTR pPatchInstrGC;
                     //unused: bool    fForceBreak = false;
 
@@ -4715,5 +4716,5 @@
                     for (uint32_t j=0; j<cbWrite; j++)
                     {
-                        RTGCPTR32 pGuestPtrGC = (RTGCPTR32)((RTGCUINTPTR32)GCPtr + j);
+                        RTRCPTR pGuestPtrGC = (RTRCPTR)((RTRCUINTPTR)GCPtr + j);
 
                         if (    pPatch->cbPatchJump
@@ -4734,5 +4735,5 @@
                         if (!pPatchInstrGC)
                         {
-                            RTGCPTR32  pClosestInstrGC;
+                            RTRCPTR  pClosestInstrGC;
                             uint32_t size;
 
@@ -4758,9 +4759,9 @@
                             if (pPatchToGuestRec && !pPatchToGuestRec->fDirty)
                             {
-                                Log(("PATMR3PatchWrite: Found patched instruction %VGv -> %VGv\n", pGuestPtrGC, pPatchInstrGC));
+                                Log(("PATMR3PatchWrite: Found patched instruction %VRv -> %VRv\n", pGuestPtrGC, pPatchInstrGC));
 
                                 if (++pPatch->cCodeWrites > PATM_MAX_CODE_WRITES)
                                 {
-                                    LogRel(("PATM: Disable block at %VGv - write %VGv-%VGv\n", pPatch->pPrivInstrGC, pGuestPtrGC, pGuestPtrGC+cbWrite));
+                                    LogRel(("PATM: Disable block at %VRv - write %VRv-%VRv\n", pPatch->pPrivInstrGC, pGuestPtrGC, pGuestPtrGC+cbWrite));
 
                                     PATMR3MarkDirtyPatch(pVM, pPatch);
@@ -4795,5 +4796,5 @@
                  */
 invalid_write_loop_start:
-                pPatchPage = (PPATMPATCHPAGE)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, (RTGCPTR32)pPage);
+                pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, (RTRCPTR)pPage);
 
                 if (pPatchPage)
@@ -4808,5 +4809,5 @@
                             if (pPatch->flags & PATMFL_IDTHANDLER)
                             {
-                                LogRel(("PATM: Stop monitoring IDT handler pages at %VGv - invalid write %VGv-%VGv (this is not a fatal error)\n", pPatch->pPrivInstrGC, GCPtr, GCPtr+cbWrite));
+                                LogRel(("PATM: Stop monitoring IDT handler pages at %VRv - invalid write %VRv-%VRv (this is not a fatal error)\n", pPatch->pPrivInstrGC, GCPtr, GCPtr+cbWrite));
 
                                 Assert(pPatch->flags & PATMFL_CODE_MONITORED);
@@ -4816,5 +4817,5 @@
                             else
                             {
-                                LogRel(("PATM: Disable block at %VGv - invalid write %VGv-%VGv \n", pPatch->pPrivInstrGC, GCPtr, GCPtr+cbWrite));
+                                LogRel(("PATM: Disable block at %VRv - invalid write %VRv-%VRv \n", pPatch->pPrivInstrGC, GCPtr, GCPtr+cbWrite));
                                 PATMR3MarkDirtyPatch(pVM, pPatch);
                             }
@@ -4841,9 +4842,9 @@
 /** @note Currently only called by CSAMR3FlushPage; optimization to avoid having to double check if the physical address has changed
  */
-PATMR3DECL(int) PATMR3FlushPage(PVM pVM, RTGCPTR32 addr)
+PATMR3DECL(int) PATMR3FlushPage(PVM pVM, RTRCPTR addr)
 {
     addr &= PAGE_BASE_GC_MASK;
 
-    PPATMPATCHPAGE pPatchPage = (PPATMPATCHPAGE)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, addr);
+    PPATMPATCHPAGE pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, addr);
     if (pPatchPage)
     {
@@ -4857,5 +4858,5 @@
                 PPATCHINFO pPatch = pPatchPage->aPatch[i];
 
-                Log(("PATMR3FlushPage %VGv remove patch at %VGv\n", addr, pPatch->pPrivInstrGC));
+                Log(("PATMR3FlushPage %VRv remove patch at %VRv\n", addr, pPatch->pPrivInstrGC));
                 PATMR3MarkDirtyPatch(pVM, pPatch);
             }
@@ -4873,8 +4874,8 @@
  * @param   pInstrGC    Guest context pointer to instruction
  */
-PATMR3DECL(bool) PATMR3HasBeenPatched(PVM pVM, RTGCPTR32 pInstrGC)
+PATMR3DECL(bool) PATMR3HasBeenPatched(PVM pVM, RTRCPTR pInstrGC)
 {
     PPATMPATCHREC pPatchRec;
-    pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
+    pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
     if (pPatchRec && pPatchRec->patch.uState == PATCH_ENABLED)
         return true;
@@ -4891,5 +4892,5 @@
  *
  */
-PATMR3DECL(int) PATMR3QueryOpcode(PVM pVM, RTGCPTR32 pInstrGC, uint8_t *pByte)
+PATMR3DECL(int) PATMR3QueryOpcode(PVM pVM, RTRCPTR pInstrGC, uint8_t *pByte)
 {
     PPATMPATCHREC pPatchRec;
@@ -4905,5 +4906,5 @@
     }
 
-    pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC, false);
+    pPatchRec = (PPATMPATCHREC)RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC, false);
     // if the patch is enabled and the pointer lies within 5 bytes of this priv instr ptr, then we've got a hit!
     if (    pPatchRec
@@ -4912,10 +4913,10 @@
         &&  pInstrGC < pPatchRec->patch.pPrivInstrGC + pPatchRec->patch.cbPatchJump)
     {
-        RTGCPTR32 offset = pInstrGC - pPatchRec->patch.pPrivInstrGC;
+        RTRCPTR offset = pInstrGC - pPatchRec->patch.pPrivInstrGC;
         *pByte = pPatchRec->patch.aPrivInstr[offset];
 
         if (pPatchRec->patch.cbPatchJump == 1)
         {
-            Log(("PATMR3QueryOpcode: returning opcode %2X for instruction at %VGv\n", *pByte, pInstrGC));
+            Log(("PATMR3QueryOpcode: returning opcode %2X for instruction at %VRv\n", *pByte, pInstrGC));
         }
         STAM_COUNTER_ADD(&pVM->patm.s.StatNrOpcodeRead, 1);
@@ -4935,11 +4936,11 @@
  *
  */
-PATMR3DECL(int) PATMR3DisablePatch(PVM pVM, RTGCPTR32 pInstrGC)
+PATMR3DECL(int) PATMR3DisablePatch(PVM pVM, RTRCPTR pInstrGC)
 {
     PPATMPATCHREC pPatchRec;
     PPATCHINFO    pPatch;
 
-    Log(("PATMR3DisablePatch: %VGv\n", pInstrGC));
-    pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
+    Log(("PATMR3DisablePatch: %VRv\n", pInstrGC));
+    pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
     if (pPatchRec)
     {
@@ -4963,5 +4964,5 @@
             {
                 TRPMR3SetGuestTrapHandler(pVM, iGate, TRPM_INVALID_HANDLER);
-                LogRel(("PATM: Disabling IDT %x patch handler %VGv\n", iGate, pInstrGC));
+                LogRel(("PATM: Disabling IDT %x patch handler %VRv\n", iGate, pInstrGC));
             }
         }
@@ -4971,5 +4972,5 @@
             &&  pPatch->uState == PATCH_ENABLED)
         {
-            Log(("Invalidate patch at %VGv (HC=%VGv)\n", PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_HC(pPatch)));
+            Log(("Invalidate patch at %VRv (HC=%VRv)\n", PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_HC(pPatch)));
             pPatch->bDirtyOpcode   = *PATCHCODE_PTR_HC(pPatch);
             *PATCHCODE_PTR_HC(pPatch) = 0xCC;
@@ -4984,5 +4985,5 @@
             if (pPatch->uState != PATCH_REFUSED)
             {
-                AssertMsg(pPatch->pPrivInstrHC, ("Invalid HC pointer?!? (%VGv)\n", pInstrGC));
+                AssertMsg(pPatch->pPrivInstrHC, ("Invalid HC pointer?!? (%VRv)\n", pInstrGC));
                 Assert(pPatch->cbPatchJump);
 
@@ -5000,8 +5001,8 @@
                     if (rc == VINF_SUCCESS)
                     {
-                        RTGCINTPTR displ = (RTGCUINTPTR32)PATCHCODE_PTR_GC(pPatch) - ((RTGCUINTPTR32)pPatch->pPrivInstrGC + SIZEOF_NEARJUMP32);
+                        RTRCINTPTR displ = (RTRCUINTPTR)PATCHCODE_PTR_GC(pPatch) - ((RTRCUINTPTR)pPatch->pPrivInstrGC + SIZEOF_NEARJUMP32);
 
                         if (    temp[0] != 0xE9 /* jmp opcode */
-                            ||  *(RTGCINTPTR *)(&temp[1]) != displ
+                            ||  *(RTRCINTPTR *)(&temp[1]) != displ
                            )
                         {
@@ -5073,5 +5074,5 @@
         }
 
-        Log(("PATMR3DisablePatch: disabled patch at %VGv\n", pInstrGC));
+        Log(("PATMR3DisablePatch: disabled patch at %VRv\n", pInstrGC));
         return VINF_SUCCESS;
     }
@@ -5090,5 +5091,5 @@
  *
  */
-static int patmDisableUnusablePatch(PVM pVM, RTGCPTR32 pInstrGC, RTGCPTR32 pConflictAddr, PPATCHINFO pConflictPatch)
+static int patmDisableUnusablePatch(PVM pVM, RTRCPTR pInstrGC, RTRCPTR pConflictAddr, PPATCHINFO pConflictPatch)
 {
 #ifdef PATM_RESOLVE_CONFLICTS_WITH_JUMP_PATCHES
@@ -5116,5 +5117,5 @@
         if (pConflictPatch->flags & PATMFL_INSTR_HINT)
         {
-            Log(("Enabling HINTED patch %VGv\n", pConflictPatch->pPrivInstrGC));
+            Log(("Enabling HINTED patch %VRv\n", pConflictPatch->pPrivInstrGC));
             pConflictPatch->flags &= ~PATMFL_INSTR_HINT;
             rc = PATMR3EnablePatch(pVM, pConflictPatch->pPrivInstrGC);
@@ -5128,5 +5129,5 @@
         if (VBOX_SUCCESS(rc))
         {
-            Log(("PATM -> CONFLICT: Installed JMP patch for patch conflict at %VGv\n", pInstrGC));
+            Log(("PATM -> CONFLICT: Installed JMP patch for patch conflict at %VRv\n", pInstrGC));
             STAM_COUNTER_INC(&pVM->patm.s.StatFixedConflicts);
             return VINF_SUCCESS;
@@ -5138,5 +5139,5 @@
     {
         /* Turn it into an int3 patch; our GC trap handler will call the generated code manually. */
-        Log(("PATM -> CONFLICT: Found active patch at instruction %VGv with target %VGv -> turn into int 3 patch!!\n", pInstrGC, pConflictPatch->pPrivInstrGC));
+        Log(("PATM -> CONFLICT: Found active patch at instruction %VRv with target %VRv -> turn into int 3 patch!!\n", pInstrGC, pConflictPatch->pPrivInstrGC));
         int rc =  PATMR3DisablePatch(pVM, pConflictPatch->pPrivInstrGC);
         if (rc == VWRN_PATCH_REMOVED)
@@ -5161,5 +5162,5 @@
     else
     {
-        Log(("PATM -> CONFLICT: Found active patch at instruction %VGv with target %VGv -> DISABLING it!!\n", pInstrGC, pConflictPatch->pPrivInstrGC));
+        Log(("PATM -> CONFLICT: Found active patch at instruction %VRv with target %VRv -> DISABLING it!!\n", pInstrGC, pConflictPatch->pPrivInstrGC));
         int rc = PATMR3DisablePatch(pVM, pConflictPatch->pPrivInstrGC);
         if (rc == VWRN_PATCH_REMOVED)
@@ -5188,11 +5189,11 @@
  *
  */
-PATMR3DECL(int) PATMR3EnablePatch(PVM pVM, RTGCPTR32 pInstrGC)
+PATMR3DECL(int) PATMR3EnablePatch(PVM pVM, RTRCPTR pInstrGC)
 {
     PPATMPATCHREC pPatchRec;
     PPATCHINFO    pPatch;
 
-    Log(("PATMR3EnablePatch %VGv\n", pInstrGC));
-    pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
+    Log(("PATMR3EnablePatch %VRv\n", pInstrGC));
+    pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
     if (pPatchRec)
     {
@@ -5285,5 +5286,5 @@
         }
         else
-            Log(("PATMR3EnablePatch: Unable to enable patch %VGv with state %d\n", pInstrGC, pPatch->uState));
+            Log(("PATMR3EnablePatch: Unable to enable patch %VRv with state %d\n", pInstrGC, pPatch->uState));
 
         return rc;
@@ -5314,7 +5315,7 @@
     if (pPatchRec->patch.pPatchBlockOffset)
     {
-        PAVLOGCPTRNODECORE pNode;
-
-        pNode = RTAvloGCPtrRemove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchRec->patch.pPatchBlockOffset);
+        PAVLOU32NODECORE pNode;
+
+        pNode = RTAvloU32Remove(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchRec->patch.pPatchBlockOffset);
         Assert(pNode);
     }
@@ -5362,5 +5363,5 @@
 
     /** @note might fail, because it has already been removed (e.g. during reset). */
-    RTAvloGCPtrRemove(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pPatchRec->Core.Key);
+    RTAvloU32Remove(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pPatchRec->Core.Key);
 
     /* Free the patch record */
@@ -5380,7 +5381,7 @@
     PPATCHINFO  pPatch;
     int         rc;
-    RTGCPTR32     pInstrGC = pPatchRec->patch.pPrivInstrGC;
-
-    Log(("patmR3RefreshPatch: attempt to refresh patch at %VGv\n", pInstrGC));
+    RTRCPTR     pInstrGC = pPatchRec->patch.pPrivInstrGC;
+
+    Log(("patmR3RefreshPatch: attempt to refresh patch at %VRv\n", pInstrGC));
 
     pPatch = &pPatchRec->patch;
@@ -5398,5 +5399,5 @@
 
     /** Kick it out of the lookup tree to make sure PATMR3InstallPatch doesn't fail (hack alert) */
-    RTAvloGCPtrRemove(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pPatchRec->Core.Key);
+    RTAvloU32Remove(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pPatchRec->Core.Key);
 #ifdef VBOX_WITH_STATISTICS
     if (PATM_STAT_INDEX_IS_VALID(pPatchRec->patch.uPatchIdx))
@@ -5428,5 +5429,5 @@
     if (VBOX_SUCCESS(rc))
     {
-        RTGCPTR32         pPatchTargetGC;
+        RTRCPTR         pPatchTargetGC;
         PPATMPATCHREC   pNewPatchRec;
 
@@ -5448,5 +5449,5 @@
             goto failure;
 
-        pNewPatchRec = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
+        pNewPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
         Assert(pNewPatchRec); /* can't fail */
 
@@ -5456,7 +5457,7 @@
 
         /* Put the new patch back into the tree, because removing the old one kicked this one out. (hack alert) */
-        RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pNewPatchRec->Core);
-
-        LogRel(("PATM: patmR3RefreshPatch: succeeded to refresh patch at %VGv \n", pInstrGC));
+        RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pNewPatchRec->Core);
+
+        LogRel(("PATM: patmR3RefreshPatch: succeeded to refresh patch at %VRv \n", pInstrGC));
         STAM_COUNTER_INC(&pVM->patm.s.StatPatchRefreshSuccess);
     }
@@ -5465,5 +5466,5 @@
     if (VBOX_FAILURE(rc))
     {
-        LogRel(("PATM: patmR3RefreshPatch: failed to refresh patch at %VGv. Reactiving old one. \n", pInstrGC));
+        LogRel(("PATM: patmR3RefreshPatch: failed to refresh patch at %VRv. Reactiving old one. \n", pInstrGC));
 
         /* Remove the new inactive patch */
@@ -5472,5 +5473,5 @@
 
         /* Put the old patch back into the tree (or else it won't be saved) (hack alert) */
-        RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pPatchRec->Core);
+        RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pPatchRec->Core);
 
         /* Enable again in case the dirty instruction is near the end and there are safe code paths. */
@@ -5492,7 +5493,7 @@
  *
  */
-PPATCHINFO PATMFindActivePatchByEntrypoint(PVM pVM, RTGCPTR32 pInstrGC, bool fIncludeHints)
-{
-    PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC, false);
+PPATCHINFO PATMFindActivePatchByEntrypoint(PVM pVM, RTRCPTR pInstrGC, bool fIncludeHints)
+{
+    PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC, false);
     /* if the patch is enabled, the pointer is not indentical to the privileged patch ptr and it lies within 5 bytes of this priv instr ptr, then we've got a hit! */
     if (pPatchRec)
@@ -5503,5 +5504,5 @@
             &&  pInstrGC < pPatchRec->patch.pPrivInstrGC + pPatchRec->patch.cbPatchJump)
         {
-            Log(("Found active patch at %VGv (org %VGv)\n", pInstrGC, pPatchRec->patch.pPrivInstrGC));
+            Log(("Found active patch at %VRv (org %VRv)\n", pInstrGC, pPatchRec->patch.pPrivInstrGC));
             return &pPatchRec->patch;
         }
@@ -5513,5 +5514,5 @@
             &&  pInstrGC < pPatchRec->patch.pPrivInstrGC + pPatchRec->patch.cbPatchJump)
         {
-            Log(("Found HINT patch at %VGv (org %VGv)\n", pInstrGC, pPatchRec->patch.pPrivInstrGC));
+            Log(("Found HINT patch at %VRv (org %VRv)\n", pInstrGC, pPatchRec->patch.pPrivInstrGC));
             return &pPatchRec->patch;
         }
@@ -5528,7 +5529,7 @@
  * @param   pPatchAddr  Guest context patch address (if true)
  */
-PATMR3DECL(bool) PATMR3IsInsidePatchJump(PVM pVM, RTGCPTR32 pAddr, PRTGCPTR32 pPatchAddr)
-{
-    RTGCPTR32 addr;
+PATMR3DECL(bool) PATMR3IsInsidePatchJump(PVM pVM, RTRCPTR pAddr, PRTGCPTR32 pPatchAddr)
+{
+    RTRCPTR addr;
     PPATCHINFO pPatch;
 
@@ -5559,9 +5560,9 @@
  *
  */
-PATMR3DECL(int) PATMR3RemovePatch(PVM pVM, RTGCPTR32 pInstrGC)
+PATMR3DECL(int) PATMR3RemovePatch(PVM pVM, RTRCPTR pInstrGC)
 {
     PPATMPATCHREC pPatchRec;
 
-    pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
+    pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
     if (pPatchRec)
     {
@@ -5589,5 +5590,5 @@
     if (pPatch->pPatchBlockOffset)
     {
-        Log(("Invalidate patch at %VGv (HC=%VGv)\n", PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_HC(pPatch)));
+        Log(("Invalidate patch at %VRv (HC=%VRv)\n", PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_HC(pPatch)));
         pPatch->bDirtyOpcode   = *PATCHCODE_PTR_HC(pPatch);
         *PATCHCODE_PTR_HC(pPatch) = 0xCC;
@@ -5625,5 +5626,5 @@
  * @param   pPatchGC    GC address in patch block
  */
-RTGCPTR32 patmPatchGCPtr2GuestGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t *) pPatchGC)
+RTRCPTR patmPatchGCPtr2GuestGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t *) pPatchGC)
 {
     Assert(pPatch->Patch2GuestAddrTree);
@@ -5644,9 +5645,9 @@
  *
  */
-RTGCPTR32 patmGuestGCPtrToPatchGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t*) pInstrGC)
+RTRCPTR patmGuestGCPtrToPatchGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t*) pInstrGC)
 {
     if (pPatch->Guest2PatchAddrTree)
     {
-        PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGet(&pPatch->Guest2PatchAddrTree, pInstrGC);
+        PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlU32Get(&pPatch->Guest2PatchAddrTree, pInstrGC);
         if (pGuestToPatchRec)
             return pVM->patm.s.pPatchMemGC + pGuestToPatchRec->PatchOffset;
@@ -5664,7 +5665,7 @@
  *
  */
-RTGCPTR32 patmGuestGCPtrToClosestPatchGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t*) pInstrGC)
-{
-        PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlGCPtrGetBestFit(&pPatch->Guest2PatchAddrTree, pInstrGC, false);
+RTRCPTR patmGuestGCPtrToClosestPatchGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t*) pInstrGC)
+{
+        PRECGUESTTOPATCH pGuestToPatchRec = (PRECGUESTTOPATCH)RTAvlU32GetBestFit(&pPatch->Guest2PatchAddrTree, pInstrGC, false);
         if (pGuestToPatchRec)
             return pVM->patm.s.pPatchMemGC + pGuestToPatchRec->PatchOffset;
@@ -5680,7 +5681,7 @@
  *
  */
-PATMR3DECL(RTGCPTR32) PATMR3GuestGCPtrToPatchGCPtr(PVM pVM, RCPTRTYPE(uint8_t*) pInstrGC)
-{
-    PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC, false);
+PATMR3DECL(RTRCPTR) PATMR3GuestGCPtrToPatchGCPtr(PVM pVM, RCPTRTYPE(uint8_t*) pInstrGC)
+{
+    PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC, false);
     if (pPatchRec && pPatchRec->patch.uState == PATCH_ENABLED && pInstrGC >= pPatchRec->patch.pPrivInstrGC)
     {
@@ -5699,15 +5700,15 @@
  *
  */
-PATMR3DECL(RTGCPTR32) PATMR3PatchToGCPtr(PVM pVM, RTGCPTR32 pPatchGC, PATMTRANSSTATE *pEnmState)
+PATMR3DECL(RTRCPTR) PATMR3PatchToGCPtr(PVM pVM, RTRCPTR pPatchGC, PATMTRANSSTATE *pEnmState)
 {
     PPATMPATCHREC pPatchRec;
     void         *pvPatchCoreOffset;
-    RTGCPTR32       pPrivInstrGC;
+    RTRCPTR       pPrivInstrGC;
 
     Assert(PATMIsPatchGCAddr(pVM, pPatchGC));
-    pvPatchCoreOffset = RTAvloGCPtrGetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchGC - pVM->patm.s.pPatchMemGC, false);
+    pvPatchCoreOffset = RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, pPatchGC - pVM->patm.s.pPatchMemGC, false);
     if (pvPatchCoreOffset == 0)
     {
-        Log(("PATMR3PatchToGCPtr failed for %VGv offset %x\n", pPatchGC, pPatchGC - pVM->patm.s.pPatchMemGC));
+        Log(("PATMR3PatchToGCPtr failed for %VRv offset %x\n", pPatchGC, pPatchGC - pVM->patm.s.pPatchMemGC));
         return 0;
     }
@@ -5720,5 +5721,5 @@
                                     ||  pPatchRec->patch.uState == PATCH_DISABLE_PENDING
                                     ||  pPatchRec->patch.uState == PATCH_UNUSABLE),
-                  ("pPrivInstrGC=%VGv uState=%d\n", pPrivInstrGC, pPatchRec->patch.uState));
+                  ("pPrivInstrGC=%VRv uState=%d\n", pPrivInstrGC, pPatchRec->patch.uState));
 
         if (    !pPrivInstrGC
@@ -5765,10 +5766,10 @@
  * @param   pAddrGC     Guest context address
  */
-PATMR3DECL(RTGCPTR32) PATMR3QueryPatchGCPtr(PVM pVM, RTGCPTR32 pAddrGC)
+PATMR3DECL(RTRCPTR) PATMR3QueryPatchGCPtr(PVM pVM, RTRCPTR pAddrGC)
 {
     PPATMPATCHREC pPatchRec;
 
     // Find the patch record
-    pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGet(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pAddrGC);
+    pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pAddrGC);
     /** @todo we should only use patches that are enabled! always did this, but it's incorrect! */
     if (pPatchRec && (pPatchRec->patch.uState == PATCH_ENABLED || pPatchRec->patch.uState == PATCH_DIRTY))
@@ -5788,14 +5789,14 @@
  * @param   pEip        GC pointer of trapping instruction
  */
-static int patmR3HandleDirtyInstr(PVM pVM, PCPUMCTX pCtx, PPATMPATCHREC pPatch, PRECPATCHTOGUEST pPatchToGuestRec, RTGCPTR32 pEip)
+static int patmR3HandleDirtyInstr(PVM pVM, PCPUMCTX pCtx, PPATMPATCHREC pPatch, PRECPATCHTOGUEST pPatchToGuestRec, RTRCPTR pEip)
 {
     DISCPUSTATE  CpuOld, CpuNew;
     uint8_t     *pPatchInstrHC, *pCurPatchInstrHC;
     int          rc;
-    RTGCPTR32      pCurInstrGC, pCurPatchInstrGC;
+    RTRCPTR      pCurInstrGC, pCurPatchInstrGC;
     uint32_t     cbDirty;
     PRECPATCHTOGUEST pRec;
 
-    Log(("patmR3HandleDirtyInstr: dirty instruction at %VGv (%VGv)\n", pEip, pPatchToGuestRec->pOrgInstrGC));
+    Log(("patmR3HandleDirtyInstr: dirty instruction at %VRv (%VRv)\n", pEip, pPatchToGuestRec->pOrgInstrGC));
 
     pRec             = pPatchToGuestRec;
@@ -5810,5 +5811,5 @@
         if (pRec->fJumpTarget)
         {
-            LogRel(("PATM: patmR3HandleDirtyInstr: dirty instruction at %VGv (%VGv) ignored, because instruction in function was reused as target of jump\n", pEip, pPatchToGuestRec->pOrgInstrGC));
+            LogRel(("PATM: patmR3HandleDirtyInstr: dirty instruction at %VRv (%VRv) ignored, because instruction in function was reused as target of jump\n", pEip, pPatchToGuestRec->pOrgInstrGC));
             pRec->fDirty = false;
             return VERR_PATCHING_REFUSED;
@@ -5867,5 +5868,5 @@
                )
             {
-                RTGCPTR32 pTargetGC = PATMResolveBranch(&CpuNew, pCurInstrGC);
+                RTRCPTR pTargetGC = PATMResolveBranch(&CpuNew, pCurInstrGC);
 
                 if (    pTargetGC >= pPatchToGuestRec->pOrgInstrGC
@@ -5938,5 +5939,5 @@
             if (VBOX_FAILURE(rc))
             {
-                LogRel(("PATM: Failed to refresh dirty patch at %VGv. Disabling it.\n", pPatch->patch.pPrivInstrGC));
+                LogRel(("PATM: Failed to refresh dirty patch at %VRv. Disabling it.\n", pPatch->patch.pPrivInstrGC));
             }
             /* Even if we succeed, we must go back to the original instruction as the patched one could be invalid. */
@@ -5956,10 +5957,10 @@
  * @param   ppNewEip    GC pointer to new instruction
  */
-PATMR3DECL(int) PATMR3HandleTrap(PVM pVM, PCPUMCTX pCtx, RTGCPTR32 pEip, RTGCPTR *ppNewEip)
+PATMR3DECL(int) PATMR3HandleTrap(PVM pVM, PCPUMCTX pCtx, RTRCPTR pEip, RTGCPTR *ppNewEip)
 {
     PPATMPATCHREC    pPatch = 0;
     void            *pvPatchCoreOffset;
-    RTGCUINTPTR32      offset;
-    RTGCPTR32          pNewEip;
+    RTRCUINTPTR      offset;
+    RTRCPTR          pNewEip;
     int              rc ;
     PRECPATCHTOGUEST pPatchToGuestRec = 0;
@@ -5973,5 +5974,5 @@
     /** @note there might not be a patch to guest translation record (global function) */
     offset = pEip - pVM->patm.s.pPatchMemGC;
-    pvPatchCoreOffset = RTAvloGCPtrGetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, offset, false);
+    pvPatchCoreOffset = RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, offset, false);
     if (pvPatchCoreOffset)
     {
@@ -5980,5 +5981,5 @@
         if (pPatch->patch.uState == PATCH_DIRTY)
         {
-            Log(("PATMR3HandleTrap: trap in dirty patch at %VGv\n", pEip));
+            Log(("PATMR3HandleTrap: trap in dirty patch at %VRv\n", pEip));
             if (pPatch->patch.flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_CALLABLE_AS_FUNCTION))
             {
@@ -5990,5 +5991,5 @@
         if (pPatch->patch.uState == PATCH_DISABLED)
         {
-            Log(("PATMR3HandleTrap: trap in disabled patch at %VGv\n", pEip));
+            Log(("PATMR3HandleTrap: trap in disabled patch at %VRv\n", pEip));
             if (pPatch->patch.flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_CALLABLE_AS_FUNCTION))
             {
@@ -6000,14 +6001,14 @@
         if (pPatch->patch.uState == PATCH_DISABLE_PENDING)
         {
-            RTGCPTR32 pPrivInstrGC = pPatch->patch.pPrivInstrGC;
-
-            Log(("PATMR3HandleTrap: disable operation is pending for patch at %VGv\n", pPatch->patch.pPrivInstrGC));
+            RTRCPTR pPrivInstrGC = pPatch->patch.pPrivInstrGC;
+
+            Log(("PATMR3HandleTrap: disable operation is pending for patch at %VRv\n", pPatch->patch.pPrivInstrGC));
             rc = PATMR3DisablePatch(pVM, pPatch->patch.pPrivInstrGC);
-            AssertReleaseMsg(rc != VWRN_PATCH_REMOVED, ("PATMR3DisablePatch removed patch at %VGv\n", pPrivInstrGC));
+            AssertReleaseMsg(rc != VWRN_PATCH_REMOVED, ("PATMR3DisablePatch removed patch at %VRv\n", pPrivInstrGC));
             AssertMsg(pPatch->patch.uState == PATCH_DISABLED || pPatch->patch.uState == PATCH_UNUSABLE, ("Unexpected failure to disable patch state=%d rc=%Vrc\n", pPatch->patch.uState, rc));
         }
 
         pPatchToGuestRec = (PRECPATCHTOGUEST)RTAvlU32GetBestFit(&pPatch->patch.Patch2GuestAddrTree, offset, false);
-        AssertReleaseMsg(pPatchToGuestRec, ("PATMR3HandleTrap: Unable to find corresponding guest address for %VGv (offset %x)\n", pEip, offset));
+        AssertReleaseMsg(pPatchToGuestRec, ("PATMR3HandleTrap: Unable to find corresponding guest address for %VRv (offset %x)\n", pEip, offset));
 
         pNewEip = pPatchToGuestRec->pOrgInstrGC;
@@ -6016,5 +6017,5 @@
     }
     else
-        AssertReleaseMsg(pVM->patm.s.pGCStateHC->fPIF == 0, ("PATMR3HandleTrap: Unable to find translation record for %VGv (PIF=0)\n", pEip));
+        AssertReleaseMsg(pVM->patm.s.pGCStateHC->fPIF == 0, ("PATMR3HandleTrap: Unable to find translation record for %VRv (PIF=0)\n", pEip));
 
     /* Check if we were interrupted in PATM generated instruction code. */
@@ -6081,9 +6082,9 @@
         {
             AssertReleaseMsg(pVM->patm.s.pGCStateHC->fPIF == 1,
-                            ("Crash in patch code %VGv (%VGv) esp=%RX32\nPatch state=%x flags=%x fDirty=%d\n%s\n", pEip, pNewEip, CPUMGetGuestESP(pVM), pPatch->patch.uState, pPatch->patch.flags, pPatchToGuestRec->fDirty, szBuf));
+                            ("Crash in patch code %VRv (%VRv) esp=%RX32\nPatch state=%x flags=%x fDirty=%d\n%s\n", pEip, pNewEip, CPUMGetGuestESP(pVM), pPatch->patch.uState, pPatch->patch.flags, pPatchToGuestRec->fDirty, szBuf));
         }
         else
             AssertReleaseMsg(pVM->patm.s.pGCStateHC->fPIF == 1,
-                            ("Crash in patch code %VGv (%VGv) esp=%RX32\n%s\n", pEip, pNewEip, CPUMGetGuestESP(pVM), szBuf));
+                            ("Crash in patch code %VRv (%VRv) esp=%RX32\n%s\n", pEip, pNewEip, CPUMGetGuestESP(pVM), szBuf));
         EMR3FatalError(pVM, VERR_INTERNAL_ERROR);
     }
@@ -6093,5 +6094,5 @@
     {
         STAM_PROFILE_ADV_STOP(&pVM->patm.s.StatHandleTrap, a);
-        AssertMsgFailed(("PATMR3HandleTrap: patch not found at address %VGv!!\n", pEip));
+        AssertMsgFailed(("PATMR3HandleTrap: patch not found at address %VRv!!\n", pEip));
         return VERR_PATCH_NOT_FOUND;    //fatal error
     }
@@ -6134,5 +6135,5 @@
         if (disret && cpu.pCurInstr->opcode == OP_RETN)
         {
-            RTGCPTR32 retaddr;
+            RTRCPTR retaddr;
             PCPUMCTX pCtx;
             int      rc;
@@ -6144,6 +6145,6 @@
             AssertRC(rc);
 
-            Log(("Return failed at %VGv (%VGv)\n", pEip, pNewEip));
-            Log(("Expected return address %VGv found address %VGv Psp=%x\n", pVM->patm.s.pGCStackHC[(pVM->patm.s.pGCStateHC->Psp+PATM_STACK_SIZE)/sizeof(RTGCPTR32)], retaddr, pVM->patm.s.pGCStateHC->Psp));
+            Log(("Return failed at %VRv (%VRv)\n", pEip, pNewEip));
+            Log(("Expected return address %VRv found address %VRv Psp=%x\n", pVM->patm.s.pGCStackHC[(pVM->patm.s.pGCStateHC->Psp+PATM_STACK_SIZE)/sizeof(RTRCPTR)], retaddr, pVM->patm.s.pGCStateHC->Psp));
         }
     }
@@ -6159,5 +6160,5 @@
     {
         /* Must be a faulting instruction after sti; currently only sysexit, hlt or iret */
-        Log(("PATMR3HandleTrap %VGv -> inhibit irqs set!\n", pEip));
+        Log(("PATMR3HandleTrap %VRv -> inhibit irqs set!\n", pEip));
 #ifdef VBOX_STRICT
         DISCPUSTATE cpu;
@@ -6180,10 +6181,10 @@
     }
 
-    Log2(("pPatchBlockGC %VGv - pEip %VGv corresponding GC address %VGv\n", PATCHCODE_PTR_GC(&pPatch->patch), pEip, pNewEip));
+    Log2(("pPatchBlockGC %VRv - pEip %VRv corresponding GC address %VRv\n", PATCHCODE_PTR_GC(&pPatch->patch), pEip, pNewEip));
 
     if (pNewEip >= pPatch->patch.pPrivInstrGC && pNewEip < pPatch->patch.pPrivInstrGC + pPatch->patch.cbPatchJump)
     {
         /* We can't jump back to code that we've overwritten with a 5 byte jump! */
-        Log(("Disabling patch at location %VGv due to trap too close to the privileged instruction \n", pPatch->patch.pPrivInstrGC));
+        Log(("Disabling patch at location %VRv due to trap too close to the privileged instruction \n", pPatch->patch.pPrivInstrGC));
         PATMR3DisablePatch(pVM, pPatch->patch.pPrivInstrGC);
         STAM_PROFILE_ADV_STOP(&pVM->patm.s.StatHandleTrap, a);
@@ -6195,5 +6196,5 @@
     if (pPatch->patch.cTraps > MAX_PATCH_TRAPS)
     {
-        Log(("Disabling patch at location %VGv due to too many traps inside patch code\n", pPatch->patch.pPrivInstrGC));
+        Log(("Disabling patch at location %VRv due to too many traps inside patch code\n", pPatch->patch.pPrivInstrGC));
         //we are only wasting time, back out the patch
         PATMR3DisablePatch(pVM, pPatch->patch.pPrivInstrGC);
@@ -6217,5 +6218,5 @@
 PATMR3DECL(int) PATMR3HandleMonitoredPage(PVM pVM)
 {
-    RTGCPTR32 addr = pVM->patm.s.pvFaultMonitor;
+    RTRCPTR addr = pVM->patm.s.pvFaultMonitor;
 
     addr &= PAGE_BASE_GC_MASK;
@@ -6224,9 +6225,9 @@
     AssertRC(rc); NOREF(rc);
 
-    PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, addr, false);
+    PPATMPATCHREC pPatchRec = (PPATMPATCHREC)RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, addr, false);
     if (pPatchRec && pPatchRec->patch.uState == PATCH_ENABLED && PAGE_ADDRESS(pPatchRec->patch.pPrivInstrGC) == PAGE_ADDRESS(addr))
     {
         STAM_COUNTER_INC(&pVM->patm.s.StatMonitored);
-        Log(("Renewing patch at %VGv\n", pPatchRec->patch.pPrivInstrGC));
+        Log(("Renewing patch at %VRv\n", pPatchRec->patch.pPrivInstrGC));
         rc = PATMR3DisablePatch(pVM, pPatchRec->patch.pPrivInstrGC);
         if (rc == VWRN_PATCH_REMOVED)
@@ -6241,5 +6242,5 @@
     for(;;)
     {
-        pPatchRec = (PPATMPATCHREC)RTAvloGCPtrGetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, addr, true);
+        pPatchRec = (PPATMPATCHREC)RTAvloU32GetBestFit(&pVM->patm.s.PatchLookupTreeHC->PatchTree, addr, true);
 
         if (!pPatchRec || PAGE_ADDRESS(pPatchRec->patch.pPrivInstrGC) != PAGE_ADDRESS(addr))
@@ -6249,5 +6250,5 @@
         {
             STAM_COUNTER_INC(&pVM->patm.s.StatMonitored);
-            Log(("Renewing patch at %VGv\n", pPatchRec->patch.pPrivInstrGC));
+            Log(("Renewing patch at %VRv\n", pPatchRec->patch.pPrivInstrGC));
             PATMR3DisablePatch(pVM, pPatchRec->patch.pPrivInstrGC);
             PATMR3EnablePatch(pVM, pPatchRec->patch.pPrivInstrGC);
@@ -6359,5 +6360,5 @@
  * @param   pPatch      Patch structure
  */
-RTGCPTR32 patmPatchQueryStatAddress(PVM pVM, PPATCHINFO pPatch)
+RTRCPTR patmPatchQueryStatAddress(PVM pVM, PPATCHINFO pPatch)
 {
     Assert(pPatch->uPatchIdx != PATM_STAT_INDEX_NONE);
@@ -6386,5 +6387,5 @@
         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n");
 
-    RTAvloGCPtrDoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, DisableAllPatches, pVM);
+    RTAvloU32DoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, DisableAllPatches, pVM);
     PATMR3AllowPatching(pVM, false);
     return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Patching disabled\n");
@@ -6410,5 +6411,5 @@
 
     PATMR3AllowPatching(pVM, true);
-    RTAvloGCPtrDoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, EnableAllPatches, pVM);
+    RTAvloU32DoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, EnableAllPatches, pVM);
     return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Patching enabled\n");
 }
Index: trunk/src/VBox/VMM/PATM/PATMA.h
===================================================================
--- trunk/src/VBox/VMM/PATM/PATMA.h	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/PATMA.h	(revision 9228)
@@ -133,6 +133,6 @@
     struct
     {
-        RTGCPTR32      pInstrGC;
-        RTGCUINTPTR32  pRelPatchGC; /* relative to patch base */
+        RTRCPTR      pInstrGC;
+        RTRCUINTPTR  pRelPatchGC; /* relative to patch base */
     } Slot[1];
 } PATCHJUMPTABLE, *PPATCHJUMPTABLE;
Index: trunk/src/VBox/VMM/PATM/PATMInternal.h
===================================================================
--- trunk/src/VBox/VMM/PATM/PATMInternal.h	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/PATMInternal.h	(revision 9228)
@@ -136,6 +136,6 @@
     uint32_t        uType;
     R3PTRTYPE(uint8_t *) pRelocPos;
-    RTGCPTR32       pSource;
-    RTGCPTR32       pDest;
+    RTRCPTR       pSource;
+    RTRCPTR       pDest;
 } RELOCREC, *PRELOCREC;
 
@@ -176,5 +176,5 @@
     AVLU32NODECORE   Core;
 
-    RTGCPTR32        pOrgInstrGC;
+    RTRCPTR          pOrgInstrGC;
     PATM_LOOKUP_TYPE enmType;
     bool             fDirty;
@@ -189,5 +189,5 @@
 {
     /** The key is a GC virtual address. */
-    AVLGCPTRNODECORE    Core;
+    AVLU32NODECORE      Core;
 
     /** Patch offset (relative to PATM::pPatchMemGC / PATM::pPatchMemHC). */
@@ -213,8 +213,8 @@
 
     /** Last original guest instruction pointer; used for disassmebly log. */
-    RTGCPTR32                   pLastDisasmInstrGC;
+    RTRCPTR                   pLastDisasmInstrGC;
 
     /** Keeping track of multiple ret instructions. */
-    RTGCPTR32                 pPatchRetInstrGC;
+    RTRCPTR                 pPatchRetInstrGC;
     uint32_t                    uPatchRetParam1;
 } PATCHINFOTEMP, *PPATCHINFOTEMP;
@@ -234,5 +234,5 @@
 
     /* Only valid for PATMFL_JUMP_CONFLICT patches */
-    RTGCPTR32       pPatchJumpDestGC;
+    RTRCPTR       pPatchJumpDestGC;
 
     RTGCUINTPTR32   pPatchBlockOffset;
@@ -248,6 +248,6 @@
      * Lowest and highest patched GC instruction address. To optimize searches.
      */
-    RTGCPTR32                 pInstrGCLowest;
-    RTGCPTR32                 pInstrGCHighest;
+    RTRCPTR                 pInstrGCLowest;
+    RTRCPTR                 pInstrGCHighest;
 
     /* Tree of fixup records for the patch. */
@@ -264,5 +264,5 @@
      */
     R3PTRTYPE(PAVLU32NODECORE) Patch2GuestAddrTree;
-    R3PTRTYPE(PAVLGCPTRNODECORE) Guest2PatchAddrTree;
+    R3PTRTYPE(PAVLU32NODECORE) Guest2PatchAddrTree;
     uint32_t                  nrPatch2GuestRecs;
 #if HC_ARCH_BITS == 64
@@ -293,5 +293,5 @@
 } PATCHINFO, *PPATCHINFO;
 
-#define PATCHCODE_PTR_GC(pPatch)    (RTGCPTR32)  (pVM->patm.s.pPatchMemGC + (pPatch)->pPatchBlockOffset)
+#define PATCHCODE_PTR_GC(pPatch)    (RTRCPTR)  (pVM->patm.s.pPatchMemGC + (pPatch)->pPatchBlockOffset)
 #define PATCHCODE_PTR_HC(pPatch)    (uint8_t *)(pVM->patm.s.pPatchMemHC + (pPatch)->pPatchBlockOffset)
 
@@ -302,7 +302,7 @@
 {
     /** The key is a GC virtual address. */
-    AVLOGCPTRNODECORE  Core;
+    AVLOU32NODECORE  Core;
     /** The key is a patch offset. */
-    AVLOGCPTRNODECORE  CoreOffset;
+    AVLOU32NODECORE  CoreOffset;
 
     PATCHINFO  patch;
@@ -318,8 +318,8 @@
 {
     /** The key is a GC virtual address. */
-    AVLOGCPTRNODECORE  Core;
+    AVLOU32NODECORE  Core;
     /** Region to monitor. */
-    RTGCPTR32          pLowestAddrGC;
-    RTGCPTR32          pHighestAddrGC;
+    RTRCPTR          pLowestAddrGC;
+    RTRCPTR          pHighestAddrGC;
     /** Number of patches for this page. */
     uint32_t           cCount;
@@ -338,15 +338,15 @@
      * AVL tree with all patches (active or disabled) sorted by guest instruction address
      */
-    AVLOGCPTRTREE           PatchTree;
+    AVLOU32TREE           PatchTree;
 
     /**
      * AVL tree with all patches sorted by patch address (offset actually)
      */
-    AVLOGCPTRTREE           PatchTreeByPatchAddr;
+    AVLOU32TREE           PatchTreeByPatchAddr;
 
     /**
      * AVL tree with all pages which were (partly) patched
      */
-    AVLOGCPTRTREE           PatchTreeByPage;
+    AVLOU32TREE           PatchTreeByPage;
 
     uint32_t                align[1];
@@ -376,6 +376,6 @@
 
     /** PATM stack page for call instruction execution. (2 parts: one for our private stack and one to store the original return address */
-    RCPTRTYPE(RTGCPTR32 *)    pGCStackGC;
-    R3PTRTYPE(RTGCPTR32 *)    pGCStackHC;
+    RCPTRTYPE(RTRCPTR *)    pGCStackGC;
+    R3PTRTYPE(RTRCPTR *)    pGCStackHC;
 
     /** GC pointer to CPUMCTX structure. */
@@ -398,6 +398,6 @@
      * Lowest and highest patched GC instruction addresses. To optimize searches.
      */
-    RTGCPTR32                 pPatchedInstrGCLowest;
-    RTGCPTR32                 pPatchedInstrGCHighest;
+    RTRCPTR                 pPatchedInstrGCLowest;
+    RTRCPTR                 pPatchedInstrGCHighest;
 
     /** Pointer to the patch tree for instructions replaced by 'int 3'. */
@@ -406,11 +406,11 @@
 
     /** Global PATM lookup and call function (used by call patches). */
-    RTGCPTR32               pfnHelperCallGC;
+    RTRCPTR               pfnHelperCallGC;
     /** Global PATM return function (used by ret patches). */
-    RTGCPTR32               pfnHelperRetGC;
+    RTRCPTR               pfnHelperRetGC;
     /** Global PATM jump function (used by indirect jmp patches). */
-    RTGCPTR32               pfnHelperJumpGC;
+    RTRCPTR               pfnHelperJumpGC;
     /** Global PATM return function (used by iret patches). */
-    RTGCPTR32               pfnHelperIretGC;
+    RTRCPTR               pfnHelperIretGC;
 
     /** Fake patch record for global functions. */
@@ -418,12 +418,12 @@
 
     /** Pointer to original sysenter handler */
-    RTGCPTR32               pfnSysEnterGC;
+    RTRCPTR               pfnSysEnterGC;
     /** Pointer to sysenter handler trampoline */
-    RTGCPTR32               pfnSysEnterPatchGC;
+    RTRCPTR               pfnSysEnterPatchGC;
     /** Sysenter patch index (for stats only) */
     uint32_t                uSysEnterPatchIdx;
 
     // GC address of fault in monitored page (set by PATMGCMonitorPage, used by PATMR3HandleMonitoredPage)
-    RTGCPTR32               pvFaultMonitor;
+    RTRCPTR               pvFaultMonitor;
 
     /* Temporary information for pending MMIO patch. Set in GC or R0 context. */
@@ -431,7 +431,7 @@
     {
         RTGCPHYS            GCPhys;
-        RTGCPTR32           pCachedData;
+        RTRCPTR           pCachedData;
 #if GC_ARCH_BITS == 32
-        RTGCPTR32           Alignment0; /**< Align the structure size on a 8-byte boundrary. */
+        RTRCPTR           Alignment0; /**< Align the structure size on a 8-byte boundrary. */
 #endif
     } mmio;
@@ -529,7 +529,7 @@
 
 #ifdef IN_RING3
-RTGCPTR32 patmPatchGCPtr2GuestGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t *) pPatchGC);
-RTGCPTR32 patmGuestGCPtrToPatchGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t*) pInstrGC);
-RTGCPTR32 patmGuestGCPtrToClosestPatchGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t*) pInstrGC);
+RTRCPTR patmPatchGCPtr2GuestGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t *) pPatchGC);
+RTRCPTR patmGuestGCPtrToPatchGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t*) pInstrGC);
+RTRCPTR patmGuestGCPtrToClosestPatchGCPtr(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t*) pInstrGC);
 #endif
 
@@ -544,5 +544,5 @@
  *
  */
-void patmr3AddP2GLookupRecord(PVM pVM, PPATCHINFO pPatch, uint8_t *pPatchInstrHC, RTGCPTR32 pInstrGC, PATM_LOOKUP_TYPE enmType, bool fDirty=false);
+void patmr3AddP2GLookupRecord(PVM pVM, PPATCHINFO pPatch, uint8_t *pPatchInstrHC, RTRCPTR pInstrGC, PATM_LOOKUP_TYPE enmType, bool fDirty=false);
 
 /**
@@ -571,5 +571,5 @@
  * @param   pPatch      Patch structure
  */
-RTGCPTR32 patmPatchQueryStatAddress(PVM pVM, PPATCHINFO pPatch);
+RTRCPTR patmPatchQueryStatAddress(PVM pVM, PPATCHINFO pPatch);
 
 /**
@@ -607,5 +607,5 @@
  *
  */
-int PATMInstallGuestSpecificPatch(PVM pVM, PDISCPUSTATE pCpu, RTGCPTR32 pInstrGC, uint8_t *pInstrHC, PPATMPATCHREC pPatchRec);
+int PATMInstallGuestSpecificPatch(PVM pVM, PDISCPUSTATE pCpu, RTRCPTR pInstrGC, uint8_t *pInstrHC, PPATMPATCHREC pPatchRec);
 
 /**
@@ -631,5 +631,5 @@
  *
  */
-PATMDECL(PPATMPATCHREC) PATMQueryFunctionPatch(PVM pVM, RTGCPTR32 pInstrGC);
+PATMDECL(PPATMPATCHREC) PATMQueryFunctionPatch(PVM pVM, RTRCPTR pInstrGC);
 
 
@@ -690,9 +690,9 @@
     PPATCHINFO    pPatchInfo;
     R3PTRTYPE(uint8_t *) pInstrHC;
-    RTGCPTR32       pInstrGC;
+    RTRCPTR       pInstrGC;
     uint32_t      fReadFlags;
 } PATMDISASM, *PPATMDISASM;
 
-inline bool PATMR3DISInstr(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 InstrGC,
+inline bool PATMR3DISInstr(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR InstrGC,
                            uint8_t *InstrHC, uint32_t *pOpsize, char *pszOutput,
                            uint32_t fReadFlags = PATMREAD_ORGCODE)
@@ -734,5 +734,5 @@
  *
  */
-PPATCHINFO PATMFindActivePatchByEntrypoint(PVM pVM, RTGCPTR32 pInstrGC, bool fIncludeHints=false);
+PPATCHINFO PATMFindActivePatchByEntrypoint(PVM pVM, RTRCPTR pInstrGC, bool fIncludeHints=false);
 
 /**
@@ -750,5 +750,5 @@
  *
  */
-PATMR3DECL(int) PATMR3PatchBlock(PVM pVM, RTGCPTR32 pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC,
+PATMR3DECL(int) PATMR3PatchBlock(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC,
                                  uint32_t uOpcode, uint32_t uOpSize, PPATMPATCHREC pPatchRec);
 
@@ -767,5 +767,5 @@
  *
  */
-PATMR3DECL(int) PATMR3PatchInstrInt3(PVM pVM, RTGCPTR32 pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATCHINFO pPatch);
+PATMR3DECL(int) PATMR3PatchInstrInt3(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pInstrHC, DISCPUSTATE *pCpu, PPATCHINFO pPatch);
 
 /**
@@ -788,5 +788,5 @@
  * @param   pBranchInstrGC  GC pointer of branch instruction
  */
-inline RTGCPTR32 PATMResolveBranch(PDISCPUSTATE pCpu, RTGCPTR32 pBranchInstrGC)
+inline RTRCPTR PATMResolveBranch(PDISCPUSTATE pCpu, RTRCPTR pBranchInstrGC)
 {
     uint32_t disp;
@@ -811,5 +811,5 @@
     }
 #ifdef IN_GC
-    return (RTGCPTR32)((uint8_t *)pBranchInstrGC + pCpu->opsize + disp);
+    return (RTRCPTR)((uint8_t *)pBranchInstrGC + pCpu->opsize + disp);
 #else
     return pBranchInstrGC + pCpu->opsize + disp;
Index: trunk/src/VBox/VMM/PATM/PATMPatch.cpp
===================================================================
--- trunk/src/VBox/VMM/PATM/PATMPatch.cpp	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/PATMPatch.cpp	(revision 9228)
@@ -59,11 +59,11 @@
 typedef struct
 {
-    RTGCPTR32   pTargetGC;
-    RTGCPTR32   pCurInstrGC;
-    RTGCPTR32   pNextInstrGC;
-    RTGCPTR32   pReturnGC;
+    RTRCPTR   pTargetGC;
+    RTRCPTR   pCurInstrGC;
+    RTRCPTR   pNextInstrGC;
+    RTRCPTR   pReturnGC;
 } PATMCALLINFO, *PPATMCALLINFO;
 
-int patmPatchAddReloc32(PVM pVM, PPATCHINFO pPatch, uint8_t *pRelocHC, uint32_t uType, RTGCPTR32 pSource, RTGCPTR32 pDest)
+int patmPatchAddReloc32(PVM pVM, PPATCHINFO pPatch, uint8_t *pRelocHC, uint32_t uType, RTRCPTR pSource, RTRCPTR pDest)
 {
     PRELOCREC pRec;
@@ -88,5 +88,5 @@
 }
 
-int patmPatchAddJump(PVM pVM, PPATCHINFO pPatch, uint8_t *pJumpHC, uint32_t offset, RTGCPTR32 pTargetGC, uint32_t opcode)
+int patmPatchAddJump(PVM pVM, PPATCHINFO pPatch, uint8_t *pJumpHC, uint32_t offset, RTRCPTR pTargetGC, uint32_t opcode)
 {
     PJUMPREC pRec;
@@ -306,7 +306,7 @@
                 case PATM_LOOKUP_AND_CALL_FUNCTION:
                 {
-                    RTGCPTR32 pInstrAfterCall = pVM->patm.s.pPatchMemGC + (RTGCUINTPTR32)(&pPB[j] + sizeof(RTGCPTR32) - pVM->patm.s.pPatchMemHC);
+                    RTRCPTR pInstrAfterCall = pVM->patm.s.pPatchMemGC + (RTGCUINTPTR32)(&pPB[j] + sizeof(RTRCPTR) - pVM->patm.s.pPatchMemHC);
                     Assert(pVM->patm.s.pfnHelperCallGC);
-                    Assert(sizeof(uint32_t) == sizeof(RTGCPTR32));
+                    Assert(sizeof(uint32_t) == sizeof(RTRCPTR));
 
                     /* Relative value is target minus address of instruction after the actual call instruction. */
@@ -317,7 +317,7 @@
                 case PATM_RETURN_FUNCTION:
                 {
-                    RTGCPTR32 pInstrAfterCall = pVM->patm.s.pPatchMemGC + (RTGCUINTPTR32)(&pPB[j] + sizeof(RTGCPTR32) - pVM->patm.s.pPatchMemHC);
+                    RTRCPTR pInstrAfterCall = pVM->patm.s.pPatchMemGC + (RTGCUINTPTR32)(&pPB[j] + sizeof(RTRCPTR) - pVM->patm.s.pPatchMemHC);
                     Assert(pVM->patm.s.pfnHelperRetGC);
-                    Assert(sizeof(uint32_t) == sizeof(RTGCPTR32));
+                    Assert(sizeof(uint32_t) == sizeof(RTRCPTR));
 
                     /* Relative value is target minus address of instruction after the actual call instruction. */
@@ -328,7 +328,7 @@
                 case PATM_IRET_FUNCTION:
                 {
-                    RTGCPTR32 pInstrAfterCall = pVM->patm.s.pPatchMemGC + (RTGCUINTPTR32)(&pPB[j] + sizeof(RTGCPTR32) - pVM->patm.s.pPatchMemHC);
+                    RTRCPTR pInstrAfterCall = pVM->patm.s.pPatchMemGC + (RTGCUINTPTR32)(&pPB[j] + sizeof(RTRCPTR) - pVM->patm.s.pPatchMemHC);
                     Assert(pVM->patm.s.pfnHelperIretGC);
-                    Assert(sizeof(uint32_t) == sizeof(RTGCPTR32));
+                    Assert(sizeof(uint32_t) == sizeof(RTRCPTR));
 
                     /* Relative value is target minus address of instruction after the actual call instruction. */
@@ -339,7 +339,7 @@
                 case PATM_LOOKUP_AND_JUMP_FUNCTION:
                 {
-                    RTGCPTR32 pInstrAfterCall = pVM->patm.s.pPatchMemGC + (RTGCUINTPTR32)(&pPB[j] + sizeof(RTGCPTR32) - pVM->patm.s.pPatchMemHC);
+                    RTRCPTR pInstrAfterCall = pVM->patm.s.pPatchMemGC + (RTGCUINTPTR32)(&pPB[j] + sizeof(RTRCPTR) - pVM->patm.s.pPatchMemHC);
                     Assert(pVM->patm.s.pfnHelperJumpGC);
-                    Assert(sizeof(uint32_t) == sizeof(RTGCPTR32));
+                    Assert(sizeof(uint32_t) == sizeof(RTRCPTR));
 
                     /* Relative value is target minus address of instruction after the actual call instruction. */
@@ -354,5 +354,5 @@
                 }
 
-                *(RTGCPTR32 *)&pPB[j] = dest;
+                *(RTRCPTR *)&pPB[j] = dest;
                 if (pAsmRecord->uReloc[i] < PATM_NO_FIXUP)
                 {
@@ -393,5 +393,5 @@
 
 /* Read bytes and check for overwritten instructions. */
-static int patmPatchReadBytes(PVM pVM, uint8_t *pDest, RTGCPTR32 pSrc, uint32_t cb)
+static int patmPatchReadBytes(PVM pVM, uint8_t *pDest, RTRCPTR pSrc, uint32_t cb)
 {
     int rc = PGMPhysReadGCPtr(pVM, pDest, pSrc, cb);
@@ -426,5 +426,5 @@
 }
 
-int patmPatchGenIret(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC, bool fSizeOverride)
+int patmPatchGenIret(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC, bool fSizeOverride)
 {
     uint32_t size;
@@ -457,5 +457,5 @@
  * Generate an STI patch
  */
-int patmPatchGenSti(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC, RTGCPTR32 pNextInstrGC)
+int patmPatchGenSti(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC, RTRCPTR pNextInstrGC)
 {
     PATMCALLINFO callInfo;
@@ -564,5 +564,5 @@
     }
 
-    *(RTGCPTR32 *)&pPB[pPatchAsmRec->offRelJump] = 0xDEADBEEF;
+    *(RTRCPTR *)&pPB[pPatchAsmRec->offRelJump] = 0xDEADBEEF;
 
     patmPatchAddJump(pVM, pPatch, &pPB[pPatchAsmRec->offRelJump - 1], 1, pTargetGC, opcode);
@@ -657,9 +657,9 @@
     else offset++;
 
-    *(RTGCPTR32 *)&pPB[offset] = 0xDEADBEEF;
+    *(RTRCPTR *)&pPB[offset] = 0xDEADBEEF;
 
     patmPatchAddJump(pVM, pPatch, pPB, offset, pTargetGC, opcode);
 
-    offset += sizeof(RTGCPTR32);
+    offset += sizeof(RTRCPTR);
 
     PATCHGEN_EPILOG(pPatch, offset);
@@ -670,5 +670,5 @@
  * Rewrite call to dynamic or currently unknown function (on-demand patching of function)
  */
-int patmPatchGenCall(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pCurInstrGC, RTGCPTR32 pTargetGC, bool fIndirect)
+int patmPatchGenCall(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pCurInstrGC, RTRCPTR pTargetGC, bool fIndirect)
 {
     PATMCALLINFO        callInfo;
@@ -710,5 +710,5 @@
             i++;    //skip segment prefix
 
-        rc = patmPatchReadBytes(pVM, &pPB[offset], (RTGCPTR32)((RTGCUINTPTR32)pCurInstrGC + i), pCpu->opsize - i);
+        rc = patmPatchReadBytes(pVM, &pPB[offset], (RTRCPTR)((RTGCUINTPTR32)pCurInstrGC + i), pCpu->opsize - i);
         AssertRCReturn(rc, rc);
         offset += (pCpu->opsize - i);
@@ -730,6 +730,6 @@
         offset = 0;
         pPB[offset++] = 0x68;              // push %Iv
-        *(RTGCPTR32 *)&pPB[offset] = pTargetGC;
-        offset += sizeof(RTGCPTR32);
+        *(RTRCPTR *)&pPB[offset] = pTargetGC;
+        offset += sizeof(RTRCPTR);
     }
 
@@ -771,5 +771,5 @@
  * @param   pCurInstrGC Current instruction address
  */
-int patmPatchGenJump(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pCurInstrGC)
+int patmPatchGenJump(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pCurInstrGC)
 {
     PATMCALLINFO        callInfo;
@@ -807,5 +807,5 @@
         i++;    //skip segment prefix
 
-    rc = patmPatchReadBytes(pVM, &pPB[offset], (RTGCPTR32)((RTGCUINTPTR32)pCurInstrGC + i), pCpu->opsize - i);
+    rc = patmPatchReadBytes(pVM, &pPB[offset], (RTRCPTR)((RTGCUINTPTR32)pCurInstrGC + i), pCpu->opsize - i);
     AssertRCReturn(rc, rc);
     offset += (pCpu->opsize - i);
@@ -846,5 +846,5 @@
 {
     int size = 0, rc;
-    RTGCPTR32 pPatchRetInstrGC;
+    RTRCPTR pPatchRetInstrGC;
 
     /* Remember start of this patch for below. */
@@ -970,5 +970,5 @@
  *
  */
-int patmPatchGenCheckIF(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC)
+int patmPatchGenCheckIF(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC)
 {
     uint32_t size;
@@ -995,5 +995,5 @@
  *
  */
-int patmPatchGenSetPIF(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pInstrGC)
+int patmPatchGenSetPIF(PVM pVM, PPATCHINFO pPatch, RTRCPTR pInstrGC)
 {
     PATCHGEN_PROLOG(pVM, pPatch);
@@ -1016,5 +1016,5 @@
  *
  */
-int patmPatchGenClearPIF(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pInstrGC)
+int patmPatchGenClearPIF(PVM pVM, PPATCHINFO pPatch, RTRCPTR pInstrGC)
 {
     PATCHGEN_PROLOG(pVM, pPatch);
@@ -1037,5 +1037,5 @@
  * @param   pNextInstrGC    Next guest instruction
  */
-int patmPatchGenClearInhibitIRQ(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pNextInstrGC)
+int patmPatchGenClearInhibitIRQ(PVM pVM, PPATCHINFO pPatch, RTRCPTR pNextInstrGC)
 {
     int          size;
@@ -1070,5 +1070,5 @@
  ** @todo must check if virtual IF is already cleared on entry!!!!!!!!!!!!!!!!!!!!!!!
  */
-int patmPatchGenIntEntry(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pIntHandlerGC)
+int patmPatchGenIntEntry(PVM pVM, PPATCHINFO pPatch, RTRCPTR pIntHandlerGC)
 {
     uint32_t size;
@@ -1102,5 +1102,5 @@
  * @param   pTrapHandlerGC  IDT handler address
  */
-int patmPatchGenTrapEntry(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pTrapHandlerGC)
+int patmPatchGenTrapEntry(PVM pVM, PPATCHINFO pPatch, RTRCPTR pTrapHandlerGC)
 {
     uint32_t size;
@@ -1121,5 +1121,5 @@
 
 #ifdef VBOX_WITH_STATISTICS
-int patmPatchGenStats(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pInstrGC)
+int patmPatchGenStats(PVM pVM, PPATCHINFO pPatch, RTRCPTR pInstrGC)
 {
     uint32_t size;
@@ -1213,8 +1213,8 @@
         break;
     }
-    *(RTGCPTR32 *)&pPB[2] = pVM->patm.s.pCPUMCtxGC + offset;
+    *(RTRCPTR *)&pPB[2] = pVM->patm.s.pCPUMCtxGC + offset;
     patmPatchAddReloc32(pVM, pPatch, &pPB[2], FIXUP_ABSOLUTE);
 
-    PATCHGEN_EPILOG(pPatch, 2 + sizeof(RTGCPTR32));
+    PATCHGEN_EPILOG(pPatch, 2 + sizeof(RTRCPTR));
     return rc;
 }
@@ -1279,8 +1279,8 @@
         break;
     }
-    *(RTGCPTR32 *)&pPB[2] = pVM->patm.s.pCPUMCtxGC + offset;
+    *(RTRCPTR *)&pPB[2] = pVM->patm.s.pCPUMCtxGC + offset;
     patmPatchAddReloc32(pVM, pPatch, &pPB[2], FIXUP_ABSOLUTE);
 
-    PATCHGEN_EPILOG(pPatch, 2 + sizeof(RTGCPTR32));
+    PATCHGEN_EPILOG(pPatch, 2 + sizeof(RTRCPTR));
     return rc;
 }
@@ -1289,5 +1289,5 @@
  * mov GPR, SS
  */
-int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pCurInstrGC)
+int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pCurInstrGC)
 {
     uint32_t size, offset;
@@ -1340,5 +1340,5 @@
  * @param   pCurInstrGC Guest instruction address
  */
-int patmPatchGenSldtStr(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pCurInstrGC)
+int patmPatchGenSldtStr(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pCurInstrGC)
 {
     // sldt %Ew
@@ -1365,12 +1365,12 @@
         if (pCpu->pCurInstr->opcode == OP_STR)
         {
-            *(RTGCPTR32 *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, tr);
+            *(RTRCPTR *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, tr);
         }
         else
         {
-            *(RTGCPTR32 *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, ldtr);
+            *(RTRCPTR *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, ldtr);
         }
         patmPatchAddReloc32(pVM, pPatch, &pPB[offset], FIXUP_ABSOLUTE);
-        offset += sizeof(RTGCPTR32);
+        offset += sizeof(RTRCPTR);
     }
     else
@@ -1402,5 +1402,5 @@
             i++;    //skip segment prefix
 
-        rc = patmPatchReadBytes(pVM, &pPB[offset], (RTGCPTR32)((RTGCUINTPTR32)pCurInstrGC + i), pCpu->opsize - i);
+        rc = patmPatchReadBytes(pVM, &pPB[offset], (RTRCPTR)((RTGCUINTPTR32)pCurInstrGC + i), pCpu->opsize - i);
         AssertRCReturn(rc, rc);
         offset += (pCpu->opsize - i);
@@ -1410,12 +1410,12 @@
         if (pCpu->pCurInstr->opcode == OP_STR)
         {
-            *(RTGCPTR32 *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, tr);
+            *(RTRCPTR *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, tr);
         }
         else
         {
-            *(RTGCPTR32 *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, ldtr);
+            *(RTRCPTR *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, ldtr);
         }
         patmPatchAddReloc32(pVM, pPatch, &pPB[offset], FIXUP_ABSOLUTE);
-        offset += sizeof(RTGCPTR32);
+        offset += sizeof(RTRCPTR);
 
         pPB[offset++] = 0x66;              // mov       word ptr [edx],ax
@@ -1441,5 +1441,5 @@
  * @param   pCurInstrGC Guest instruction address
  */
-int patmPatchGenSxDT(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pCurInstrGC)
+int patmPatchGenSxDT(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pCurInstrGC)
 {
     int rc = VINF_SUCCESS;
@@ -1496,5 +1496,5 @@
     if (pCpu->prefix == PREFIX_SEG)
         i++;    //skip segment prefix
-    rc = patmPatchReadBytes(pVM, &pPB[offset], (RTGCPTR32)((RTGCUINTPTR32)pCurInstrGC + i), pCpu->opsize - i);
+    rc = patmPatchReadBytes(pVM, &pPB[offset], (RTRCPTR)((RTGCUINTPTR32)pCurInstrGC + i), pCpu->opsize - i);
     AssertRCReturn(rc, rc);
     offset += (pCpu->opsize - i);
@@ -1502,7 +1502,7 @@
     pPB[offset++] = 0x66;              // mov       ax, CPUMCTX.gdtr.limit
     pPB[offset++] = 0xA1;
-    *(RTGCPTR32 *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + offset_limit;
+    *(RTRCPTR *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + offset_limit;
     patmPatchAddReloc32(pVM, pPatch, &pPB[offset], FIXUP_ABSOLUTE);
-    offset += sizeof(RTGCPTR32);
+    offset += sizeof(RTRCPTR);
 
     pPB[offset++] = 0x66;              // mov       word ptr [edx],ax
@@ -1511,7 +1511,7 @@
 
     pPB[offset++] = 0xA1;              // mov       eax, CPUMCTX.gdtr.base
-    *(RTGCPTR32 *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + offset_base;
+    *(RTRCPTR *)&pPB[offset] = pVM->patm.s.pCPUMCtxGC + offset_base;
     patmPatchAddReloc32(pVM, pPatch, &pPB[offset], FIXUP_ABSOLUTE);
-    offset += sizeof(RTGCPTR32);
+    offset += sizeof(RTRCPTR);
 
     pPB[offset++] = 0x89;              // mov       dword ptr [edx+2],eax
@@ -1535,5 +1535,5 @@
  * @param   pCurInstrGC Guest instruction address
  */
-int patmPatchGenCpuid(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC)
+int patmPatchGenCpuid(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC)
 {
     uint32_t size;
@@ -1583,5 +1583,5 @@
  * Relative jump from patch code to patch code (no fixup required)
  */
-int patmPatchGenPatchJump(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC, RCPTRTYPE(uint8_t *) pPatchAddrGC, bool fAddLookupRecord)
+int patmPatchGenPatchJump(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC, RCPTRTYPE(uint8_t *) pPatchAddrGC, bool fAddLookupRecord)
 {
     int32_t displ;
Index: trunk/src/VBox/VMM/PATM/PATMPatch.h
===================================================================
--- trunk/src/VBox/VMM/PATM/PATMPatch.h	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/PATMPatch.h	(revision 9228)
@@ -22,30 +22,30 @@
 #define ___PATMPATCH_H
 
-int patmPatchAddReloc32(PVM pVM, PPATCHINFO pPatch, uint8_t *pRelocHC, uint32_t uType, RTGCPTR32 pSource = 0, RTGCPTR32 pDest = 0);
-int patmPatchAddJump(PVM pVM, PPATCHINFO pPatch, uint8_t *pJumpHC, uint32_t offset, RTGCPTR32 pTargetGC, uint32_t opcode);
+int patmPatchAddReloc32(PVM pVM, PPATCHINFO pPatch, uint8_t *pRelocHC, uint32_t uType, RTRCPTR pSource = 0, RTRCPTR pDest = 0);
+int patmPatchAddJump(PVM pVM, PPATCHINFO pPatch, uint8_t *pJumpHC, uint32_t offset, RTRCPTR pTargetGC, uint32_t opcode);
 
-int patmPatchGenCpuid(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC);
-int patmPatchGenSxDT(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pCurInstrGC);
-int patmPatchGenSldtStr(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pCurInstrGC);
+int patmPatchGenCpuid(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC);
+int patmPatchGenSxDT(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pCurInstrGC);
+int patmPatchGenSldtStr(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pCurInstrGC);
 int patmPatchGenMovControl(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu);
 int patmPatchGenMovDebug(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu);
-int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pCurInstrGC);
+int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pCurInstrGC);
 int patmPatchGenRelJump(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t *) pTargetGC, uint32_t opcode, bool fSizeOverride);
 int patmPatchGenLoop(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t *) pTargetGC, uint32_t opcode, bool fSizeOverride);
 int patmPatchGenPushf(PVM pVM, PPATCHINFO pPatch, bool fSizeOverride);
 int patmPatchGenPopf(PVM pVM, PPATCHINFO pPatch, RCPTRTYPE(uint8_t *) pReturnAddrGC, bool fSizeOverride, bool fGenJumpBack);
-int patmPatchGenSti(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC, RTGCPTR32 pNextInstrGC);
+int patmPatchGenSti(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC, RTRCPTR pNextInstrGC);
 
 int patmPatchGenCli(PVM pVM, PPATCHINFO pPatch);
-int patmPatchGenIret(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC, bool fSizeOverride);
+int patmPatchGenIret(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC, bool fSizeOverride);
 int patmPatchGenDuplicate(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pCurInstrGC);
 int patmPatchGenPushCS(PVM pVM, PPATCHINFO pPatch);
 
-int patmPatchGenStats(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pInstrGC);
+int patmPatchGenStats(PVM pVM, PPATCHINFO pPatch, RTRCPTR pInstrGC);
 
-int patmPatchGenCall(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pInstrGC, RTGCPTR32 pTargetGC, bool fIndirect);
+int patmPatchGenCall(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pInstrGC, RTRCPTR pTargetGC, bool fIndirect);
 int patmPatchGenRet(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pCurInstrGC);
 
-int patmPatchGenPatchJump(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC, RCPTRTYPE(uint8_t *) pPatchAddrGC, bool fAddLookupRecord = true);
+int patmPatchGenPatchJump(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC, RCPTRTYPE(uint8_t *) pPatchAddrGC, bool fAddLookupRecord = true);
 
 /**
@@ -58,5 +58,5 @@
  * @param   pCurInstrGC Current instruction address
  */
-int patmPatchGenJump(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR32 pCurInstrGC);
+int patmPatchGenJump(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTRCPTR pCurInstrGC);
 
 /**
@@ -68,5 +68,5 @@
  * @param   pTrapHandlerGC  IDT handler address
  */
-int patmPatchGenTrapEntry(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pTrapHandlerGC);
+int patmPatchGenTrapEntry(PVM pVM, PPATCHINFO pPatch, RTRCPTR pTrapHandlerGC);
 
 /**
@@ -78,5 +78,5 @@
  * @param   pIntHandlerGC IDT handler address
  */
-int patmPatchGenIntEntry(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pIntHandlerGC);
+int patmPatchGenIntEntry(PVM pVM, PPATCHINFO pPatch, RTRCPTR pIntHandlerGC);
 
 /**
@@ -110,5 +110,5 @@
  *
  */
-int patmPatchGenSetPIF(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pInstrGC);
+int patmPatchGenSetPIF(PVM pVM, PPATCHINFO pPatch, RTRCPTR pInstrGC);
 
 /**
@@ -121,5 +121,5 @@
  *
  */
-int patmPatchGenClearPIF(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pInstrGC);
+int patmPatchGenClearPIF(PVM pVM, PPATCHINFO pPatch, RTRCPTR pInstrGC);
 
 /**
@@ -131,5 +131,5 @@
  * @param   pNextInstrGC    Next guest instruction
  */
-int patmPatchGenClearInhibitIRQ(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pNextInstrGC);
+int patmPatchGenClearInhibitIRQ(PVM pVM, PPATCHINFO pPatch, RTRCPTR pNextInstrGC);
 
 /**
@@ -142,5 +142,5 @@
  *
  */
-int patmPatchGenCheckIF(PVM pVM, PPATCHINFO pPatch, RTGCPTR32 pCurInstrGC);
+int patmPatchGenCheckIF(PVM pVM, PPATCHINFO pPatch, RTRCPTR pCurInstrGC);
 
 /**
Index: trunk/src/VBox/VMM/PATM/PATMSSM.cpp
===================================================================
--- trunk/src/VBox/VMM/PATM/PATMSSM.cpp	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/PATMSSM.cpp	(revision 9228)
@@ -89,5 +89,5 @@
 
 /**
- * Callback function for RTAvloGCPtrDoWithAll
+ * Callback function for RTAvloU32DoWithAll
  *
  * Counts the number of patches in the tree
@@ -97,5 +97,5 @@
  * @param   pcPatches       Pointer to patch counter
  */
-static DECLCALLBACK(int) patmCountPatch(PAVLOGCPTRNODECORE pNode, void *pcPatches)
+static DECLCALLBACK(int) patmCountPatch(PAVLOU32NODECORE pNode, void *pcPatches)
 {
     *(uint32_t *)pcPatches = *(uint32_t *)pcPatches + 1;
@@ -152,5 +152,5 @@
 
 /**
- * Callback function for RTAvloGCPtrDoWithAll
+ * Callback function for RTAvloU32DoWithAll
  *
  * Saves the state of the patch that's being enumerated
@@ -160,5 +160,5 @@
  * @param   pVM1            VM Handle
  */
-static DECLCALLBACK(int) patmSavePatchState(PAVLOGCPTRNODECORE pNode, void *pVM1)
+static DECLCALLBACK(int) patmSavePatchState(PAVLOU32NODECORE pNode, void *pVM1)
 {
     PVM           pVM    = (PVM)pVM1;
@@ -232,5 +232,5 @@
      */
     patmInfo.savedstate.cPatches = 0;
-    RTAvloGCPtrDoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, patmCountPatch, &patmInfo.savedstate.cPatches);
+    RTAvloU32DoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, patmCountPatch, &patmInfo.savedstate.cPatches);
 
     /*
@@ -261,5 +261,5 @@
      * Save all patches
      */
-    rc = RTAvloGCPtrDoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, patmSavePatchState, pVM);
+    rc = RTAvloU32DoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, patmSavePatchState, pVM);
     AssertRCReturn(rc, rc);
 
@@ -390,5 +390,5 @@
         pPatchRec->CoreOffset.Key    = patch.CoreOffset.Key;
 
-        bool ret = RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pPatchRec->Core);
+        bool ret = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pPatchRec->Core);
         Assert(ret);
         if (pPatchRec->patch.uState != PATCH_REFUSED)
@@ -397,5 +397,5 @@
             {
                 /* We actually generated code for this patch. */
-                ret = RTAvloGCPtrInsert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
+                ret = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
                 AssertMsg(ret, ("Inserting patch %VGv offset %VGv failed!!\n", pPatchRec->patch.pPrivInstrGC, pPatchRec->CoreOffset.Key));
             }
Index: trunk/src/VBox/VMM/PATM/VMMAll/PATMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/PATM/VMMAll/PATMAll.cpp	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/VMMAll/PATMAll.cpp	(revision 9228)
@@ -52,5 +52,5 @@
 PATMDECL(void) PATMRawEnter(PVM pVM, PCPUMCTXCORE pCtxCore)
 {
-    bool fPatchCode = PATMIsPatchGCAddr(pVM, (RTGCPTR32)pCtxCore->eip);
+    bool fPatchCode = PATMIsPatchGCAddr(pVM, (RTRCPTR)pCtxCore->eip);
 
     /*
@@ -60,5 +60,5 @@
     register uint32_t efl = pCtxCore->eflags.u32;
     CTXSUFF(pVM->patm.s.pGCState)->uVMFlags = efl & PATM_VIRTUAL_FLAGS_MASK;
-    AssertMsg((efl & X86_EFL_IF) || PATMShouldUseRawMode(pVM, (RTGCPTR32)pCtxCore->eip), ("X86_EFL_IF is clear and PATM is disabled! (eip=%VGv eflags=%08x fPATM=%d pPATMGC=%VGv-%VGv\n", pCtxCore->eip, pCtxCore->eflags.u32, PATMIsEnabled(pVM), pVM->patm.s.pPatchMemGC, pVM->patm.s.pPatchMemGC + pVM->patm.s.cbPatchMem));
+    AssertMsg((efl & X86_EFL_IF) || PATMShouldUseRawMode(pVM, (RTRCPTR)pCtxCore->eip), ("X86_EFL_IF is clear and PATM is disabled! (eip=%VGv eflags=%08x fPATM=%d pPATMGC=%VGv-%VGv\n", pCtxCore->eip, pCtxCore->eflags.u32, PATMIsEnabled(pVM), pVM->patm.s.pPatchMemGC, pVM->patm.s.pPatchMemGC + pVM->patm.s.cbPatchMem));
 
     AssertReleaseMsg(CTXSUFF(pVM->patm.s.pGCState)->fPIF || fPatchCode, ("fPIF=%d eip=%VGv\n", CTXSUFF(pVM->patm.s.pGCState)->fPIF, pCtxCore->eip));
@@ -81,5 +81,5 @@
        )
     {
-        if (pVM->patm.s.pfnSysEnterGC != (RTGCPTR32)pCtx->SysEnter.eip)
+        if (pVM->patm.s.pfnSysEnterGC != (RTRCPTR)pCtx->SysEnter.eip)
         {
             pVM->patm.s.pfnSysEnterPatchGC = 0;
@@ -94,10 +94,10 @@
                 {
                     pVM->patm.s.pfnSysEnterPatchGC  = PATMR3QueryPatchGCPtr(pVM, pCtx->SysEnter.eip);
-                    pVM->patm.s.pfnSysEnterGC       = (RTGCPTR32)pCtx->SysEnter.eip;
+                    pVM->patm.s.pfnSysEnterGC       = (RTRCPTR)pCtx->SysEnter.eip;
                     Assert(pVM->patm.s.pfnSysEnterPatchGC);
                 }
             }
             else
-                pVM->patm.s.pfnSysEnterGC = (RTGCPTR32)pCtx->SysEnter.eip;
+                pVM->patm.s.pfnSysEnterGC = (RTRCPTR)pCtx->SysEnter.eip;
         }
     }
@@ -126,5 +126,5 @@
 PATMDECL(void) PATMRawLeave(PVM pVM, PCPUMCTXCORE pCtxCore, int rawRC)
 {
-    bool fPatchCode = PATMIsPatchGCAddr(pVM, (RTGCPTR32)pCtxCore->eip);
+    bool fPatchCode = PATMIsPatchGCAddr(pVM, (RTRCPTR)pCtxCore->eip);
     /*
      * We will only be called if PATMRawEnter was previously called.
@@ -157,5 +157,5 @@
             {
                 PATMTRANSSTATE  enmState;
-                RTGCPTR32         pOrgInstrGC = PATMR3PatchToGCPtr(pVM, pCtxCore->eip, &enmState);
+                RTRCPTR         pOrgInstrGC = PATMR3PatchToGCPtr(pVM, pCtxCore->eip, &enmState);
 
                 AssertRelease(pOrgInstrGC);
@@ -191,5 +191,5 @@
     if (!fPatchCode)
     {
-        if (CTXSUFF(pVM->patm.s.pGCState)->GCPtrInhibitInterrupts == (RTGCPTR32)pCtxCore->eip)
+        if (CTXSUFF(pVM->patm.s.pGCState)->GCPtrInhibitInterrupts == (RTRCPTR)pCtxCore->eip)
         {
             EMSetInhibitInterruptsPC(pVM, pCtxCore->eip);
@@ -246,8 +246,8 @@
  * @param   pAddrGC     Guest context address
  */
-PATMDECL(bool) PATMShouldUseRawMode(PVM pVM, RTGCPTR32 pAddrGC)
+PATMDECL(bool) PATMShouldUseRawMode(PVM pVM, RTRCPTR pAddrGC)
 {
     return (    PATMIsEnabled(pVM)
-            && ((pAddrGC >= (RTGCPTR32)pVM->patm.s.pPatchMemGC && pAddrGC < (RTGCPTR32)pVM->patm.s.pPatchMemGC + pVM->patm.s.cbPatchMem))) ? true : false;
+            && ((pAddrGC >= (RTRCPTR)pVM->patm.s.pPatchMemGC && pAddrGC < (RTRCPTR)((RTRCUINTPTR)pVM->patm.s.pPatchMemGC + pVM->patm.s.cbPatchMem)))) ? true : false;
 }
 
@@ -270,9 +270,7 @@
  * @param   pAddrGC     Guest context address
  */
-PATMDECL(bool) PATMIsPatchGCAddr(PVM pVM, RTGCPTR32 pAddrGC)
-{
-    RTGCPTR32 pAddrGG32 = (RTGCPTR32)pAddrGC;
-
-    return (PATMIsEnabled(pVM) && pAddrGG32 >= (RTGCPTR32)pVM->patm.s.pPatchMemGC && pAddrGG32 < (RTGCPTR32)pVM->patm.s.pPatchMemGC + pVM->patm.s.cbPatchMem) ? true : false;
+PATMDECL(bool) PATMIsPatchGCAddr(PVM pVM, RTRCPTR pAddrGC)
+{
+    return (PATMIsEnabled(pVM) && pAddrGC >= pVM->patm.s.pPatchMemGC && pAddrGC < (RTRCPTR)((RTRCUINTPTR)pVM->patm.s.pPatchMemGC + pVM->patm.s.cbPatchMem)) ? true : false;
 }
 
@@ -285,8 +283,8 @@
  * @param   pCachedData     GC pointer to cached data
  */
-PATMDECL(int) PATMSetMMIOPatchInfo(PVM pVM, RTGCPHYS GCPhys, RTGCPTR32 pCachedData)
+PATMDECL(int) PATMSetMMIOPatchInfo(PVM pVM, RTGCPHYS GCPhys, RTRCPTR pCachedData)
 {
     pVM->patm.s.mmio.GCPhys = GCPhys;
-    pVM->patm.s.mmio.pCachedData = (RTGCPTR32)pCachedData;
+    pVM->patm.s.mmio.pCachedData = (RTRCPTR)pCachedData;
 
     return VINF_SUCCESS;
@@ -325,5 +323,5 @@
     if (PATMIsEnabled(pVM))
     {
-        if (PATMIsPatchGCAddr(pVM, (RTGCPTR32)pCtxCore->eip))
+        if (PATMIsPatchGCAddr(pVM, (RTRCPTR)pCtxCore->eip))
             return false;
     }
@@ -339,9 +337,10 @@
  *
  */
-PATMDECL(PPATMPATCHREC) PATMQueryFunctionPatch(PVM pVM, RTGCPTR32 pInstrGC)
+PATMDECL(PPATMPATCHREC) PATMQueryFunctionPatch(PVM pVM, RTRCPTR pInstrGC)
 {
     PPATMPATCHREC pRec;
 
-    pRec = (PPATMPATCHREC)RTAvloGCPtrGet(&CTXSUFF(pVM->patm.s.PatchLookupTree)->PatchTree, pInstrGC);
+    AssertCompile(sizeof(AVLOU32KEY) == sizeof(pInstrGC));
+    pRec = (PPATMPATCHREC)RTAvloU32Get(&CTXSUFF(pVM->patm.s.PatchLookupTree)->PatchTree, (AVLOU32KEY)pInstrGC);
     if (    pRec
         && (pRec->patch.uState == PATCH_ENABLED)
@@ -362,9 +361,9 @@
  * @param   pSize       Original instruction size (out, optional)
  */
-PATMDECL(bool) PATMIsInt3Patch(PVM pVM, RTGCPTR32 pInstrGC, uint32_t *pOpcode, uint32_t *pSize)
+PATMDECL(bool) PATMIsInt3Patch(PVM pVM, RTRCPTR pInstrGC, uint32_t *pOpcode, uint32_t *pSize)
 {
     PPATMPATCHREC pRec;
 
-    pRec = (PPATMPATCHREC)RTAvloGCPtrGet(&CTXSUFF(pVM->patm.s.PatchLookupTree)->PatchTree, pInstrGC);
+    pRec = (PPATMPATCHREC)RTAvloU32Get(&CTXSUFF(pVM->patm.s.PatchLookupTree)->PatchTree, (AVLOU32KEY)pInstrGC);
     if (    pRec
         && (pRec->patch.uState == PATCH_ENABLED)
@@ -402,5 +401,5 @@
             ||  (pRegFrame->cs & X86_SEL_RPL) != 3
             ||  pVM->patm.s.pfnSysEnterPatchGC == 0
-            ||  pVM->patm.s.pfnSysEnterGC != (RTGCPTR32)pCtx->SysEnter.eip
+            ||  pVM->patm.s.pfnSysEnterGC != (RTRCPTR)pCtx->SysEnter.eip
             ||  !(PATMRawGetEFlags(pVM, pRegFrame) & X86_EFL_IF))
             goto end;
@@ -467,5 +466,5 @@
  * @param   pRelBranchPatch     Relative duplicated function address
  */
-PATMDECL(int) PATMAddBranchToLookupCache(PVM pVM, RTGCPTR32 pJumpTableGC, RTGCPTR32 pBranchTarget, RTGCUINTPTR pRelBranchPatch)
+PATMDECL(int) PATMAddBranchToLookupCache(PVM pVM, RTRCPTR pJumpTableGC, RTRCPTR pBranchTarget, RTGCUINTPTR pRelBranchPatch)
 {
     PPATCHJUMPTABLE pJumpTable;
Index: trunk/src/VBox/VMM/PATM/VMMGC/CSAMGC.cpp
===================================================================
--- trunk/src/VBox/VMM/PATM/VMMGC/CSAMGC.cpp	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/VMMGC/CSAMGC.cpp	(revision 9228)
@@ -66,5 +66,5 @@
 {
     PPATMGCSTATE pPATMGCState;
-    bool         fPatchCode = PATMIsPatchGCAddr(pVM, (RTGCPTR32)pRegFrame->eip);
+    bool         fPatchCode = PATMIsPatchGCAddr(pVM, (RTRCPTR)pRegFrame->eip);
     int          rc;
 
@@ -103,5 +103,5 @@
     if (cpl != 3)
     {
-        rc = PATMGCHandleWriteToPatchPage(pVM, pRegFrame, (RTGCPTR32)((RTGCUINTPTR)pvRange + offRange), 4 /** @todo */);
+        rc = PATMGCHandleWriteToPatchPage(pVM, pRegFrame, (RTRCPTR)((RTRCUINTPTR)pvRange + offRange), 4 /** @todo */);
         if (rc == VINF_SUCCESS)
             return rc;
Index: trunk/src/VBox/VMM/PATM/VMMGC/PATMGC.cpp
===================================================================
--- trunk/src/VBox/VMM/PATM/VMMGC/PATMGC.cpp	(revision 9227)
+++ trunk/src/VBox/VMM/PATM/VMMGC/PATMGC.cpp	(revision 9228)
@@ -65,5 +65,5 @@
 PATMGCDECL(int) PATMGCMonitorPage(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPTR pvRange, uintptr_t offRange)
 {
-    pVM->patm.s.pvFaultMonitor = (RTGCPTR32)pvFault;
+    pVM->patm.s.pvFaultMonitor = (RTRCPTR)pvFault;
     return VINF_PATM_CHECK_PATCH_PAGE;
 }
@@ -81,5 +81,5 @@
  *
  */
-PATMGCDECL(int) PATMGCHandleWriteToPatchPage(PVM pVM, PCPUMCTXCORE pRegFrame, RTGCPTR32 GCPtr, uint32_t cbWrite)
+PATMGCDECL(int) PATMGCHandleWriteToPatchPage(PVM pVM, PCPUMCTXCORE pRegFrame, RTRCPTR GCPtr, uint32_t cbWrite)
 {
     RTGCUINTPTR          pWritePageStart, pWritePageEnd;
@@ -97,27 +97,27 @@
     pWritePageEnd   = ((RTGCUINTPTR)GCPtr + cbWrite - 1) & PAGE_BASE_GC_MASK;
 
-    pPatchPage = (PPATMPATCHPAGE)RTAvloGCPtrGet(CTXSUFF(&pVM->patm.s.PatchLookupTree)->PatchTreeByPage, (RTGCPTR32)pWritePageStart);
+    pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(CTXSUFF(&pVM->patm.s.PatchLookupTree)->PatchTreeByPage, (AVLOU32KEY)pWritePageStart);
     if (    !pPatchPage
         &&  pWritePageStart != pWritePageEnd
        )
     {
-        pPatchPage = (PPATMPATCHPAGE)RTAvloGCPtrGet(CTXSUFF(&pVM->patm.s.PatchLookupTree)->PatchTreeByPage, (RTGCPTR32)pWritePageEnd);
+        pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(CTXSUFF(&pVM->patm.s.PatchLookupTree)->PatchTreeByPage, (AVLOU32KEY)pWritePageEnd);
     }
 
 #ifdef LOG_ENABLED
     if (pPatchPage)
-        Log(("PATMIsWriteToPatchPage: Found page %VGv for write to %VGv %d bytes (page low:high %VGv:%VGv\n", pPatchPage->Core.Key, GCPtr, cbWrite, pPatchPage->pLowestAddrGC, pPatchPage->pHighestAddrGC));
+        Log(("PATMIsWriteToPatchPage: Found page %VRv for write to %VRv %d bytes (page low:high %VRv:%VRv\n", pPatchPage->Core.Key, GCPtr, cbWrite, pPatchPage->pLowestAddrGC, pPatchPage->pHighestAddrGC));
 #endif
 
     if (pPatchPage)
     {
-        if (    pPatchPage->pLowestAddrGC  > (RTGCPTR32)((RTGCUINTPTR)GCPtr + cbWrite - 1)
-            ||  pPatchPage->pHighestAddrGC < (RTGCPTR32)GCPtr)
+        if (    pPatchPage->pLowestAddrGC  > (RTRCPTR)((RTGCUINTPTR)GCPtr + cbWrite - 1)
+            ||  pPatchPage->pHighestAddrGC < (RTRCPTR)GCPtr)
         {
             /* This part of the page was not patched; try to emulate the instruction. */
             uint32_t cb;
 
-            LogFlow(("PATMHandleWriteToPatchPage: Interpret %VGv accessing %VGv\n", pRegFrame->eip, GCPtr));
-            int rc = EMInterpretInstruction(pVM, pRegFrame, GCPtr, &cb);
+            LogFlow(("PATMHandleWriteToPatchPage: Interpret %x accessing %VRv\n", pRegFrame->eip, GCPtr));
+            int rc = EMInterpretInstruction(pVM, pRegFrame, (RTGCPTR)GCPtr, &cb);
             if (rc == VINF_SUCCESS)
             {
@@ -162,10 +162,10 @@
     /* Very important check -> otherwise we have a security leak. */
     AssertReturn(!pRegFrame->eflags.Bits.u1VM && (pRegFrame->ss & X86_SEL_RPL) == 1, VERR_ACCESS_DENIED);
-    Assert(PATMIsPatchGCAddr(pVM, (RTGCPTR32)pRegFrame->eip));
+    Assert(PATMIsPatchGCAddr(pVM, (RTRCPTR)pRegFrame->eip));
 
     /* OP_ILLUD2 in PATM generated code? */
     if (CTXSUFF(pVM->patm.s.pGCState)->uPendingAction)
     {
-        LogFlow(("PATMGC: Pending action %x at %VGv\n", CTXSUFF(pVM->patm.s.pGCState)->uPendingAction, pRegFrame->eip));
+        LogFlow(("PATMGC: Pending action %x at %x\n", CTXSUFF(pVM->patm.s.pGCState)->uPendingAction, pRegFrame->eip));
 
         /* Private PATM interface (@todo hack due to lack of anything generic). */
@@ -188,9 +188,9 @@
                  *  edi = PATCHJUMPTABLE ptr
                  */
-                AssertMsg(!pRegFrame->edi || PATMIsPatchGCAddr(pVM, (RTGCPTR32)pRegFrame->edi), ("edx = %VGv\n", pRegFrame->edi));
-
-                Log(("PATMGC: lookup %VGv jump table=%VGv\n", pRegFrame->edx, pRegFrame->edi));
-
-                pRec = PATMQueryFunctionPatch(pVM, (RTGCPTR32)(pRegFrame->edx));
+                AssertMsg(!pRegFrame->edi || PATMIsPatchGCAddr(pVM, (RTRCPTR)pRegFrame->edi), ("edx = %x\n", pRegFrame->edi));
+
+                Log(("PATMGC: lookup %x jump table=%x\n", pRegFrame->edx, pRegFrame->edi));
+
+                pRec = PATMQueryFunctionPatch(pVM, (RTRCPTR)(pRegFrame->edx));
                 if (pRec)
                 {
@@ -198,5 +198,5 @@
                     {
                         RTGCUINTPTR pRelAddr = pRec->patch.pPatchBlockOffset;   /* make it relative */
-                        rc = PATMAddBranchToLookupCache(pVM, (RTGCPTR32)pRegFrame->edi, (RTGCPTR32)pRegFrame->edx, pRelAddr);
+                        rc = PATMAddBranchToLookupCache(pVM, (RTRCPTR)pRegFrame->edi, (RTRCPTR)pRegFrame->edx, pRelAddr);
                         if (rc == VINF_SUCCESS)
                         {
@@ -236,5 +236,5 @@
                  *  edi = GC address to jump to
                  */
-                Log(("PATMGC: Dispatch pending interrupt; eip=%VGv->%VGv\n", pRegFrame->eip, pRegFrame->edi));
+                Log(("PATMGC: Dispatch pending interrupt; eip=%x->%x\n", pRegFrame->eip, pRegFrame->edi));
 
                 /* Change EIP to the guest address the patch would normally jump to after setting IF. */
@@ -262,5 +262,5 @@
                  *  edi = GC address to jump to
                  */
-                Log(("PATMGC: Dispatch pending interrupt (iret); eip=%VGv->%VGv\n", pRegFrame->eip, pRegFrame->edi));
+                Log(("PATMGC: Dispatch pending interrupt (iret); eip=%x->%x\n", pRegFrame->eip, pRegFrame->edi));
                 Assert(pVM->patm.s.CTXSUFF(pGCState)->Restore.uFlags == (PATM_RESTORE_EAX|PATM_RESTORE_ECX|PATM_RESTORE_EDI));
                 Assert(pVM->patm.s.CTXSUFF(pGCState)->fPIF == 0);
@@ -281,5 +281,5 @@
             case PATM_ACTION_DO_V86_IRET:
             {
-                Log(("PATMGC: Do iret to V86 code; eip=%VGv\n", pRegFrame->eip));
+                Log(("PATMGC: Do iret to V86 code; eip=%x\n", pRegFrame->eip));
                 Assert(pVM->patm.s.CTXSUFF(pGCState)->Restore.uFlags == (PATM_RESTORE_EAX|PATM_RESTORE_ECX));
                 Assert(pVM->patm.s.CTXSUFF(pGCState)->fPIF == 0);
@@ -306,30 +306,30 @@
 #ifdef DEBUG
             case PATM_ACTION_LOG_CLI:
-                Log(("PATMGC: CLI at %VGv (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) ));
+                Log(("PATMGC: CLI at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) ));
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
                 return VINF_SUCCESS;
 
             case PATM_ACTION_LOG_STI:
-                Log(("PATMGC: STI at %VGv (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) ));
+                Log(("PATMGC: STI at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) ));
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
                 return VINF_SUCCESS;
 
             case PATM_ACTION_LOG_POPF_IF1:
-                Log(("PATMGC: POPF setting IF at %VGv (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));
+                Log(("PATMGC: POPF setting IF at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
                 return VINF_SUCCESS;
 
             case PATM_ACTION_LOG_POPF_IF0:
-                Log(("PATMGC: POPF at %VGv (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));
+                Log(("PATMGC: POPF at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
                 return VINF_SUCCESS;
 
             case PATM_ACTION_LOG_PUSHF:
-                Log(("PATMGC: PUSHF at %VGv (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) ));
+                Log(("PATMGC: PUSHF at %x (current IF=%d iopl=%d)\n", pRegFrame->eip, !!(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags & X86_EFL_IF), X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags) ));
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
                 return VINF_SUCCESS;
 
             case PATM_ACTION_LOG_IF1:
-                Log(("PATMGC: IF=1 escape from %VGv\n", pRegFrame->eip));
+                Log(("PATMGC: IF=1 escape from %x\n", pRegFrame->eip));
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
                 return VINF_SUCCESS;
@@ -362,15 +362,15 @@
                             if (rc == VINF_SUCCESS)
                             {
-                                Log(("PATMGC: IRET->VM stack frame: return address %04X:%VGv eflags=%08x ss:esp=%04X:%VGv\n", selCS, eip, uEFlags, selSS, esp));
+                                Log(("PATMGC: IRET->VM stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp));
                                 Log(("PATMGC: IRET->VM stack frame: DS=%04X ES=%04X FS=%04X GS=%04X\n", selDS, selES, selFS, selGS));
                             }
                         }
                         else
-                            Log(("PATMGC: IRET stack frame: return address %04X:%VGv eflags=%08x ss:esp=%04X:%VGv\n", selCS, eip, uEFlags, selSS, esp));
+                            Log(("PATMGC: IRET stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp));
                     }
                     else
-                        Log(("PATMGC: IRET stack frame: return address %04X:%VGv eflags=%08x\n", selCS, eip, uEFlags));
+                        Log(("PATMGC: IRET stack frame: return address %04X:%x eflags=%08x\n", selCS, eip, uEFlags));
                 }
-                Log(("PATMGC: IRET from %VGv (IF->1) current eflags=%x\n", pRegFrame->eip, pVM->patm.s.CTXSUFF(pGCState)->uVMFlags));
+                Log(("PATMGC: IRET from %x (IF->1) current eflags=%x\n", pRegFrame->eip, pVM->patm.s.CTXSUFF(pGCState)->uVMFlags));
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
                 return VINF_SUCCESS;
@@ -404,13 +404,13 @@
                             if (rc == VINF_SUCCESS)
                             {
-                                Log(("PATMGC: GATE->VM stack frame: return address %04X:%VGv eflags=%08x ss:esp=%04X:%VGv\n", selCS, eip, uEFlags, selSS, esp));
+                                Log(("PATMGC: GATE->VM stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp));
                                 Log(("PATMGC: GATE->VM stack frame: DS=%04X ES=%04X FS=%04X GS=%04X\n", selDS, selES, selFS, selGS));
                             }
                         }
                         else
-                            Log(("PATMGC: GATE stack frame: return address %04X:%VGv eflags=%08x ss:esp=%04X:%VGv\n", selCS, eip, uEFlags, selSS, esp));
+                            Log(("PATMGC: GATE stack frame: return address %04X:%x eflags=%08x ss:esp=%04X:%x\n", selCS, eip, uEFlags, selSS, esp));
                     }
                     else
-                        Log(("PATMGC: GATE stack frame: return address %04X:%VGv eflags=%08x\n", selCS, eip, uEFlags));
+                        Log(("PATMGC: GATE stack frame: return address %04X:%x eflags=%08x\n", selCS, eip, uEFlags));
                 }
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
@@ -419,10 +419,10 @@
 
             case PATM_ACTION_LOG_RET:
-                Log(("PATMGC: RET to %VGv ESP=%VGv iopl=%d\n", pRegFrame->edx, pRegFrame->ebx, X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));
+                Log(("PATMGC: RET to %x ESP=%x iopl=%d\n", pRegFrame->edx, pRegFrame->ebx, X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
                 return VINF_SUCCESS;
 
             case PATM_ACTION_LOG_CALL:
-                Log(("PATMGC: CALL to %VGv return addr %VGv ESP=%VGv iopl=%d\n", pVM->patm.s.CTXSUFF(pGCState)->GCCallPatchTargetAddr, pVM->patm.s.CTXSUFF(pGCState)->GCCallReturnAddr, pRegFrame->edx, X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));
+                Log(("PATMGC: CALL to %VRv return addr %VRv ESP=%x iopl=%d\n", pVM->patm.s.CTXSUFF(pGCState)->GCCallPatchTargetAddr, pVM->patm.s.CTXSUFF(pGCState)->GCCallReturnAddr, pRegFrame->edx, X86_EFL_GET_IOPL(pVM->patm.s.CTXSUFF(pGCState)->uVMFlags)));
                 pRegFrame->eip += PATM_ILLEGAL_INSTR_SIZE;
                 return VINF_SUCCESS;
@@ -437,5 +437,5 @@
         CTXSUFF(pVM->patm.s.pGCState)->uPendingAction = 0;
     }
-    AssertMsgFailed(("Unexpected OP_ILLUD2 in patch code at %VGv (pending action %x)!!!!\n", pRegFrame->eip, CTXSUFF(pVM->patm.s.pGCState)->uPendingAction));
+    AssertMsgFailed(("Unexpected OP_ILLUD2 in patch code at %x (pending action %x)!!!!\n", pRegFrame->eip, CTXSUFF(pVM->patm.s.pGCState)->uPendingAction));
     return VINF_EM_RAW_EMULATE_INSTR;
 }
@@ -457,5 +457,5 @@
 
     /* Int 3 in PATM generated code? (most common case) */
-    if (PATMIsPatchGCAddr(pVM, (RTGCPTR32)pRegFrame->eip))
+    if (PATMIsPatchGCAddr(pVM, (RTRCPTR)pRegFrame->eip))
     {
         /* @note hardcoded assumption about it being a single byte int 3 instruction. */
@@ -465,5 +465,5 @@
 
     /** @todo could use simple caching here to speed things up. */
-    pRec = (PPATMPATCHREC)RTAvloGCPtrGet(&CTXSUFF(pVM->patm.s.PatchLookupTree)->PatchTree, (RTGCPTR32)(pRegFrame->eip - 1));  /* eip is pointing to the instruction *after* 'int 3' already */
+    pRec = (PPATMPATCHREC)RTAvloU32Get(&CTXSUFF(pVM->patm.s.PatchLookupTree)->PatchTree, (AVLOU32KEY)(pRegFrame->eip - 1));  /* eip is pointing to the instruction *after* 'int 3' already */
     if (pRec && pRec->patch.uState == PATCH_ENABLED)
     {
@@ -487,5 +487,5 @@
             PATM_STAT_RUN_INC(&pRec->patch);
 
-            Log(("PATMHandleInt3PatchTrap found int3 for %s at %VGv\n", patmGetInstructionString(pRec->patch.opcode, 0), pRegFrame->eip));
+            Log(("PATMHandleInt3PatchTrap found int3 for %s at %x\n", patmGetInstructionString(pRec->patch.opcode, 0), pRegFrame->eip));
 
             switch(pRec->patch.opcode)
