VirtualBox

Changeset 97209 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Oct 18, 2022 2:37:10 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154185
Message:

VMM/HMSVMAll: Replace DISFetchReg32 and DISWriteReg32 with direct register accesses, because the two functions use CPUMCTXCORE and will soon be removed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp

    r96407 r97209  
    6868    Log4(("Emulated VMMCall TPR access replacement at RIP=%RGv\n", pCtx->rip));
    6969
     70    AssertCompile(DISGREG_EAX  == X86_GREG_xAX);
     71    AssertCompile(DISGREG_ECX  == X86_GREG_xCX);
     72    AssertCompile(DISGREG_EDX  == X86_GREG_xDX);
     73    AssertCompile(DISGREG_EBX  == X86_GREG_xBX);
     74    AssertCompile(DISGREG_ESP  == X86_GREG_xSP);
     75    AssertCompile(DISGREG_EBP  == X86_GREG_xBP);
     76    AssertCompile(DISGREG_ESI  == X86_GREG_xSI);
     77    AssertCompile(DISGREG_EDI  == X86_GREG_xDI);
     78    AssertCompile(DISGREG_R8D  == X86_GREG_x8);
     79    AssertCompile(DISGREG_R9D  == X86_GREG_x9);
     80    AssertCompile(DISGREG_R10D == X86_GREG_x10);
     81    AssertCompile(DISGREG_R11D == X86_GREG_x11);
     82    AssertCompile(DISGREG_R12D == X86_GREG_x12);
     83    AssertCompile(DISGREG_R13D == X86_GREG_x13);
     84    AssertCompile(DISGREG_R14D == X86_GREG_x14);
     85    AssertCompile(DISGREG_R15D == X86_GREG_x15);
     86
    7087    /*
    7188     * We do this in a loop as we increment the RIP after a successful emulation
     
    89106                AssertRC(rc);
    90107
    91                 rc = DISWriteReg32(CPUMCTX2CORE(pCtx), pPatch->uDstOperand, u8Tpr);
    92                 AssertRC(rc);
     108                uint8_t idxReg = pPatch->uDstOperand;
     109                AssertStmt(idxReg < RT_ELEMENTS(pCtx->aGRegs), idxReg = RT_ELEMENTS(pCtx->aGRegs) - 1);
     110                pCtx->aGRegs[idxReg].u64 = u8Tpr;
    93111                pCtx->rip += pPatch->cbOp;
    94112                pCtx->eflags.Bits.u1RF = 0;
     
    101119                if (pPatch->enmType == HMTPRINSTR_WRITE_REG)
    102120                {
    103                     uint32_t u32Val;
    104                     int rc = DISFetchReg32(CPUMCTX2CORE(pCtx), pPatch->uSrcOperand, &u32Val);
    105                     AssertRC(rc);
    106                     u8Tpr = u32Val;
     121                    uint8_t idxReg = pPatch->uDstOperand;
     122                    AssertStmt(idxReg < RT_ELEMENTS(pCtx->aGRegs), idxReg = RT_ELEMENTS(pCtx->aGRegs) - 1);
     123                    u8Tpr = pCtx->aGRegs[idxReg].u8;
    107124                }
    108125                else
Note: See TracChangeset for help on using the changeset viewer.

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