Changeset 13834 in vbox
- Timestamp:
- Nov 5, 2008 2:21:20 AM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmCore.cpp
r13833 r13834 1287 1287 pParam->size = sizeof(uint64_t); 1288 1288 1289 disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0% VX64h", pParam->parval);1289 disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0%RX64h", pParam->parval); 1290 1290 return sizeof(uint64_t); 1291 1291 } … … 1334 1334 pParam->flags |= USE_IMMEDIATE64; 1335 1335 pParam->size = sizeof(uint64_t); 1336 disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0% VX64h", pParam->parval);1336 disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0%RX64h", pParam->parval); 1337 1337 } 1338 1338 else … … 1397 1397 pParam->size = sizeof(int64_t); 1398 1398 1399 disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), " (0% VX64h)", pParam->parval);1399 disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), " (0%RX64h)", pParam->parval); 1400 1400 return sizeof(int32_t); 1401 1401 } -
trunk/src/VBox/VMM/CPUM.cpp
r13833 r13834 1110 1110 "%srip=%016RX64 %srsp=%016RX64 %srbp=%016RX64 %siopl=%d %*s\n" 1111 1111 "%scs=%04x %sss=%04x %sds=%04x %ses=%04x %sfs=%04x %sgs=%04x %str=%04x %seflags=%08x\n" 1112 "%scr0=%08RX64 %scr2=%08RX64 %scr3=%08RX64 %scr4=%08RX64 %sgdtr=% VGv:%04x %sldtr=%04x\n"1112 "%scr0=%08RX64 %scr2=%08RX64 %scr3=%08RX64 %scr4=%08RX64 %sgdtr=%016RX64:%04x %sldtr=%04x\n" 1113 1113 , 1114 1114 pszPrefix, pCtxCore->rax, pszPrefix, pCtxCore->rbx, pszPrefix, pCtxCore->rcx, pszPrefix, pCtxCore->rdx, pszPrefix, pCtxCore->rsi, pszPrefix, pCtxCore->rdi, … … 2220 2220 if (!RT_SUCCESS(rc)) 2221 2221 { 2222 AssertMsgFailed(("SELMR3GetShadowSelectorInfo failed for %04X:% VGv rc=%d\n", pCtx->cs, GCPtrPC, rc));2222 AssertMsgFailed(("SELMR3GetShadowSelectorInfo failed for %04X:%RGv rc=%d\n", pCtx->cs, GCPtrPC, rc)); 2223 2223 return rc; 2224 2224 } … … 2230 2230 if (!RT_SUCCESS(rc)) 2231 2231 { 2232 AssertMsgFailed(("SELMSelInfoValidateCS failed for %04X:% VGv rc=%d\n", pCtx->cs, GCPtrPC, rc));2232 AssertMsgFailed(("SELMSelInfoValidateCS failed for %04X:%RGv rc=%d\n", pCtx->cs, GCPtrPC, rc)); 2233 2233 return rc; 2234 2234 } … … 2273 2273 } 2274 2274 else 2275 Log(("CPUMR3DisasmInstrCPU: DISInstr failed for %04X:% VGv rc=%Vrc\n", pCtx->cs, GCPtrPC, rc));2275 Log(("CPUMR3DisasmInstrCPU: DISInstr failed for %04X:%RGv rc=%Rrc\n", pCtx->cs, GCPtrPC, rc)); 2276 2276 2277 2277 /* Release mapping lock acquired in cpumR3DisasInstrRead. */ -
trunk/src/VBox/VMM/PATM/PATM.cpp
r13833 r13834 122 122 if (RT_FAILURE(rc)) 123 123 { 124 Log(("MMR3HyperAlloc failed with % Vrc\n", rc));124 Log(("MMR3HyperAlloc failed with %Rrc\n", rc)); 125 125 return rc; 126 126 } … … 284 284 int rc = PGMMapSetPage(pVM, pVM->patm.s.pGCStateGC, PAGE_SIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW); 285 285 if (RT_FAILURE(rc)) 286 Log(("PATMR3InitFinalize: PGMMapSetPage failed with % Vrc!!\n", rc));286 Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Rrc!!\n", rc)); 287 287 288 288 rc = PGMMapSetPage(pVM, pVM->patm.s.pGCStackGC, PATM_STACK_TOTAL_SIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW); 289 289 if (RT_FAILURE(rc)) 290 Log(("PATMR3InitFinalize: PGMMapSetPage failed with % Vrc!!\n", rc));290 Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Rrc!!\n", rc)); 291 291 292 292 rc = PGMMapSetPage(pVM, pVM->patm.s.pStatsGC, PATM_STAT_MEMSIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW); 293 293 if (RT_FAILURE(rc)) 294 Log(("PATMR3InitFinalize: PGMMapSetPage failed with % Vrc!!\n", rc));294 Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Rrc!!\n", rc)); 295 295 296 296 return rc; … … 327 327 AssertReleaseMsg(pVM->patm.s.pGCStateGC, ("Impossible! MMHyperHC2GC(%p) failed!\n", pVM->patm.s.pGCStateGC)); 328 328 329 Log(("Patch memory allocated at %p - % VRv\n", pVM->patm.s.pPatchMemHC, pVM->patm.s.pPatchMemGC));329 Log(("Patch memory allocated at %p - %RRv\n", pVM->patm.s.pPatchMemHC, pVM->patm.s.pPatchMemGC)); 330 330 pVM->patm.s.pGCStateHC->uVMFlags = X86_EFL_IF; 331 331 … … 415 415 RTRCINTPTR delta = GCPtrNew - pVM->patm.s.pGCStateGC; 416 416 417 Log(("PATMR3Relocate from % VRv to %VRv - delta %08X\n", pVM->patm.s.pGCStateGC, GCPtrNew, delta));417 Log(("PATMR3Relocate from %RRv to %RRv - delta %08X\n", pVM->patm.s.pGCStateGC, GCPtrNew, delta)); 418 418 if (delta) 419 419 { … … 636 636 { 637 637 case FIXUP_ABSOLUTE: 638 Log(("Absolute fixup at % VRv %VHv -> %VHv at %VRv\n", pRec->pSource, *(RTRCUINTPTR *)pRec->pRelocPos, *(RTRCINTPTR*)pRec->pRelocPos + delta, pRec->pRelocPos));638 Log(("Absolute fixup at %RRv %RHv -> %RHv at %RRv\n", pRec->pSource, *(RTRCUINTPTR *)pRec->pRelocPos, *(RTRCINTPTR*)pRec->pRelocPos + delta, pRec->pRelocPos)); 639 639 if (!pRec->pSource || PATMIsPatchGCAddr(pVM, pRec->pSource)) 640 640 { … … 1066 1066 1067 1067 /* Failure for some reason -> mark exit point with int 3. */ 1068 Log(("Failed to install function replacement patch (at %x) for reason % Vrc\n", pOrgInstrGC, rc));1068 Log(("Failed to install function replacement patch (at %x) for reason %Rrc\n", pOrgInstrGC, rc)); 1069 1069 1070 1070 pPatchGC = patmGuestGCPtrToPatchGCPtr(pVM, pPatch, pOrgInstrGC); … … 1081 1081 else 1082 1082 { 1083 Log(("Patch block % VRv called as function\n", pFunctionRec->patch.pPrivInstrGC));1083 Log(("Patch block %RRv called as function\n", pFunctionRec->patch.pPrivInstrGC)); 1084 1084 pFunctionRec->patch.flags |= PATMFL_CODE_REFERENCED; 1085 1085 } … … 1307 1307 if (pPatch->cbPatchBlockSize >= MAX_PATCH_SIZE) 1308 1308 { 1309 Log(("Code block too big (%x) for patch at % VRv!!\n", pPatch->cbPatchBlockSize, pCurInstrGC));1309 Log(("Code block too big (%x) for patch at %RRv!!\n", pPatch->cbPatchBlockSize, pCurInstrGC)); 1310 1310 fIllegalInstr = true; 1311 1311 patmAddIllegalInstrRecord(pVM, pPatch, pCurInstrGC); … … 1431 1431 { 1432 1432 // The end marker for this kind of patch is any instruction at a location outside our patch jump 1433 Log(("End of block at % VRv size %d\n", pCurInstrGC, pCpu->opsize));1433 Log(("End of block at %RRv size %d\n", pCurInstrGC, pCpu->opsize)); 1434 1434 return VINF_SUCCESS; 1435 1435 } … … 1463 1463 if (pPatch->cbPatchBlockSize >= MAX_PATCH_SIZE) 1464 1464 { 1465 Log(("Code block too big (%x) for function patch at % VRv!!\n", pPatch->cbPatchBlockSize, pCurInstrGC));1465 Log(("Code block too big (%x) for function patch at %RRv!!\n", pPatch->cbPatchBlockSize, pCurInstrGC)); 1466 1466 fIllegalInstr = true; 1467 1467 patmAddIllegalInstrRecord(pVM, pPatch, pCurInstrGC); … … 1560 1560 bool fInhibitIRQInstr = false; /* did the instruction cause PATMFL_INHIBITIRQS to be set? */ 1561 1561 1562 LogFlow(("patmRecompileCallback % VRv %VRv\n", pInstrGC, pCurInstrGC));1562 LogFlow(("patmRecompileCallback %RRv %RRv\n", pInstrGC, pCurInstrGC)); 1563 1563 1564 1564 if ( patmGuestGCPtrToPatchGCPtr(pVM, pPatch, pCurInstrGC) != 0 … … 1569 1569 * no need to record this instruction as it's glue code that never crashes (it had better not!) 1570 1570 */ 1571 Log(("patmRecompileCallback: jump to code we've recompiled before % VRv!\n", pCurInstrGC));1571 Log(("patmRecompileCallback: jump to code we've recompiled before %RRv!\n", pCurInstrGC)); 1572 1572 return patmPatchGenRelJump(pVM, pPatch, pCurInstrGC, OP_JMP, !!(pCpu->prefix & PREFIX_OPSIZE)); 1573 1573 } … … 1602 1602 if (patmIsIllegalInstr(pPatch, pCurInstrGC)) 1603 1603 { 1604 Log(("Illegal instruction at % VRv -> mark with int 3\n", pCurInstrGC));1604 Log(("Illegal instruction at %RRv -> mark with int 3\n", pCurInstrGC)); 1605 1605 rc = patmPatchGenIllegalInstr(pVM, pPatch); 1606 1606 goto end; … … 1667 1667 && (pCpu->param1.base.reg_seg == DIS_SELREG_SS)) 1668 1668 { 1669 Log(("Force recompilation of next instruction for OP_MOV at % VRv\n", pCurInstrGC));1669 Log(("Force recompilation of next instruction for OP_MOV at %RRv\n", pCurInstrGC)); 1670 1670 pPatch->flags |= PATMFL_RECOMPILE_NEXT; 1671 1671 /** @todo this could cause a fault (ring 0 selector being loaded in ring 1) */ … … 1692 1692 Assert(pCpu->pCurInstr->optype & OPTYPE_INHIBIT_IRQS); 1693 1693 1694 Log(("Force recompilation of next instruction for OP_MOV at % VRv\n", pCurInstrGC));1694 Log(("Force recompilation of next instruction for OP_MOV at %RRv\n", pCurInstrGC)); 1695 1695 pPatch->flags |= PATMFL_RECOMPILE_NEXT; 1696 1696 } … … 1707 1707 fInhibitIRQInstr = true; 1708 1708 pNextInstrGC = pCurInstrGC + pCpu->opsize; 1709 Log(("Inhibit irqs for instruction OP_STI at % VRv\n", pCurInstrGC));1709 Log(("Inhibit irqs for instruction OP_STI at %RRv\n", pCurInstrGC)); 1710 1710 } 1711 1711 rc = patmPatchGenSti(pVM, pPatch, pCurInstrGC, pNextInstrGC); … … 1804 1804 1805 1805 case OP_IRET: 1806 Log(("IRET at % VRv\n", pCurInstrGC));1806 Log(("IRET at %RRv\n", pCurInstrGC)); 1807 1807 rc = patmPatchGenIret(pVM, pPatch, pCurInstrGC, !!(pCpu->prefix & PREFIX_OPSIZE)); 1808 1808 if (RT_SUCCESS(rc)) … … 1942 1942 1943 1943 pPatch->flags &= ~PATMFL_INHIBIT_IRQS; 1944 Log(("Clear inhibit IRQ flag at % VRv\n", pCurInstrGC));1944 Log(("Clear inhibit IRQ flag at %RRv\n", pCurInstrGC)); 1945 1945 if (pPatch->flags & PATMFL_GENERATE_JUMPTOGUEST) 1946 1946 { 1947 Log(("patmRecompileCallback: generate jump back to guest (% VRv) after fused instruction\n", pNextInstrGC));1947 Log(("patmRecompileCallback: generate jump back to guest (%RRv) after fused instruction\n", pNextInstrGC)); 1948 1948 1949 1949 rc2 = patmPatchGenJumpToGuest(pVM, pPatch, pNextInstrGC, true /* clear inhibit irq flag */); … … 1971 1971 1972 1972 // The end marker for this kind of patch is any instruction at a location outside our patch jump 1973 Log(("patmRecompileCallback: end found for single instruction patch at % VRv opsize %d\n", pNextInstrGC, pCpu->opsize));1973 Log(("patmRecompileCallback: end found for single instruction patch at %RRv opsize %d\n", pNextInstrGC, pCpu->opsize)); 1974 1974 1975 1975 rc = patmPatchGenJumpToGuest(pVM, pPatch, pNextInstrGC); … … 2121 2121 2122 2122 if (pOrgInstrGC != pPatch->pTempInfo->pLastDisasmInstrGC) 2123 Log(("DIS % VRv<-%s", pOrgInstrGC, szOutput));2123 Log(("DIS %RRv<-%s", pOrgInstrGC, szOutput)); 2124 2124 else 2125 2125 Log(("DIS %s", szOutput)); … … 2276 2276 cpu.mode = (pPatch->flags & PATMFL_CODE32) ? CPUMODE_32BIT : CPUMODE_16BIT; 2277 2277 2278 ////Log(("patmRecompileCodeStream % VRv %VRv\n", pInstrGC, pCurInstrGC));2278 ////Log(("patmRecompileCodeStream %RRv %RRv\n", pInstrGC, pCurInstrGC)); 2279 2279 2280 2280 pCurInstrHC = PATMGCVirtToHCVirt(pVM, pPatch, pCurInstrGC); … … 2313 2313 RTRCPTR pNextInstrGC = pCurInstrGC + opsize; 2314 2314 2315 Log(("patmRecompileCodeStream: irqs inhibited by instruction % VRv\n", pNextInstrGC));2315 Log(("patmRecompileCodeStream: irqs inhibited by instruction %RRv\n", pNextInstrGC)); 2316 2316 2317 2317 /* Certain instructions (e.g. sti) force the next instruction to be executed before any interrupts can occur. … … 2386 2386 } 2387 2387 2388 Log(("Jump encountered target % VRv\n", addr));2388 Log(("Jump encountered target %RRv\n", addr)); 2389 2389 2390 2390 /* We don't check if the branch target lies in a valid page as we've already done that in the analysis phase. */ … … 2415 2415 if(pTargetPatch) 2416 2416 { 2417 Log(("Found active patch at target % VRv (%VRv) -> temporarily disabling it!!\n", addr, pTargetPatch->pPrivInstrGC));2417 Log(("Found active patch at target %RRv (%RRv) -> temporarily disabling it!!\n", addr, pTargetPatch->pPrivInstrGC)); 2418 2418 PATMR3DisablePatch(pVM, pTargetPatch->pPrivInstrGC); 2419 2419 } … … 2766 2766 * Insert into patch to guest lookup tree 2767 2767 */ 2768 LogFlow(("Insert % VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));2768 LogFlow(("Insert %RRv patch offset %RRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset)); 2769 2769 pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset; 2770 2770 rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset); … … 2800 2800 /*uint8_t ASMInt3 = 0xCC; - unused */ 2801 2801 2802 Log(("PATMR3PatchBlock % VRv -> int 3 callable patch.\n", pPatch->pPrivInstrGC));2802 Log(("PATMR3PatchBlock %RRv -> int 3 callable patch.\n", pPatch->pPrivInstrGC)); 2803 2803 /* Replace first opcode byte with 'int 3'. */ 2804 2804 rc = patmActivateInt3Patch(pVM, pPatch); … … 2833 2833 pPatch->pTempInfo->nrIllegalInstr = 0; 2834 2834 2835 Log(("Successfully installed %s patch at % VRv\n", patmGetInstructionString(pPatch->opcode, pPatch->flags), pInstrGC));2835 Log(("Successfully installed %s patch at %RRv\n", patmGetInstructionString(pPatch->opcode, pPatch->flags), pInstrGC)); 2836 2836 2837 2837 pPatch->uState = PATCH_ENABLED; … … 2970 2970 Log(("Patch code ends -----------------------------------------------------\n")); 2971 2971 #endif 2972 Log(("Successfully installed IDT handler patch at % VRv\n", pInstrGC));2972 Log(("Successfully installed IDT handler patch at %RRv\n", pInstrGC)); 2973 2973 2974 2974 /* 2975 2975 * Insert into patch to guest lookup tree 2976 2976 */ 2977 LogFlow(("Insert % VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));2977 LogFlow(("Insert %RRv patch offset %RRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset)); 2978 2978 pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset; 2979 2979 rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset); … … 3053 3053 Log(("TRAP handler patch: %s", szOutput)); 3054 3054 #endif 3055 Log(("Successfully installed Trap Trampoline patch at % VRv\n", pInstrGC));3055 Log(("Successfully installed Trap Trampoline patch at %RRv\n", pInstrGC)); 3056 3056 3057 3057 /* 3058 3058 * Insert into patch to guest lookup tree 3059 3059 */ 3060 LogFlow(("Insert % VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));3060 LogFlow(("Insert %RRv patch offset %RRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset)); 3061 3061 pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset; 3062 3062 rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset); … … 3118 3118 uint32_t orgOffsetPatchMem = ~0; 3119 3119 3120 Log(("patmDuplicateFunction % VRv\n", pInstrGC));3120 Log(("patmDuplicateFunction %RRv\n", pInstrGC)); 3121 3121 /* Save original offset (in case of failures later on). */ 3122 3122 orgOffsetPatchMem = pVM->patm.s.offPatchMem; … … 3173 3173 * Insert into patch to guest lookup tree 3174 3174 */ 3175 LogFlow(("Insert % VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));3175 LogFlow(("Insert %RRv patch offset %RRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset)); 3176 3176 pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset; 3177 3177 rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset); … … 3197 3197 #endif 3198 3198 3199 Log(("Successfully installed function duplication patch at % VRv\n", pInstrGC));3199 Log(("Successfully installed function duplication patch at %RRv\n", pInstrGC)); 3200 3200 3201 3201 patmEmptyTree(pVM, &pPatch->pTempInfo->IllegalInstrTree); … … 3228 3228 3229 3229 pVM->patm.s.ulCallDepth--; 3230 Log(("patmDupicateFunction % VRv failed!!\n", pInstrGC));3230 Log(("patmDupicateFunction %RRv failed!!\n", pInstrGC)); 3231 3231 return rc; 3232 3232 } … … 3248 3248 int rc = VERR_PATCHING_REFUSED; 3249 3249 3250 Log(("patmCreateTrampoline % VRv\n", pInstrGC));3250 Log(("patmCreateTrampoline %RRv\n", pInstrGC)); 3251 3251 /* Save original offset (in case of failures later on). */ 3252 3252 orgOffsetPatchMem = pVM->patm.s.offPatchMem; … … 3279 3279 pPatchToGuestRec->fJumpTarget = true; 3280 3280 Assert(pPatchTargetGC != pPatch->pPrivInstrGC); 3281 Log(("patmCreateTrampoline: generating jump to code inside patch at % VRv\n", pPatch->pPrivInstrGC));3281 Log(("patmCreateTrampoline: generating jump to code inside patch at %RRv\n", pPatch->pPrivInstrGC)); 3282 3282 pPatch->flags |= PATMFL_EXTERNAL_JUMP_INSIDE; 3283 3283 break; … … 3311 3311 * Insert into patch to guest lookup tree 3312 3312 */ 3313 LogFlow(("Insert % VRv patch offset %VRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset));3313 LogFlow(("Insert %RRv patch offset %RRv\n", pPatchRec->patch.pPrivInstrGC, pPatch->pPatchBlockOffset)); 3314 3314 pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset; 3315 3315 rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset); … … 3516 3516 if (pPatchFunction == 0) 3517 3517 { 3518 AssertMsgFailed(("Unable to find duplicate function % VRv\n", pTargetGC));3518 AssertMsgFailed(("Unable to find duplicate function %RRv\n", pTargetGC)); 3519 3519 rc = VERR_PATCHING_REFUSED; 3520 3520 goto failure; … … 3544 3544 #endif 3545 3545 3546 Log(("Successfully installed function replacement patch at % VRv\n", pInstrGC));3546 Log(("Successfully installed function replacement patch at %RRv\n", pInstrGC)); 3547 3547 3548 3548 pPatch->uState = PATCH_ENABLED; … … 3888 3888 RTRCPTR pJmpDest = PATMR3GuestGCPtrToPatchGCPtr(pVM, pInstrGC + pCpu->opsize + (int32_t)pCpu->param1.parval); 3889 3889 3890 AssertMsg(pJmpDest, ("PATMR3GuestGCPtrToPatchGCPtr failed for % VRv\n", pInstrGC + pCpu->opsize + (int32_t)pCpu->param1.parval));3890 AssertMsg(pJmpDest, ("PATMR3GuestGCPtrToPatchGCPtr failed for %RRv\n", pInstrGC + pCpu->opsize + (int32_t)pCpu->param1.parval)); 3891 3891 pPatch->pPatchJumpDestGC = pJmpDest; 3892 3892 … … 3904 3904 #endif 3905 3905 3906 Log(("Successfully installed %s patch at % VRv\n", patmGetInstructionString(pPatch->opcode, pPatch->flags), pInstrGC));3906 Log(("Successfully installed %s patch at %RRv\n", patmGetInstructionString(pPatch->opcode, pPatch->flags), pInstrGC)); 3907 3907 3908 3908 STAM_COUNTER_INC(&pVM->patm.s.StatInstalledJump); … … 3937 3937 Assert(flags == PATMFL_CODE32); 3938 3938 3939 Log(("PATMR3AddHint % VRv\n", pInstrGC));3939 Log(("PATMR3AddHint %RRv\n", pInstrGC)); 3940 3940 return PATMR3InstallPatch(pVM, pInstrGC, PATMFL_CODE32 | PATMFL_INSTR_HINT); 3941 3941 } … … 3974 3974 { 3975 3975 PPATCHINFO pConflictPatch = PATMFindActivePatchByEntrypoint(pVM, pInstrGC); 3976 AssertReleaseMsg(pConflictPatch == 0, ("Unable to patch overwritten instruction at % VRv (%VRv)\n", pInstrGC, pConflictPatch->pPrivInstrGC));3976 AssertReleaseMsg(pConflictPatch == 0, ("Unable to patch overwritten instruction at %RRv (%RRv)\n", pInstrGC, pConflictPatch->pPrivInstrGC)); 3977 3977 if (pConflictPatch != 0) 3978 3978 return VERR_PATCHING_REFUSED; … … 3997 3997 if (pInstrGCFlat != pInstrGC) 3998 3998 { 3999 Log(("PATMR3InstallPatch: code selector not wide open: %04x:% VRv != %VRv eflags=%08x\n", pCtx->cs, pInstrGCFlat, pInstrGC, pCtx->eflags.u32));3999 Log(("PATMR3InstallPatch: code selector not wide open: %04x:%RRv != %RRv eflags=%08x\n", pCtx->cs, pInstrGCFlat, pInstrGC, pCtx->eflags.u32)); 4000 4000 return VERR_PATCHING_REFUSED; 4001 4001 } … … 4021 4021 if (pvPatchCoreOffset == NULL) 4022 4022 { 4023 AssertMsgFailed(("PATMR3InstallPatch: patch not found at address % VRv!!\n", pInstrGC));4023 AssertMsgFailed(("PATMR3InstallPatch: patch not found at address %RRv!!\n", pInstrGC)); 4024 4024 return VERR_PATCH_NOT_FOUND; //fatal error 4025 4025 } … … 4042 4042 if (pPatchRec->patch.uState == PATCH_DISABLE_PENDING) 4043 4043 { 4044 Log(("PATMR3InstallPatch: disable operation is pending for patch at % VRv\n", pPatchRec->patch.pPrivInstrGC));4044 Log(("PATMR3InstallPatch: disable operation is pending for patch at %RRv\n", pPatchRec->patch.pPrivInstrGC)); 4045 4045 PATMR3DisablePatch(pVM, pPatchRec->patch.pPrivInstrGC); 4046 4046 Assert(pPatchRec->patch.uState == PATCH_DISABLED); … … 4052 4052 if (pPatchRec->patch.flags & PATMFL_INSTR_HINT) 4053 4053 { 4054 Log(("Enabling HINTED patch % VRv\n", pInstrGC));4054 Log(("Enabling HINTED patch %RRv\n", pInstrGC)); 4055 4055 pPatchRec->patch.flags &= ~PATMFL_INSTR_HINT; 4056 4056 } 4057 4057 else 4058 Log(("Enabling patch % VRv again\n", pInstrGC));4058 Log(("Enabling patch %RRv again\n", pInstrGC)); 4059 4059 4060 4060 /** @todo we shouldn't disable and enable patches too often (it's relatively cheap, but pointless if it always happens) */ … … 4075 4075 { 4076 4076 /* Patch must have been overwritten; remove it and pretend nothing happened. */ 4077 Log(("Patch an existing patched instruction?!? (% VRv)\n", pInstrGC));4077 Log(("Patch an existing patched instruction?!? (%RRv)\n", pInstrGC)); 4078 4078 if (pPatchRec->patch.flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_IDTHANDLER|PATMFL_MMIO_ACCESS|PATMFL_INT3_REPLACEMENT|PATMFL_INT3_REPLACEMENT_BLOCK)) 4079 4079 { … … 4090 4090 else 4091 4091 { 4092 AssertMsg(pPatchRec->patch.uState == PATCH_REFUSED || pPatchRec->patch.uState == PATCH_UNUSABLE, ("Patch an existing patched instruction?!? (% VRv, state=%d)\n", pInstrGC, pPatchRec->patch.uState));4092 AssertMsg(pPatchRec->patch.uState == PATCH_REFUSED || pPatchRec->patch.uState == PATCH_UNUSABLE, ("Patch an existing patched instruction?!? (%RRv, state=%d)\n", pInstrGC, pPatchRec->patch.uState)); 4093 4093 /* already tried it once! */ 4094 4094 return VERR_PATCHING_REFUSED; … … 4111 4111 if (rc != VINF_SUCCESS) 4112 4112 { 4113 Log(("PGMGstGetPage failed with % Vrc\n", rc));4113 Log(("PGMGstGetPage failed with %Rrc\n", rc)); 4114 4114 return rc; 4115 4115 } … … 4143 4143 if (pPatchNear->patch.uState == PATCH_UNUSABLE && pInstrGC < pPatchNear->patch.pPrivInstrGC && pInstrGC + SIZEOF_NEARJUMP32 > pPatchNear->patch.pPrivInstrGC) 4144 4144 { 4145 Log(("Dangerous patch; would overwrite the ususable patch at % VRv\n", pPatchNear->patch.pPrivInstrGC));4145 Log(("Dangerous patch; would overwrite the ususable patch at %RRv\n", pPatchNear->patch.pPrivInstrGC)); 4146 4146 4147 4147 pPatchRec->patch.uState = PATCH_UNUSABLE; … … 4247 4247 { 4248 4248 if (rc == VINF_SUCCESS) 4249 Log(("PATMR3InstallPatch GUEST: %s % VRv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0));4249 Log(("PATMR3InstallPatch GUEST: %s %RRv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0)); 4250 4250 return rc; 4251 4251 } … … 4265 4265 if (rc == VINF_SUCCESS) 4266 4266 { 4267 Log(("PATMR3InstallPatch GUEST: %s % VRv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0));4267 Log(("PATMR3InstallPatch GUEST: %s %RRv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0)); 4268 4268 return VINF_SUCCESS; 4269 4269 } … … 4302 4302 case OP_PUSHF: 4303 4303 case OP_CLI: 4304 Log(("PATMR3InstallPatch %s % VRv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0));4304 Log(("PATMR3InstallPatch %s %RRv code32=%d\n", patmGetInstructionString(pPatchRec->patch.opcode, pPatchRec->patch.flags), pInstrGC, (flags & PATMFL_CODE32) ? 1 : 0)); 4305 4305 rc = PATMR3PatchBlock(pVM, pInstrGC, pInstrHC, cpu.pCurInstr->opcode, opsize, pPatchRec); 4306 4306 break; … … 4345 4345 pVM->patm.s.pPatchedInstrGCHighest = pPatchRec->patch.pInstrGCHighest; 4346 4346 4347 Log(("Patch lowest % VRv highest %VRv\n", pPatchRec->patch.pInstrGCLowest, pPatchRec->patch.pInstrGCHighest));4348 Log(("Global lowest % VRv highest %VRv\n", pVM->patm.s.pPatchedInstrGCLowest, pVM->patm.s.pPatchedInstrGCHighest));4347 Log(("Patch lowest %RRv highest %RRv\n", pPatchRec->patch.pInstrGCLowest, pPatchRec->patch.pInstrGCHighest)); 4348 Log(("Global lowest %RRv highest %RRv\n", pVM->patm.s.pPatchedInstrGCLowest, pVM->patm.s.pPatchedInstrGCHighest)); 4349 4349 4350 4350 STAM_COUNTER_ADD(&pVM->patm.s.StatInstalled, 1); … … 4365 4365 { 4366 4366 STAMR3RegisterCallback(pVM, &pPatchRec->patch, STAMVISIBILITY_NOT_GUI, STAMUNIT_GOOD_BAD, patmResetStat, patmPrintStat, "Patch statistics", 4367 "/PATM/Stats/Patch/0x% VRv", pPatchRec->patch.pPrivInstrGC);4367 "/PATM/Stats/Patch/0x%RRv", pPatchRec->patch.pPrivInstrGC); 4368 4368 #ifndef DEBUG_sandervl 4369 4369 /* Full breakdown for the GUI. */ 4370 4370 STAMR3RegisterF(pVM, &pVM->patm.s.pStatsHC[pPatchRec->patch.uPatchIdx], STAMTYPE_RATIO_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_GOOD_BAD, PATMPatchType(pVM, &pPatchRec->patch), 4371 "/PATM/Stats/PatchBD/0x% VRv", pPatchRec->patch.pPrivInstrGC);4372 STAMR3RegisterF(pVM, &pPatchRec->patch.cbPatchBlockSize,STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, NULL, "/PATM/Stats/PatchBD/0x% VRv/cbPatchBlockSize", pPatchRec->patch.pPrivInstrGC);4373 STAMR3RegisterF(pVM, &pPatchRec->patch.cbPatchJump, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, NULL, "/PATM/Stats/PatchBD/0x% VRv/cbPatchJump", pPatchRec->patch.pPrivInstrGC);4374 STAMR3RegisterF(pVM, &pPatchRec->patch.cbPrivInstr, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, NULL, "/PATM/Stats/PatchBD/0x% VRv/cbPrivInstr", pPatchRec->patch.pPrivInstrGC);4375 STAMR3RegisterF(pVM, &pPatchRec->patch.cCodeWrites, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x% VRv/cCodeWrites", pPatchRec->patch.pPrivInstrGC);4376 STAMR3RegisterF(pVM, &pPatchRec->patch.cInvalidWrites, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x% VRv/cInvalidWrites", pPatchRec->patch.pPrivInstrGC);4377 STAMR3RegisterF(pVM, &pPatchRec->patch.cTraps, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x% VRv/cTraps", pPatchRec->patch.pPrivInstrGC);4378 STAMR3RegisterF(pVM, &pPatchRec->patch.flags, STAMTYPE_X32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE, NULL, "/PATM/Stats/PatchBD/0x% VRv/flags", pPatchRec->patch.pPrivInstrGC);4379 STAMR3RegisterF(pVM, &pPatchRec->patch.nrJumpRecs, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x% VRv/nrJumpRecs", pPatchRec->patch.pPrivInstrGC);4380 STAMR3RegisterF(pVM, &pPatchRec->patch.nrFixups, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x% VRv/nrFixups", pPatchRec->patch.pPrivInstrGC);4381 STAMR3RegisterF(pVM, &pPatchRec->patch.opcode, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x% VRv/opcode", pPatchRec->patch.pPrivInstrGC);4382 STAMR3RegisterF(pVM, &pPatchRec->patch.uOldState, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE, NULL, "/PATM/Stats/PatchBD/0x% VRv/uOldState", pPatchRec->patch.pPrivInstrGC);4383 STAMR3RegisterF(pVM, &pPatchRec->patch.uOpMode, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE, NULL, "/PATM/Stats/PatchBD/0x% VRv/uOpMode", pPatchRec->patch.pPrivInstrGC);4371 "/PATM/Stats/PatchBD/0x%RRv", pPatchRec->patch.pPrivInstrGC); 4372 STAMR3RegisterF(pVM, &pPatchRec->patch.cbPatchBlockSize,STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, NULL, "/PATM/Stats/PatchBD/0x%RRv/cbPatchBlockSize", pPatchRec->patch.pPrivInstrGC); 4373 STAMR3RegisterF(pVM, &pPatchRec->patch.cbPatchJump, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, NULL, "/PATM/Stats/PatchBD/0x%RRv/cbPatchJump", pPatchRec->patch.pPrivInstrGC); 4374 STAMR3RegisterF(pVM, &pPatchRec->patch.cbPrivInstr, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES, NULL, "/PATM/Stats/PatchBD/0x%RRv/cbPrivInstr", pPatchRec->patch.pPrivInstrGC); 4375 STAMR3RegisterF(pVM, &pPatchRec->patch.cCodeWrites, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%RRv/cCodeWrites", pPatchRec->patch.pPrivInstrGC); 4376 STAMR3RegisterF(pVM, &pPatchRec->patch.cInvalidWrites, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%RRv/cInvalidWrites", pPatchRec->patch.pPrivInstrGC); 4377 STAMR3RegisterF(pVM, &pPatchRec->patch.cTraps, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%RRv/cTraps", pPatchRec->patch.pPrivInstrGC); 4378 STAMR3RegisterF(pVM, &pPatchRec->patch.flags, STAMTYPE_X32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE, NULL, "/PATM/Stats/PatchBD/0x%RRv/flags", pPatchRec->patch.pPrivInstrGC); 4379 STAMR3RegisterF(pVM, &pPatchRec->patch.nrJumpRecs, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%RRv/nrJumpRecs", pPatchRec->patch.pPrivInstrGC); 4380 STAMR3RegisterF(pVM, &pPatchRec->patch.nrFixups, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%RRv/nrFixups", pPatchRec->patch.pPrivInstrGC); 4381 STAMR3RegisterF(pVM, &pPatchRec->patch.opcode, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, NULL, "/PATM/Stats/PatchBD/0x%RRv/opcode", pPatchRec->patch.pPrivInstrGC); 4382 STAMR3RegisterF(pVM, &pPatchRec->patch.uOldState, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE, NULL, "/PATM/Stats/PatchBD/0x%RRv/uOldState", pPatchRec->patch.pPrivInstrGC); 4383 STAMR3RegisterF(pVM, &pPatchRec->patch.uOpMode, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE, NULL, "/PATM/Stats/PatchBD/0x%RRv/uOpMode", pPatchRec->patch.pPrivInstrGC); 4384 4384 /// @todo change the state to be a callback so we can get a state mnemonic instead. 4385 STAMR3RegisterF(pVM, &pPatchRec->patch.uState, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE, NULL, "/PATM/Stats/PatchBD/0x% VRv/uState", pPatchRec->patch.pPrivInstrGC);4385 STAMR3RegisterF(pVM, &pPatchRec->patch.uState, STAMTYPE_U32, STAMVISIBILITY_ALWAYS, STAMUNIT_NONE, NULL, "/PATM/Stats/PatchBD/0x%RRv/uState", pPatchRec->patch.pPrivInstrGC); 4386 4386 #endif 4387 4387 } … … 4431 4431 int rc; 4432 4432 4433 Log(("patmAddPatchToPage: insert patch % VHv to page %VRv\n", pPatch, pPage));4433 Log(("patmAddPatchToPage: insert patch %RHv to page %RRv\n", pPatch, pPage)); 4434 4434 4435 4435 pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, pPage); … … 4489 4489 if (pGuestToPatchRec) 4490 4490 { 4491 LogFlow(("patmAddPatchToPage: lowest patch page address % VRv current lowest %VRv\n", pGuestToPatchRec->Core.Key, pPatchPage->pLowestAddrGC));4491 LogFlow(("patmAddPatchToPage: lowest patch page address %RRv current lowest %RRv\n", pGuestToPatchRec->Core.Key, pPatchPage->pLowestAddrGC)); 4492 4492 if ( pPatchPage->pLowestAddrGC == 0 4493 4493 || pPatchPage->pLowestAddrGC > (RTRCPTR)pGuestToPatchRec->Core.Key) … … 4510 4510 { 4511 4511 pPatchPage->pLowestAddrGC = pPage; 4512 LogFlow(("patmAddPatchToPage: new lowest % VRv\n", pPatchPage->pLowestAddrGC));4512 LogFlow(("patmAddPatchToPage: new lowest %RRv\n", pPatchPage->pLowestAddrGC)); 4513 4513 } 4514 4514 } … … 4522 4522 if (pGuestToPatchRec) 4523 4523 { 4524 LogFlow(("patmAddPatchToPage: highest patch page address % VRv current lowest %VRv\n", pGuestToPatchRec->Core.Key, pPatchPage->pHighestAddrGC));4524 LogFlow(("patmAddPatchToPage: highest patch page address %RRv current lowest %RRv\n", pGuestToPatchRec->Core.Key, pPatchPage->pHighestAddrGC)); 4525 4525 if ( pPatchPage->pHighestAddrGC == 0 4526 4526 || pPatchPage->pHighestAddrGC <= (RTRCPTR)pGuestToPatchRec->Core.Key) … … 4531 4531 //// Assert(size); 4532 4532 pPatchPage->pHighestAddrGC += size; 4533 LogFlow(("patmAddPatchToPage: new highest % VRv\n", pPatchPage->pHighestAddrGC));4533 LogFlow(("patmAddPatchToPage: new highest %RRv\n", pPatchPage->pHighestAddrGC)); 4534 4534 } 4535 4535 } … … 4559 4559 Assert(pPatchPage->cCount <= pPatchPage->cMaxPatches); 4560 4560 4561 Log(("patmRemovePatchPage: remove patch % VHv from page %VRv\n", pPatch, pPage));4561 Log(("patmRemovePatchPage: remove patch %RHv from page %RRv\n", pPatch, pPage)); 4562 4562 if (pPatchPage->cCount > 1) 4563 4563 { … … 4578 4578 memcpy(&pPatchPage->aPatch[i], &pPatchPage->aPatch[i+1], sizeof(PPATCHINFO)*(pPatchPage->cCount - (i+1))); 4579 4579 } 4580 AssertMsg(i < pPatchPage->cCount, ("Unable to find patch % VHv in page %VRv\n", pPatch, pPage));4580 AssertMsg(i < pPatchPage->cCount, ("Unable to find patch %RHv in page %RRv\n", pPatch, pPage)); 4581 4581 4582 4582 pPatchPage->cCount--; … … 4586 4586 PPATMPATCHPAGE pPatchNode; 4587 4587 4588 Log(("patmRemovePatchFromPage % VRv\n", pPage));4588 Log(("patmRemovePatchFromPage %RRv\n", pPage)); 4589 4589 4590 4590 STAM_COUNTER_INC(&pVM->patm.s.StatPatchPageRemoved); … … 4682 4682 RTRCUINTPTR pWritePageStart, pWritePageEnd, pPage; 4683 4683 4684 Log(("PATMR3PatchWrite % VRv %x\n", GCPtr, cbWrite));4684 Log(("PATMR3PatchWrite %RRv %x\n", GCPtr, cbWrite)); 4685 4685 4686 4686 Assert(VM_IS_EMT(pVM)); … … 4769 4769 if (pPatchToGuestRec && !pPatchToGuestRec->fDirty) 4770 4770 { 4771 Log(("PATMR3PatchWrite: Found patched instruction % VRv -> %VRv\n", pGuestPtrGC, pPatchInstrGC));4771 Log(("PATMR3PatchWrite: Found patched instruction %RRv -> %RRv\n", pGuestPtrGC, pPatchInstrGC)); 4772 4772 4773 4773 if (++pPatch->cCodeWrites > PATM_MAX_CODE_WRITES) 4774 4774 { 4775 LogRel(("PATM: Disable block at % VRv - write %VRv-%VRv\n", pPatch->pPrivInstrGC, pGuestPtrGC, pGuestPtrGC+cbWrite));4775 LogRel(("PATM: Disable block at %RRv - write %RRv-%RRv\n", pPatch->pPrivInstrGC, pGuestPtrGC, pGuestPtrGC+cbWrite)); 4776 4776 4777 4777 PATMR3MarkDirtyPatch(pVM, pPatch); … … 4819 4819 if (pPatch->flags & PATMFL_IDTHANDLER) 4820 4820 { 4821 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));4821 LogRel(("PATM: Stop monitoring IDT handler pages at %RRv - invalid write %RRv-%RRv (this is not a fatal error)\n", pPatch->pPrivInstrGC, GCPtr, GCPtr+cbWrite)); 4822 4822 4823 4823 Assert(pPatch->flags & PATMFL_CODE_MONITORED); … … 4827 4827 else 4828 4828 { 4829 LogRel(("PATM: Disable block at % VRv - invalid write %VRv-%VRv \n", pPatch->pPrivInstrGC, GCPtr, GCPtr+cbWrite));4829 LogRel(("PATM: Disable block at %RRv - invalid write %RRv-%RRv \n", pPatch->pPrivInstrGC, GCPtr, GCPtr+cbWrite)); 4830 4830 PATMR3MarkDirtyPatch(pVM, pPatch); 4831 4831 } … … 4868 4868 PPATCHINFO pPatch = pPatchPage->aPatch[i]; 4869 4869 4870 Log(("PATMR3FlushPage % VRv remove patch at %VRv\n", addr, pPatch->pPrivInstrGC));4870 Log(("PATMR3FlushPage %RRv remove patch at %RRv\n", addr, pPatch->pPrivInstrGC)); 4871 4871 PATMR3MarkDirtyPatch(pVM, pPatch); 4872 4872 } … … 4928 4928 if (pPatchRec->patch.cbPatchJump == 1) 4929 4929 { 4930 Log(("PATMR3QueryOpcode: returning opcode %2X for instruction at % VRv\n", *pByte, pInstrGC));4930 Log(("PATMR3QueryOpcode: returning opcode %2X for instruction at %RRv\n", *pByte, pInstrGC)); 4931 4931 } 4932 4932 STAM_COUNTER_ADD(&pVM->patm.s.StatNrOpcodeRead, 1); … … 4951 4951 PPATCHINFO pPatch; 4952 4952 4953 Log(("PATMR3DisablePatch: % VRv\n", pInstrGC));4953 Log(("PATMR3DisablePatch: %RRv\n", pInstrGC)); 4954 4954 pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC); 4955 4955 if (pPatchRec) … … 4975 4975 TRPMR3SetGuestTrapHandler(pVM, iGate, TRPM_INVALID_HANDLER); 4976 4976 if (++cIDTHandlersDisabled < 256) 4977 LogRel(("PATM: Disabling IDT %x patch handler % VRv\n", iGate, pInstrGC));4977 LogRel(("PATM: Disabling IDT %x patch handler %RRv\n", iGate, pInstrGC)); 4978 4978 } 4979 4979 } … … 4983 4983 && pPatch->uState == PATCH_ENABLED) 4984 4984 { 4985 Log(("Invalidate patch at % VRv (HC=%VRv)\n", PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_HC(pPatch)));4985 Log(("Invalidate patch at %RRv (HC=%RRv)\n", PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_HC(pPatch))); 4986 4986 pPatch->bDirtyOpcode = *PATCHCODE_PTR_HC(pPatch); 4987 4987 *PATCHCODE_PTR_HC(pPatch) = 0xCC; … … 4996 4996 if (pPatch->uState != PATCH_REFUSED) 4997 4997 { 4998 AssertMsg(pPatch->pPrivInstrHC, ("Invalid HC pointer?!? (% VRv)\n", pInstrGC));4998 AssertMsg(pPatch->pPrivInstrHC, ("Invalid HC pointer?!? (%RRv)\n", pInstrGC)); 4999 4999 Assert(pPatch->cbPatchJump); 5000 5000 … … 5085 5085 } 5086 5086 5087 Log(("PATMR3DisablePatch: disabled patch at % VRv\n", pInstrGC));5087 Log(("PATMR3DisablePatch: disabled patch at %RRv\n", pInstrGC)); 5088 5088 return VINF_SUCCESS; 5089 5089 } … … 5128 5128 if (pConflictPatch->flags & PATMFL_INSTR_HINT) 5129 5129 { 5130 Log(("Enabling HINTED patch % VRv\n", pConflictPatch->pPrivInstrGC));5130 Log(("Enabling HINTED patch %RRv\n", pConflictPatch->pPrivInstrGC)); 5131 5131 pConflictPatch->flags &= ~PATMFL_INSTR_HINT; 5132 5132 rc = PATMR3EnablePatch(pVM, pConflictPatch->pPrivInstrGC); … … 5140 5140 if (RT_SUCCESS(rc)) 5141 5141 { 5142 Log(("PATM -> CONFLICT: Installed JMP patch for patch conflict at % VRv\n", pInstrGC));5142 Log(("PATM -> CONFLICT: Installed JMP patch for patch conflict at %RRv\n", pInstrGC)); 5143 5143 STAM_COUNTER_INC(&pVM->patm.s.StatFixedConflicts); 5144 5144 return VINF_SUCCESS; … … 5150 5150 { 5151 5151 /* Turn it into an int3 patch; our GC trap handler will call the generated code manually. */ 5152 Log(("PATM -> CONFLICT: Found active patch at instruction % VRv with target %VRv -> turn into int 3 patch!!\n", pInstrGC, pConflictPatch->pPrivInstrGC));5152 Log(("PATM -> CONFLICT: Found active patch at instruction %RRv with target %RRv -> turn into int 3 patch!!\n", pInstrGC, pConflictPatch->pPrivInstrGC)); 5153 5153 int rc = PATMR3DisablePatch(pVM, pConflictPatch->pPrivInstrGC); 5154 5154 if (rc == VWRN_PATCH_REMOVED) … … 5173 5173 else 5174 5174 { 5175 Log(("PATM -> CONFLICT: Found active patch at instruction % VRv with target %VRv -> DISABLING it!!\n", pInstrGC, pConflictPatch->pPrivInstrGC));5175 Log(("PATM -> CONFLICT: Found active patch at instruction %RRv with target %RRv -> DISABLING it!!\n", pInstrGC, pConflictPatch->pPrivInstrGC)); 5176 5176 int rc = PATMR3DisablePatch(pVM, pConflictPatch->pPrivInstrGC); 5177 5177 if (rc == VWRN_PATCH_REMOVED) … … 5205 5205 PPATCHINFO pPatch; 5206 5206 5207 Log(("PATMR3EnablePatch % VRv\n", pInstrGC));5207 Log(("PATMR3EnablePatch %RRv\n", pInstrGC)); 5208 5208 pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC); 5209 5209 if (pPatchRec) … … 5299 5299 } 5300 5300 else 5301 Log(("PATMR3EnablePatch: Unable to enable patch % VRv with state %d\n", pInstrGC, pPatch->uState));5301 Log(("PATMR3EnablePatch: Unable to enable patch %RRv with state %d\n", pInstrGC, pPatch->uState)); 5302 5302 5303 5303 return rc; … … 5323 5323 if (!fForceRemove && (pPatch->flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_CODE_REFERENCED))) 5324 5324 { 5325 Log(("PATMRemovePatch % VRv REFUSED!\n", pPatch->pPrivInstrGC));5325 Log(("PATMRemovePatch %RRv REFUSED!\n", pPatch->pPrivInstrGC)); 5326 5326 return VERR_ACCESS_DENIED; 5327 5327 } 5328 Log(("PATMRemovePatch % VRv\n", pPatch->pPrivInstrGC));5328 Log(("PATMRemovePatch %RRv\n", pPatch->pPrivInstrGC)); 5329 5329 5330 5330 /** @note NEVER EVER REUSE PATCH MEMORY */ … … 5401 5401 RTRCPTR pInstrGC = pPatchRec->patch.pPrivInstrGC; 5402 5402 5403 Log(("patmR3RefreshPatch: attempt to refresh patch at % VRv\n", pInstrGC));5403 Log(("patmR3RefreshPatch: attempt to refresh patch at %RRv\n", pInstrGC)); 5404 5404 5405 5405 pPatch = &pPatchRec->patch; … … 5477 5477 RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pNewPatchRec->Core); 5478 5478 5479 LogRel(("PATM: patmR3RefreshPatch: succeeded to refresh patch at % VRv \n", pInstrGC));5479 LogRel(("PATM: patmR3RefreshPatch: succeeded to refresh patch at %RRv \n", pInstrGC)); 5480 5480 STAM_COUNTER_INC(&pVM->patm.s.StatPatchRefreshSuccess); 5481 5481 … … 5487 5487 if (RT_FAILURE(rc)) 5488 5488 { 5489 LogRel(("PATM: patmR3RefreshPatch: failed to refresh patch at % VRv. Reactiving old one. \n", pInstrGC));5489 LogRel(("PATM: patmR3RefreshPatch: failed to refresh patch at %RRv. Reactiving old one. \n", pInstrGC)); 5490 5490 5491 5491 /* Remove the new inactive patch */ … … 5525 5525 && pInstrGC < pPatchRec->patch.pPrivInstrGC + pPatchRec->patch.cbPatchJump) 5526 5526 { 5527 Log(("Found active patch at % VRv (org %VRv)\n", pInstrGC, pPatchRec->patch.pPrivInstrGC));5527 Log(("Found active patch at %RRv (org %RRv)\n", pInstrGC, pPatchRec->patch.pPrivInstrGC)); 5528 5528 return &pPatchRec->patch; 5529 5529 } … … 5535 5535 && pInstrGC < pPatchRec->patch.pPrivInstrGC + pPatchRec->patch.cbPatchJump) 5536 5536 { 5537 Log(("Found HINT patch at % VRv (org %VRv)\n", pInstrGC, pPatchRec->patch.pPrivInstrGC));5537 Log(("Found HINT patch at %RRv (org %RRv)\n", pInstrGC, pPatchRec->patch.pPrivInstrGC)); 5538 5538 return &pPatchRec->patch; 5539 5539 } … … 5611 5611 if (pPatch->pPatchBlockOffset) 5612 5612 { 5613 Log(("Invalidate patch at % VRv (HC=%VRv)\n", PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_HC(pPatch)));5613 Log(("Invalidate patch at %RRv (HC=%RRv)\n", PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_HC(pPatch))); 5614 5614 pPatch->bDirtyOpcode = *PATCHCODE_PTR_HC(pPatch); 5615 5615 *PATCHCODE_PTR_HC(pPatch) = 0xCC; … … 5731 5731 if (pvPatchCoreOffset == 0) 5732 5732 { 5733 Log(("PATMR3PatchToGCPtr failed for % VRv offset %x\n", pPatchGC, pPatchGC - pVM->patm.s.pPatchMemGC));5733 Log(("PATMR3PatchToGCPtr failed for %RRv offset %x\n", pPatchGC, pPatchGC - pVM->patm.s.pPatchMemGC)); 5734 5734 return 0; 5735 5735 } … … 5742 5742 || pPatchRec->patch.uState == PATCH_DISABLE_PENDING 5743 5743 || pPatchRec->patch.uState == PATCH_UNUSABLE), 5744 ("pPrivInstrGC=% VRv uState=%d\n", pPrivInstrGC, pPatchRec->patch.uState));5744 ("pPrivInstrGC=%RRv uState=%d\n", pPrivInstrGC, pPatchRec->patch.uState)); 5745 5745 5746 5746 if ( !pPrivInstrGC … … 5819 5819 PRECPATCHTOGUEST pRec; 5820 5820 5821 Log(("patmR3HandleDirtyInstr: dirty instruction at % VRv (%VRv)\n", pEip, pPatchToGuestRec->pOrgInstrGC));5821 Log(("patmR3HandleDirtyInstr: dirty instruction at %RRv (%RRv)\n", pEip, pPatchToGuestRec->pOrgInstrGC)); 5822 5822 5823 5823 pRec = pPatchToGuestRec; … … 5832 5832 if (pRec->fJumpTarget) 5833 5833 { 5834 LogRel(("PATM: patmR3HandleDirtyInstr: dirty instruction at % VRv (%VRv) ignored, because instruction in function was reused as target of jump\n", pEip, pPatchToGuestRec->pOrgInstrGC));5834 LogRel(("PATM: patmR3HandleDirtyInstr: dirty instruction at %RRv (%RRv) ignored, because instruction in function was reused as target of jump\n", pEip, pPatchToGuestRec->pOrgInstrGC)); 5835 5835 pRec->fDirty = false; 5836 5836 return VERR_PATCHING_REFUSED; … … 5963 5963 if (RT_FAILURE(rc)) 5964 5964 { 5965 LogRel(("PATM: Failed to refresh dirty patch at % VRv. Disabling it.\n", pPatch->patch.pPrivInstrGC));5965 LogRel(("PATM: Failed to refresh dirty patch at %RRv. Disabling it.\n", pPatch->patch.pPrivInstrGC)); 5966 5966 } 5967 5967 /* Even if we succeed, we must go back to the original instruction as the patched one could be invalid. */ … … 6007 6007 if (pPatch->patch.uState == PATCH_DIRTY) 6008 6008 { 6009 Log(("PATMR3HandleTrap: trap in dirty patch at % VRv\n", pEip));6009 Log(("PATMR3HandleTrap: trap in dirty patch at %RRv\n", pEip)); 6010 6010 if (pPatch->patch.flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_CODE_REFERENCED)) 6011 6011 { … … 6017 6017 if (pPatch->patch.uState == PATCH_DISABLED) 6018 6018 { 6019 Log(("PATMR3HandleTrap: trap in disabled patch at % VRv\n", pEip));6019 Log(("PATMR3HandleTrap: trap in disabled patch at %RRv\n", pEip)); 6020 6020 if (pPatch->patch.flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_CODE_REFERENCED)) 6021 6021 { … … 6029 6029 RTRCPTR pPrivInstrGC = pPatch->patch.pPrivInstrGC; 6030 6030 6031 Log(("PATMR3HandleTrap: disable operation is pending for patch at % VRv\n", pPatch->patch.pPrivInstrGC));6031 Log(("PATMR3HandleTrap: disable operation is pending for patch at %RRv\n", pPatch->patch.pPrivInstrGC)); 6032 6032 rc = PATMR3DisablePatch(pVM, pPatch->patch.pPrivInstrGC); 6033 AssertReleaseMsg(rc != VWRN_PATCH_REMOVED, ("PATMR3DisablePatch removed patch at % VRv\n", pPrivInstrGC));6034 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));6033 AssertReleaseMsg(rc != VWRN_PATCH_REMOVED, ("PATMR3DisablePatch removed patch at %RRv\n", pPrivInstrGC)); 6034 AssertMsg(pPatch->patch.uState == PATCH_DISABLED || pPatch->patch.uState == PATCH_UNUSABLE, ("Unexpected failure to disable patch state=%d rc=%Rrc\n", pPatch->patch.uState, rc)); 6035 6035 } 6036 6036 6037 6037 pPatchToGuestRec = (PRECPATCHTOGUEST)RTAvlU32GetBestFit(&pPatch->patch.Patch2GuestAddrTree, offset, false); 6038 AssertReleaseMsg(pPatchToGuestRec, ("PATMR3HandleTrap: Unable to find corresponding guest address for % VRv (offset %x)\n", pEip, offset));6038 AssertReleaseMsg(pPatchToGuestRec, ("PATMR3HandleTrap: Unable to find corresponding guest address for %RRv (offset %x)\n", pEip, offset)); 6039 6039 6040 6040 pNewEip = pPatchToGuestRec->pOrgInstrGC; … … 6043 6043 } 6044 6044 else 6045 AssertReleaseMsg(pVM->patm.s.pGCStateHC->fPIF == 0, ("PATMR3HandleTrap: Unable to find translation record for % VRv (PIF=0)\n", pEip));6045 AssertReleaseMsg(pVM->patm.s.pGCStateHC->fPIF == 0, ("PATMR3HandleTrap: Unable to find translation record for %RRv (PIF=0)\n", pEip)); 6046 6046 6047 6047 /* Check if we were interrupted in PATM generated instruction code. */ … … 6086 6086 /* Typical pushf (most patches)/push (call patch) trap because of a monitored page. */ 6087 6087 rc = PGMShwModifyPage(pVM, pCtx->esp, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW); 6088 AssertMsgRC(rc, ("PGMShwModifyPage -> rc=% Vrc\n", rc));6088 AssertMsgRC(rc, ("PGMShwModifyPage -> rc=%Rrc\n", rc)); 6089 6089 if (rc == VINF_SUCCESS) 6090 6090 { … … 6126 6126 { 6127 6127 AssertReleaseMsg(pVM->patm.s.pGCStateHC->fPIF == 1, 6128 ("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));6128 ("Crash in patch code %RRv (%RRv) 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)); 6129 6129 } 6130 6130 else 6131 6131 AssertReleaseMsg(pVM->patm.s.pGCStateHC->fPIF == 1, 6132 ("Crash in patch code % VRv (%VRv) esp=%RX32\n%s\n", pEip, pNewEip, CPUMGetGuestESP(pVM), szBuf));6132 ("Crash in patch code %RRv (%RRv) esp=%RX32\n%s\n", pEip, pNewEip, CPUMGetGuestESP(pVM), szBuf)); 6133 6133 EMR3FatalError(pVM, VERR_INTERNAL_ERROR); 6134 6134 } … … 6138 6138 { 6139 6139 STAM_PROFILE_ADV_STOP(&pVM->patm.s.StatHandleTrap, a); 6140 AssertMsgFailed(("PATMR3HandleTrap: patch not found at address % VRv!!\n", pEip));6140 AssertMsgFailed(("PATMR3HandleTrap: patch not found at address %RRv!!\n", pEip)); 6141 6141 return VERR_PATCH_NOT_FOUND; //fatal error 6142 6142 } … … 6187 6187 AssertRC(rc); 6188 6188 6189 Log(("Return failed at % VRv (%VRv)\n", pEip, pNewEip));6190 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));6189 Log(("Return failed at %RRv (%RRv)\n", pEip, pNewEip)); 6190 Log(("Expected return address %RRv found address %RRv Psp=%x\n", pVM->patm.s.pGCStackHC[(pVM->patm.s.pGCStateHC->Psp+PATM_STACK_SIZE)/sizeof(RTRCPTR)], retaddr, pVM->patm.s.pGCStateHC->Psp)); 6191 6191 } 6192 6192 } … … 6202 6202 { 6203 6203 /* Must be a faulting instruction after sti; currently only sysexit, hlt or iret */ 6204 Log(("PATMR3HandleTrap % VRv -> inhibit irqs set!\n", pEip));6204 Log(("PATMR3HandleTrap %RRv -> inhibit irqs set!\n", pEip)); 6205 6205 #ifdef VBOX_STRICT 6206 6206 DISCPUSTATE cpu; … … 6223 6223 } 6224 6224 6225 Log2(("pPatchBlockGC % VRv - pEip %VRv corresponding GC address %VRv\n", PATCHCODE_PTR_GC(&pPatch->patch), pEip, pNewEip));6225 Log2(("pPatchBlockGC %RRv - pEip %RRv corresponding GC address %RRv\n", PATCHCODE_PTR_GC(&pPatch->patch), pEip, pNewEip)); 6226 6226 #ifdef LOG_ENABLED 6227 6227 CPUMR3DisasmInstr(pVM, pCtx, pNewEip, "PATCHRET: "); … … 6230 6230 { 6231 6231 /* We can't jump back to code that we've overwritten with a 5 byte jump! */ 6232 Log(("Disabling patch at location % VRv due to trap too close to the privileged instruction \n", pPatch->patch.pPrivInstrGC));6232 Log(("Disabling patch at location %RRv due to trap too close to the privileged instruction \n", pPatch->patch.pPrivInstrGC)); 6233 6233 PATMR3DisablePatch(pVM, pPatch->patch.pPrivInstrGC); 6234 6234 STAM_PROFILE_ADV_STOP(&pVM->patm.s.StatHandleTrap, a); … … 6240 6240 if (pPatch->patch.cTraps > MAX_PATCH_TRAPS) 6241 6241 { 6242 Log(("Disabling patch at location % VRv due to too many traps inside patch code\n", pPatch->patch.pPrivInstrGC));6242 Log(("Disabling patch at location %RRv due to too many traps inside patch code\n", pPatch->patch.pPrivInstrGC)); 6243 6243 //we are only wasting time, back out the patch 6244 6244 PATMR3DisablePatch(pVM, pPatch->patch.pPrivInstrGC); … … 6273 6273 { 6274 6274 STAM_COUNTER_INC(&pVM->patm.s.StatMonitored); 6275 Log(("Renewing patch at % VRv\n", pPatchRec->patch.pPrivInstrGC));6275 Log(("Renewing patch at %RRv\n", pPatchRec->patch.pPrivInstrGC)); 6276 6276 rc = PATMR3DisablePatch(pVM, pPatchRec->patch.pPrivInstrGC); 6277 6277 if (rc == VWRN_PATCH_REMOVED) … … 6294 6294 { 6295 6295 STAM_COUNTER_INC(&pVM->patm.s.StatMonitored); 6296 Log(("Renewing patch at % VRv\n", pPatchRec->patch.pPrivInstrGC));6296 Log(("Renewing patch at %RRv\n", pPatchRec->patch.pPrivInstrGC)); 6297 6297 PATMR3DisablePatch(pVM, pPatchRec->patch.pPrivInstrGC); 6298 6298 PATMR3EnablePatch(pVM, pPatchRec->patch.pPrivInstrGC);
Note:
See TracChangeset
for help on using the changeset viewer.