VirtualBox

Changeset 13834 in vbox


Ignore:
Timestamp:
Nov 5, 2008 2:21:20 AM (16 years ago)
Author:
vboxsync
Message:

Some strugging format conversions.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/DisasmCore.cpp

    r13833 r13834  
    12871287        pParam->size   = sizeof(uint64_t);
    12881288
    1289         disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0%VX64h", pParam->parval);
     1289        disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), "0%RX64h", pParam->parval);
    12901290        return sizeof(uint64_t);
    12911291    }
     
    13341334            pParam->flags |= USE_IMMEDIATE64;
    13351335            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);
    13371337        }
    13381338        else
     
    13971397        pParam->size   = sizeof(int64_t);
    13981398
    1399         disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), " (0%VX64h)", pParam->parval);
     1399        disasmAddStringF(pParam->szParam, sizeof(pParam->szParam), " (0%RX64h)", pParam->parval);
    14001400        return sizeof(int32_t);
    14011401    }
  • trunk/src/VBox/VMM/CPUM.cpp

    r13833 r13834  
    11101110                    "%srip=%016RX64 %srsp=%016RX64 %srbp=%016RX64 %siopl=%d %*s\n"
    11111111                    "%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"
    11131113                    ,
    11141114                    pszPrefix, pCtxCore->rax, pszPrefix, pCtxCore->rbx, pszPrefix, pCtxCore->rcx, pszPrefix, pCtxCore->rdx, pszPrefix, pCtxCore->rsi, pszPrefix, pCtxCore->rdi,
     
    22202220            if (!RT_SUCCESS(rc))
    22212221            {
    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));
    22232223                return rc;
    22242224            }
     
    22302230            if (!RT_SUCCESS(rc))
    22312231            {
    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));
    22332233                return rc;
    22342234            }
     
    22732273    }
    22742274    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));
    22762276
    22772277    /* Release mapping lock acquired in cpumR3DisasInstrRead. */
  • trunk/src/VBox/VMM/PATM/PATM.cpp

    r13833 r13834  
    122122    if (RT_FAILURE(rc))
    123123    {
    124         Log(("MMR3HyperAlloc failed with %Vrc\n", rc));
     124        Log(("MMR3HyperAlloc failed with %Rrc\n", rc));
    125125        return rc;
    126126    }
     
    284284    int rc = PGMMapSetPage(pVM, pVM->patm.s.pGCStateGC, PAGE_SIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW);
    285285    if (RT_FAILURE(rc))
    286         Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Vrc!!\n", rc));
     286        Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Rrc!!\n", rc));
    287287
    288288    rc = PGMMapSetPage(pVM, pVM->patm.s.pGCStackGC, PATM_STACK_TOTAL_SIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW);
    289289    if (RT_FAILURE(rc))
    290         Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Vrc!!\n", rc));
     290        Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Rrc!!\n", rc));
    291291
    292292    rc = PGMMapSetPage(pVM, pVM->patm.s.pStatsGC, PATM_STAT_MEMSIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW);
    293293    if (RT_FAILURE(rc))
    294         Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Vrc!!\n", rc));
     294        Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Rrc!!\n", rc));
    295295
    296296    return rc;
     
    327327    AssertReleaseMsg(pVM->patm.s.pGCStateGC, ("Impossible! MMHyperHC2GC(%p) failed!\n", pVM->patm.s.pGCStateGC));
    328328
    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));
    330330    pVM->patm.s.pGCStateHC->uVMFlags = X86_EFL_IF;
    331331
     
    415415    RTRCINTPTR  delta = GCPtrNew - pVM->patm.s.pGCStateGC;
    416416
    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));
    418418    if (delta)
    419419    {
     
    636636        {
    637637        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));
    639639            if (!pRec->pSource || PATMIsPatchGCAddr(pVM, pRec->pSource))
    640640            {
     
    10661066
    10671067                    /* 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));
    10691069
    10701070                    pPatchGC = patmGuestGCPtrToPatchGCPtr(pVM, pPatch, pOrgInstrGC);
     
    10811081            else
    10821082            {
    1083                 Log(("Patch block %VRv called as function\n", pFunctionRec->patch.pPrivInstrGC));
     1083                Log(("Patch block %RRv called as function\n", pFunctionRec->patch.pPrivInstrGC));
    10841084                pFunctionRec->patch.flags |= PATMFL_CODE_REFERENCED;
    10851085            }
     
    13071307    if (pPatch->cbPatchBlockSize >= MAX_PATCH_SIZE)
    13081308    {
    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));
    13101310        fIllegalInstr = true;
    13111311        patmAddIllegalInstrRecord(pVM, pPatch, pCurInstrGC);
     
    14311431    {
    14321432        // 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));
    14341434        return VINF_SUCCESS;
    14351435    }
     
    14631463    if (pPatch->cbPatchBlockSize >= MAX_PATCH_SIZE)
    14641464    {
    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));
    14661466        fIllegalInstr = true;
    14671467        patmAddIllegalInstrRecord(pVM, pPatch, pCurInstrGC);
     
    15601560    bool fInhibitIRQInstr = false;  /* did the instruction cause PATMFL_INHIBITIRQS to be set? */
    15611561
    1562     LogFlow(("patmRecompileCallback %VRv %VRv\n", pInstrGC, pCurInstrGC));
     1562    LogFlow(("patmRecompileCallback %RRv %RRv\n", pInstrGC, pCurInstrGC));
    15631563
    15641564    if (    patmGuestGCPtrToPatchGCPtr(pVM, pPatch, pCurInstrGC) != 0
     
    15691569         * no need to record this instruction as it's glue code that never crashes (it had better not!)
    15701570         */
    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));
    15721572        return patmPatchGenRelJump(pVM, pPatch, pCurInstrGC, OP_JMP, !!(pCpu->prefix & PREFIX_OPSIZE));
    15731573    }
     
    16021602    if (patmIsIllegalInstr(pPatch, pCurInstrGC))
    16031603    {
    1604         Log(("Illegal instruction at %VRv -> mark with int 3\n", pCurInstrGC));
     1604        Log(("Illegal instruction at %RRv -> mark with int 3\n", pCurInstrGC));
    16051605        rc = patmPatchGenIllegalInstr(pVM, pPatch);
    16061606        goto end;
     
    16671667                &&  (pCpu->param1.base.reg_seg == DIS_SELREG_SS))
    16681668            {
    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));
    16701670                pPatch->flags |= PATMFL_RECOMPILE_NEXT;
    16711671                /** @todo this could cause a fault (ring 0 selector being loaded in ring 1) */
     
    16921692            Assert(pCpu->pCurInstr->optype & OPTYPE_INHIBIT_IRQS);
    16931693
    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));
    16951695            pPatch->flags |= PATMFL_RECOMPILE_NEXT;
    16961696        }
     
    17071707            fInhibitIRQInstr = true;
    17081708            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));
    17101710        }
    17111711        rc = patmPatchGenSti(pVM, pPatch, pCurInstrGC, pNextInstrGC);
     
    18041804
    18051805    case OP_IRET:
    1806         Log(("IRET at %VRv\n", pCurInstrGC));
     1806        Log(("IRET at %RRv\n", pCurInstrGC));
    18071807        rc = patmPatchGenIret(pVM, pPatch, pCurInstrGC, !!(pCpu->prefix & PREFIX_OPSIZE));
    18081808        if (RT_SUCCESS(rc))
     
    19421942
    19431943        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));
    19451945        if (pPatch->flags & PATMFL_GENERATE_JUMPTOGUEST)
    19461946        {
    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));
    19481948
    19491949            rc2 = patmPatchGenJumpToGuest(pVM, pPatch, pNextInstrGC, true /* clear inhibit irq flag */);
     
    19711971
    19721972            // 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));
    19741974
    19751975            rc = patmPatchGenJumpToGuest(pVM, pPatch, pNextInstrGC);
     
    21212121
    21222122            if (pOrgInstrGC != pPatch->pTempInfo->pLastDisasmInstrGC)
    2123                 Log(("DIS %VRv<-%s", pOrgInstrGC, szOutput));
     2123                Log(("DIS %RRv<-%s", pOrgInstrGC, szOutput));
    21242124            else
    21252125                Log(("DIS           %s", szOutput));
     
    22762276        cpu.mode = (pPatch->flags & PATMFL_CODE32) ? CPUMODE_32BIT : CPUMODE_16BIT;
    22772277
    2278         ////Log(("patmRecompileCodeStream %VRv %VRv\n", pInstrGC, pCurInstrGC));
     2278        ////Log(("patmRecompileCodeStream %RRv %RRv\n", pInstrGC, pCurInstrGC));
    22792279
    22802280        pCurInstrHC = PATMGCVirtToHCVirt(pVM, pPatch, pCurInstrGC);
     
    23132313                RTRCPTR  pNextInstrGC = pCurInstrGC + opsize;
    23142314
    2315                 Log(("patmRecompileCodeStream: irqs inhibited by instruction %VRv\n", pNextInstrGC));
     2315                Log(("patmRecompileCodeStream: irqs inhibited by instruction %RRv\n", pNextInstrGC));
    23162316
    23172317                /* Certain instructions (e.g. sti) force the next instruction to be executed before any interrupts can occur.
     
    23862386            }
    23872387
    2388             Log(("Jump encountered target %VRv\n", addr));
     2388            Log(("Jump encountered target %RRv\n", addr));
    23892389
    23902390            /* We don't check if the branch target lies in a valid page as we've already done that in the analysis phase. */
     
    24152415                if(pTargetPatch)
    24162416                {
    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));
    24182418                    PATMR3DisablePatch(pVM, pTargetPatch->pPrivInstrGC);
    24192419                }
     
    27662766     * Insert into patch to guest lookup tree
    27672767     */
    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));
    27692769    pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
    27702770    rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
     
    28002800        /*uint8_t ASMInt3 = 0xCC; - unused */
    28012801
    2802         Log(("PATMR3PatchBlock %VRv -> int 3 callable patch.\n", pPatch->pPrivInstrGC));
     2802        Log(("PATMR3PatchBlock %RRv -> int 3 callable patch.\n", pPatch->pPrivInstrGC));
    28032803        /* Replace first opcode byte with 'int 3'. */
    28042804        rc = patmActivateInt3Patch(pVM, pPatch);
     
    28332833    pPatch->pTempInfo->nrIllegalInstr = 0;
    28342834
    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));
    28362836
    28372837    pPatch->uState = PATCH_ENABLED;
     
    29702970            Log(("Patch code ends -----------------------------------------------------\n"));
    29712971#endif
    2972             Log(("Successfully installed IDT handler patch at %VRv\n", pInstrGC));
     2972            Log(("Successfully installed IDT handler patch at %RRv\n", pInstrGC));
    29732973
    29742974            /*
    29752975             * Insert into patch to guest lookup tree
    29762976             */
    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));
    29782978            pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
    29792979            rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
     
    30533053    Log(("TRAP handler patch: %s", szOutput));
    30543054#endif
    3055     Log(("Successfully installed Trap Trampoline patch at %VRv\n", pInstrGC));
     3055    Log(("Successfully installed Trap Trampoline patch at %RRv\n", pInstrGC));
    30563056
    30573057    /*
    30583058     * Insert into patch to guest lookup tree
    30593059     */
    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));
    30613061    pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
    30623062    rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
     
    31183118    uint32_t orgOffsetPatchMem = ~0;
    31193119
    3120     Log(("patmDuplicateFunction %VRv\n", pInstrGC));
     3120    Log(("patmDuplicateFunction %RRv\n", pInstrGC));
    31213121    /* Save original offset (in case of failures later on). */
    31223122    orgOffsetPatchMem = pVM->patm.s.offPatchMem;
     
    31733173     * Insert into patch to guest lookup tree
    31743174     */
    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));
    31763176    pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
    31773177    rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
     
    31973197#endif
    31983198
    3199     Log(("Successfully installed function duplication patch at %VRv\n", pInstrGC));
     3199    Log(("Successfully installed function duplication patch at %RRv\n", pInstrGC));
    32003200
    32013201    patmEmptyTree(pVM, &pPatch->pTempInfo->IllegalInstrTree);
     
    32283228
    32293229    pVM->patm.s.ulCallDepth--;
    3230     Log(("patmDupicateFunction %VRv failed!!\n", pInstrGC));
     3230    Log(("patmDupicateFunction %RRv failed!!\n", pInstrGC));
    32313231    return rc;
    32323232}
     
    32483248    int         rc = VERR_PATCHING_REFUSED;
    32493249
    3250     Log(("patmCreateTrampoline %VRv\n", pInstrGC));
     3250    Log(("patmCreateTrampoline %RRv\n", pInstrGC));
    32513251    /* Save original offset (in case of failures later on). */
    32523252    orgOffsetPatchMem = pVM->patm.s.offPatchMem;
     
    32793279                        pPatchToGuestRec->fJumpTarget = true;
    32803280                        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));
    32823282                        pPatch->flags |= PATMFL_EXTERNAL_JUMP_INSIDE;
    32833283                        break;
     
    33113311     * Insert into patch to guest lookup tree
    33123312     */
    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));
    33143314    pPatchRec->CoreOffset.Key = pPatch->pPatchBlockOffset;
    33153315    rc = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPatchAddr, &pPatchRec->CoreOffset);
     
    35163516        if (pPatchFunction == 0)
    35173517        {
    3518             AssertMsgFailed(("Unable to find duplicate function %VRv\n", pTargetGC));
     3518            AssertMsgFailed(("Unable to find duplicate function %RRv\n", pTargetGC));
    35193519            rc = VERR_PATCHING_REFUSED;
    35203520            goto failure;
     
    35443544#endif
    35453545
    3546     Log(("Successfully installed function replacement patch at %VRv\n", pInstrGC));
     3546    Log(("Successfully installed function replacement patch at %RRv\n", pInstrGC));
    35473547
    35483548    pPatch->uState = PATCH_ENABLED;
     
    38883888    RTRCPTR pJmpDest = PATMR3GuestGCPtrToPatchGCPtr(pVM, pInstrGC + pCpu->opsize + (int32_t)pCpu->param1.parval);
    38893889
    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));
    38913891    pPatch->pPatchJumpDestGC = pJmpDest;
    38923892
     
    39043904#endif
    39053905
    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));
    39073907
    39083908    STAM_COUNTER_INC(&pVM->patm.s.StatInstalledJump);
     
    39373937    Assert(flags == PATMFL_CODE32);
    39383938
    3939     Log(("PATMR3AddHint %VRv\n", pInstrGC));
     3939    Log(("PATMR3AddHint %RRv\n", pInstrGC));
    39403940    return PATMR3InstallPatch(pVM, pInstrGC, PATMFL_CODE32 | PATMFL_INSTR_HINT);
    39413941}
     
    39743974    {
    39753975        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));
    39773977        if (pConflictPatch != 0)
    39783978            return VERR_PATCHING_REFUSED;
     
    39973997        if (pInstrGCFlat != pInstrGC)
    39983998        {
    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));
    40004000            return VERR_PATCHING_REFUSED;
    40014001        }
     
    40214021        if (pvPatchCoreOffset == NULL)
    40224022        {
    4023             AssertMsgFailed(("PATMR3InstallPatch: patch not found at address %VRv!!\n", pInstrGC));
     4023            AssertMsgFailed(("PATMR3InstallPatch: patch not found at address %RRv!!\n", pInstrGC));
    40244024            return VERR_PATCH_NOT_FOUND;    //fatal error
    40254025        }
     
    40424042        if (pPatchRec->patch.uState == PATCH_DISABLE_PENDING)
    40434043        {
    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));
    40454045            PATMR3DisablePatch(pVM, pPatchRec->patch.pPrivInstrGC);
    40464046            Assert(pPatchRec->patch.uState == PATCH_DISABLED);
     
    40524052            if (pPatchRec->patch.flags & PATMFL_INSTR_HINT)
    40534053            {
    4054                 Log(("Enabling HINTED patch %VRv\n", pInstrGC));
     4054                Log(("Enabling HINTED patch %RRv\n", pInstrGC));
    40554055                pPatchRec->patch.flags &= ~PATMFL_INSTR_HINT;
    40564056            }
    40574057            else
    4058                 Log(("Enabling patch %VRv again\n", pInstrGC));
     4058                Log(("Enabling patch %RRv again\n", pInstrGC));
    40594059
    40604060            /** @todo we shouldn't disable and enable patches too often (it's relatively cheap, but pointless if it always happens) */
     
    40754075            {
    40764076                /* 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));
    40784078                if (pPatchRec->patch.flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_IDTHANDLER|PATMFL_MMIO_ACCESS|PATMFL_INT3_REPLACEMENT|PATMFL_INT3_REPLACEMENT_BLOCK))
    40794079                {
     
    40904090        else
    40914091        {
    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));
    40934093            /* already tried it once! */
    40944094            return VERR_PATCHING_REFUSED;
     
    41114111    if (rc != VINF_SUCCESS)
    41124112    {
    4113         Log(("PGMGstGetPage failed with %Vrc\n", rc));
     4113        Log(("PGMGstGetPage failed with %Rrc\n", rc));
    41144114        return rc;
    41154115    }
     
    41434143            if (pPatchNear->patch.uState == PATCH_UNUSABLE && pInstrGC < pPatchNear->patch.pPrivInstrGC && pInstrGC + SIZEOF_NEARJUMP32 > pPatchNear->patch.pPrivInstrGC)
    41444144            {
    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));
    41464146
    41474147                pPatchRec->patch.uState = PATCH_UNUSABLE;
     
    42474247            {
    42484248                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));
    42504250                return rc;
    42514251            }
     
    42654265            if (rc == VINF_SUCCESS)
    42664266            {
    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));
    42684268                return VINF_SUCCESS;
    42694269            }
     
    43024302        case OP_PUSHF:
    43034303        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));
    43054305            rc = PATMR3PatchBlock(pVM, pInstrGC, pInstrHC, cpu.pCurInstr->opcode, opsize, pPatchRec);
    43064306            break;
     
    43454345            pVM->patm.s.pPatchedInstrGCHighest = pPatchRec->patch.pInstrGCHighest;
    43464346
    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));
    43494349
    43504350        STAM_COUNTER_ADD(&pVM->patm.s.StatInstalled, 1);
     
    43654365        {
    43664366            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);
    43684368#ifndef DEBUG_sandervl
    43694369            /* Full breakdown for the GUI. */
    43704370            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);
    43844384            /// @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);
    43864386#endif
    43874387        }
     
    44314431    int            rc;
    44324432
    4433     Log(("patmAddPatchToPage: insert patch %VHv to page %VRv\n", pPatch, pPage));
     4433    Log(("patmAddPatchToPage: insert patch %RHv to page %RRv\n", pPatch, pPage));
    44344434
    44354435    pPatchPage = (PPATMPATCHPAGE)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTreeByPage, pPage);
     
    44894489    if (pGuestToPatchRec)
    44904490    {
    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));
    44924492        if (    pPatchPage->pLowestAddrGC == 0
    44934493            ||  pPatchPage->pLowestAddrGC > (RTRCPTR)pGuestToPatchRec->Core.Key)
     
    45104510                    {
    45114511                        pPatchPage->pLowestAddrGC = pPage;
    4512                         LogFlow(("patmAddPatchToPage: new lowest %VRv\n", pPatchPage->pLowestAddrGC));
     4512                        LogFlow(("patmAddPatchToPage: new lowest %RRv\n", pPatchPage->pLowestAddrGC));
    45134513                    }
    45144514                }
     
    45224522    if (pGuestToPatchRec)
    45234523    {
    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));
    45254525        if (    pPatchPage->pHighestAddrGC == 0
    45264526            ||  pPatchPage->pHighestAddrGC <= (RTRCPTR)pGuestToPatchRec->Core.Key)
     
    45314531////            Assert(size);
    45324532            pPatchPage->pHighestAddrGC += size;
    4533             LogFlow(("patmAddPatchToPage: new highest %VRv\n", pPatchPage->pHighestAddrGC));
     4533            LogFlow(("patmAddPatchToPage: new highest %RRv\n", pPatchPage->pHighestAddrGC));
    45344534        }
    45354535    }
     
    45594559    Assert(pPatchPage->cCount <= pPatchPage->cMaxPatches);
    45604560
    4561     Log(("patmRemovePatchPage: remove patch %VHv from page %VRv\n", pPatch, pPage));
     4561    Log(("patmRemovePatchPage: remove patch %RHv from page %RRv\n", pPatch, pPage));
    45624562    if (pPatchPage->cCount > 1)
    45634563    {
     
    45784578            memcpy(&pPatchPage->aPatch[i], &pPatchPage->aPatch[i+1], sizeof(PPATCHINFO)*(pPatchPage->cCount - (i+1)));
    45794579        }
    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));
    45814581
    45824582        pPatchPage->cCount--;
     
    45864586        PPATMPATCHPAGE pPatchNode;
    45874587
    4588         Log(("patmRemovePatchFromPage %VRv\n", pPage));
     4588        Log(("patmRemovePatchFromPage %RRv\n", pPage));
    45894589
    45904590        STAM_COUNTER_INC(&pVM->patm.s.StatPatchPageRemoved);
     
    46824682    RTRCUINTPTR          pWritePageStart, pWritePageEnd, pPage;
    46834683
    4684     Log(("PATMR3PatchWrite %VRv %x\n", GCPtr, cbWrite));
     4684    Log(("PATMR3PatchWrite %RRv %x\n", GCPtr, cbWrite));
    46854685
    46864686    Assert(VM_IS_EMT(pVM));
     
    47694769                            if (pPatchToGuestRec && !pPatchToGuestRec->fDirty)
    47704770                            {
    4771                                 Log(("PATMR3PatchWrite: Found patched instruction %VRv -> %VRv\n", pGuestPtrGC, pPatchInstrGC));
     4771                                Log(("PATMR3PatchWrite: Found patched instruction %RRv -> %RRv\n", pGuestPtrGC, pPatchInstrGC));
    47724772
    47734773                                if (++pPatch->cCodeWrites > PATM_MAX_CODE_WRITES)
    47744774                                {
    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));
    47764776
    47774777                                    PATMR3MarkDirtyPatch(pVM, pPatch);
     
    48194819                            if (pPatch->flags & PATMFL_IDTHANDLER)
    48204820                            {
    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));
    48224822
    48234823                                Assert(pPatch->flags & PATMFL_CODE_MONITORED);
     
    48274827                            else
    48284828                            {
    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));
    48304830                                PATMR3MarkDirtyPatch(pVM, pPatch);
    48314831                            }
     
    48684868                PPATCHINFO pPatch = pPatchPage->aPatch[i];
    48694869
    4870                 Log(("PATMR3FlushPage %VRv remove patch at %VRv\n", addr, pPatch->pPrivInstrGC));
     4870                Log(("PATMR3FlushPage %RRv remove patch at %RRv\n", addr, pPatch->pPrivInstrGC));
    48714871                PATMR3MarkDirtyPatch(pVM, pPatch);
    48724872            }
     
    49284928        if (pPatchRec->patch.cbPatchJump == 1)
    49294929        {
    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));
    49314931        }
    49324932        STAM_COUNTER_ADD(&pVM->patm.s.StatNrOpcodeRead, 1);
     
    49514951    PPATCHINFO    pPatch;
    49524952
    4953     Log(("PATMR3DisablePatch: %VRv\n", pInstrGC));
     4953    Log(("PATMR3DisablePatch: %RRv\n", pInstrGC));
    49544954    pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
    49554955    if (pPatchRec)
     
    49754975                TRPMR3SetGuestTrapHandler(pVM, iGate, TRPM_INVALID_HANDLER);
    49764976                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));
    49784978            }
    49794979        }
     
    49834983            &&  pPatch->uState == PATCH_ENABLED)
    49844984        {
    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)));
    49864986            pPatch->bDirtyOpcode   = *PATCHCODE_PTR_HC(pPatch);
    49874987            *PATCHCODE_PTR_HC(pPatch) = 0xCC;
     
    49964996            if (pPatch->uState != PATCH_REFUSED)
    49974997            {
    4998                 AssertMsg(pPatch->pPrivInstrHC, ("Invalid HC pointer?!? (%VRv)\n", pInstrGC));
     4998                AssertMsg(pPatch->pPrivInstrHC, ("Invalid HC pointer?!? (%RRv)\n", pInstrGC));
    49994999                Assert(pPatch->cbPatchJump);
    50005000
     
    50855085        }
    50865086
    5087         Log(("PATMR3DisablePatch: disabled patch at %VRv\n", pInstrGC));
     5087        Log(("PATMR3DisablePatch: disabled patch at %RRv\n", pInstrGC));
    50885088        return VINF_SUCCESS;
    50895089    }
     
    51285128        if (pConflictPatch->flags & PATMFL_INSTR_HINT)
    51295129        {
    5130             Log(("Enabling HINTED patch %VRv\n", pConflictPatch->pPrivInstrGC));
     5130            Log(("Enabling HINTED patch %RRv\n", pConflictPatch->pPrivInstrGC));
    51315131            pConflictPatch->flags &= ~PATMFL_INSTR_HINT;
    51325132            rc = PATMR3EnablePatch(pVM, pConflictPatch->pPrivInstrGC);
     
    51405140        if (RT_SUCCESS(rc))
    51415141        {
    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));
    51435143            STAM_COUNTER_INC(&pVM->patm.s.StatFixedConflicts);
    51445144            return VINF_SUCCESS;
     
    51505150    {
    51515151        /* 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));
    51535153        int rc =  PATMR3DisablePatch(pVM, pConflictPatch->pPrivInstrGC);
    51545154        if (rc == VWRN_PATCH_REMOVED)
     
    51735173    else
    51745174    {
    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));
    51765176        int rc = PATMR3DisablePatch(pVM, pConflictPatch->pPrivInstrGC);
    51775177        if (rc == VWRN_PATCH_REMOVED)
     
    52055205    PPATCHINFO    pPatch;
    52065206
    5207     Log(("PATMR3EnablePatch %VRv\n", pInstrGC));
     5207    Log(("PATMR3EnablePatch %RRv\n", pInstrGC));
    52085208    pPatchRec = (PPATMPATCHREC)RTAvloU32Get(&pVM->patm.s.PatchLookupTreeHC->PatchTree, pInstrGC);
    52095209    if (pPatchRec)
     
    52995299        }
    53005300        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));
    53025302
    53035303        return rc;
     
    53235323    if (!fForceRemove && (pPatch->flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_CODE_REFERENCED)))
    53245324    {
    5325         Log(("PATMRemovePatch %VRv REFUSED!\n", pPatch->pPrivInstrGC));
     5325        Log(("PATMRemovePatch %RRv REFUSED!\n", pPatch->pPrivInstrGC));
    53265326        return VERR_ACCESS_DENIED;
    53275327    }
    5328     Log(("PATMRemovePatch %VRv\n", pPatch->pPrivInstrGC));
     5328    Log(("PATMRemovePatch %RRv\n", pPatch->pPrivInstrGC));
    53295329
    53305330    /** @note NEVER EVER REUSE PATCH MEMORY */
     
    54015401    RTRCPTR     pInstrGC = pPatchRec->patch.pPrivInstrGC;
    54025402
    5403     Log(("patmR3RefreshPatch: attempt to refresh patch at %VRv\n", pInstrGC));
     5403    Log(("patmR3RefreshPatch: attempt to refresh patch at %RRv\n", pInstrGC));
    54045404
    54055405    pPatch = &pPatchRec->patch;
     
    54775477        RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pNewPatchRec->Core);
    54785478
    5479         LogRel(("PATM: patmR3RefreshPatch: succeeded to refresh patch at %VRv \n", pInstrGC));
     5479        LogRel(("PATM: patmR3RefreshPatch: succeeded to refresh patch at %RRv \n", pInstrGC));
    54805480        STAM_COUNTER_INC(&pVM->patm.s.StatPatchRefreshSuccess);
    54815481
     
    54875487    if (RT_FAILURE(rc))
    54885488    {
    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));
    54905490
    54915491        /* Remove the new inactive patch */
     
    55255525            &&  pInstrGC < pPatchRec->patch.pPrivInstrGC + pPatchRec->patch.cbPatchJump)
    55265526        {
    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));
    55285528            return &pPatchRec->patch;
    55295529        }
     
    55355535            &&  pInstrGC < pPatchRec->patch.pPrivInstrGC + pPatchRec->patch.cbPatchJump)
    55365536        {
    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));
    55385538            return &pPatchRec->patch;
    55395539        }
     
    56115611    if (pPatch->pPatchBlockOffset)
    56125612    {
    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)));
    56145614        pPatch->bDirtyOpcode   = *PATCHCODE_PTR_HC(pPatch);
    56155615        *PATCHCODE_PTR_HC(pPatch) = 0xCC;
     
    57315731    if (pvPatchCoreOffset == 0)
    57325732    {
    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));
    57345734        return 0;
    57355735    }
     
    57425742                                    ||  pPatchRec->patch.uState == PATCH_DISABLE_PENDING
    57435743                                    ||  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));
    57455745
    57465746        if (    !pPrivInstrGC
     
    58195819    PRECPATCHTOGUEST pRec;
    58205820
    5821     Log(("patmR3HandleDirtyInstr: dirty instruction at %VRv (%VRv)\n", pEip, pPatchToGuestRec->pOrgInstrGC));
     5821    Log(("patmR3HandleDirtyInstr: dirty instruction at %RRv (%RRv)\n", pEip, pPatchToGuestRec->pOrgInstrGC));
    58225822
    58235823    pRec             = pPatchToGuestRec;
     
    58325832        if (pRec->fJumpTarget)
    58335833        {
    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));
    58355835            pRec->fDirty = false;
    58365836            return VERR_PATCHING_REFUSED;
     
    59635963            if (RT_FAILURE(rc))
    59645964            {
    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));
    59665966            }
    59675967            /* Even if we succeed, we must go back to the original instruction as the patched one could be invalid. */
     
    60076007        if (pPatch->patch.uState == PATCH_DIRTY)
    60086008        {
    6009             Log(("PATMR3HandleTrap: trap in dirty patch at %VRv\n", pEip));
     6009            Log(("PATMR3HandleTrap: trap in dirty patch at %RRv\n", pEip));
    60106010            if (pPatch->patch.flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_CODE_REFERENCED))
    60116011            {
     
    60176017        if (pPatch->patch.uState == PATCH_DISABLED)
    60186018        {
    6019             Log(("PATMR3HandleTrap: trap in disabled patch at %VRv\n", pEip));
     6019            Log(("PATMR3HandleTrap: trap in disabled patch at %RRv\n", pEip));
    60206020            if (pPatch->patch.flags & (PATMFL_DUPLICATE_FUNCTION|PATMFL_CODE_REFERENCED))
    60216021            {
     
    60296029            RTRCPTR pPrivInstrGC = pPatch->patch.pPrivInstrGC;
    60306030
    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));
    60326032            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));
    60356035        }
    60366036
    60376037        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));
    60396039
    60406040        pNewEip = pPatchToGuestRec->pOrgInstrGC;
     
    60436043    }
    60446044    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));
    60466046
    60476047    /* Check if we were interrupted in PATM generated instruction code. */
     
    60866086            /* Typical pushf (most patches)/push (call patch) trap because of a monitored page. */
    60876087            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));
    60896089            if (rc == VINF_SUCCESS)
    60906090            {
     
    61266126        {
    61276127            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));
    61296129        }
    61306130        else
    61316131            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));
    61336133        EMR3FatalError(pVM, VERR_INTERNAL_ERROR);
    61346134    }
     
    61386138    {
    61396139        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));
    61416141        return VERR_PATCH_NOT_FOUND;    //fatal error
    61426142    }
     
    61876187            AssertRC(rc);
    61886188
    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));
    61916191        }
    61926192    }
     
    62026202    {
    62036203        /* 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));
    62056205#ifdef VBOX_STRICT
    62066206        DISCPUSTATE cpu;
     
    62236223    }
    62246224
    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));
    62266226#ifdef LOG_ENABLED
    62276227    CPUMR3DisasmInstr(pVM, pCtx, pNewEip, "PATCHRET: ");
     
    62306230    {
    62316231        /* 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));
    62336233        PATMR3DisablePatch(pVM, pPatch->patch.pPrivInstrGC);
    62346234        STAM_PROFILE_ADV_STOP(&pVM->patm.s.StatHandleTrap, a);
     
    62406240    if (pPatch->patch.cTraps > MAX_PATCH_TRAPS)
    62416241    {
    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));
    62436243        //we are only wasting time, back out the patch
    62446244        PATMR3DisablePatch(pVM, pPatch->patch.pPrivInstrGC);
     
    62736273    {
    62746274        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));
    62766276        rc = PATMR3DisablePatch(pVM, pPatchRec->patch.pPrivInstrGC);
    62776277        if (rc == VWRN_PATCH_REMOVED)
     
    62946294        {
    62956295            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));
    62976297            PATMR3DisablePatch(pVM, pPatchRec->patch.pPrivInstrGC);
    62986298            PATMR3EnablePatch(pVM, pPatchRec->patch.pPrivInstrGC);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette