VirtualBox

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


Ignore:
Timestamp:
Dec 31, 2023 1:06:09 AM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160908
Message:

VMM/IEM: Debugged TLB lookup code on arm and enabled it there. bugref:10371

File:
1 edited

Legend:

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

    r102735 r102736  
    99689968*********************************************************************************************************************************/
    99699969
    9970 #if (defined(RT_ARCH_AMD64) && 1) || (defined(RT_ARCH_ARM64) && 0)
     9970#if (defined(RT_ARCH_AMD64) && 1) || (defined(RT_ARCH_ARM64) && 1)
    99719971# define IEMNATIVE_WITH_TLB_LOOKUP
    99729972#endif
     
    1011810118    {
    1011910119off = iemNativeEmitBrkEx(pCodeBuf, off, 1); /** @todo this needs testing */
    10120         /* cmp  seglim, regptr */
     10120        /* cmp  seglim, regptr */   /** @todo r=bird: why 64-bit compare again? */
    1012110121        if (pTlbState->idxRegPtr != UINT8_MAX)
    1012210122            off = iemNativeEmitCmpGprWithGprEx(pCodeBuf, off, pTlbState->idxRegSegLimit, pTlbState->idxRegPtr);
     
    1013610136        /* cmp  reg1, reg2 (64-bit) / imm (32-bit) */
    1013710137        if (pTlbState->idxRegPtr != UINT8_MAX)
    10138             off = iemNativeEmitCmpGprWithGprEx(pCodeBuf, off, pTlbState->idxReg1, pTlbState->idxReg2);
     10138            off = iemNativeEmitCmpGprWithGprEx(pCodeBuf, off, pTlbState->idxReg1,
     10139                                               cbMem > 1 ? pTlbState->idxReg2 : pTlbState->idxRegPtr);
    1013910140        else
    1014010141            off = iemNativeEmitCmpGpr32WithImmEx(pCodeBuf, off, pTlbState->idxReg1, (uint32_t)(pTlbState->uAbsPtr + cbMem - 1));
     
    1015010151     */
    1015110152    iemNativeLabelDefine(pReNative, idxLabelTlbLookup, off);
    10152 # if defined(RT_ARCH_ARM64)
    10153     off = iemNativeEmitBrkEx(pCodeBuf, off, 0); /** @todo debug on arm */
     10153# if defined(RT_ARCH_ARM64) && 0
     10154    off = iemNativeEmitBrkEx(pCodeBuf, off, 0);
    1015410155# endif
    1015510156
     
    1039710398    off = iemNativeEmitAddGprImmEx(pCodeBuf, off, pTlbState->idxReg2, RT_UOFFSETOF(VMCPUCC, iem.s.DataTlb.aEntries),
    1039810399                                   pTlbState->idxReg3 /*iGprTmp*/);
    10399 
     10400    /* reg2 += pVCpu */
     10401    off = iemNativeEmitAddTwoGprsEx(pCodeBuf, off, pTlbState->idxReg2, IEMNATIVE_REG_FIXED_PVMCPU);
    1040010402# else
    1040110403#  error "Port me"
     
    1041110413    off = iemNativeEmitGprByGprDisp(pCodeBuf, off, pTlbState->idxReg1, pTlbState->idxReg2, RT_UOFFSETOF(IEMTLBENTRY, uTag));
    1041210414# elif defined(RT_ARCH_ARM64)
    10413     pCodeBuf[off++] = Armv8A64MkInstrStLdRUOff(kArmv8A64InstrLdStType_Ld_Dword, pTlbState->idxReg3,
    10414                                                pTlbState->idxReg2, RT_UOFFSETOF(IEMTLBENTRY, uTag));
     10415    off = iemNativeEmitLoadGprByGprEx(pCodeBuf, off, pTlbState->idxReg3, pTlbState->idxReg2, RT_UOFFSETOF(IEMTLBENTRY, uTag));
    1041510416    off = iemNativeEmitCmpGprWithGprEx(pCodeBuf, off, pTlbState->idxReg1, pTlbState->idxReg3);
    1041610417# else
     
    1044310444                                    RT_UOFFSETOF(VMCPUCC, iem.s.DataTlb.uTlbPhysRev));
    1044410445# elif defined(RT_ARCH_ARM64)
    10445     pCodeBuf[off++] = Armv8A64MkInstrStLdRUOff(kArmv8A64InstrLdStType_Ld_Dword, pTlbState->idxReg3,
    10446                                                pTlbState->idxReg2, RT_UOFFSETOF(IEMTLBENTRY, fFlagsAndPhysRev));
     10446    off = iemNativeEmitLoadGprByGprEx(pCodeBuf, off, pTlbState->idxReg3, pTlbState->idxReg2,
     10447                                      RT_UOFFSETOF(IEMTLBENTRY, fFlagsAndPhysRev));
    1044710448    pCodeBuf[off++] = Armv8A64MkInstrAnd(pTlbState->idxReg1, pTlbState->idxReg1, pTlbState->idxReg3);
    10448     off = iemNativeEmitLoadGprFromVCpuU64Ex(pCodeBuf, off, pTlbState->idxReg3,  RT_UOFFSETOF(VMCPUCC, iem.s.DataTlb.uTlbPhysRev));
     10449    off = iemNativeEmitLoadGprFromVCpuU64Ex(pCodeBuf, off, pTlbState->idxReg3, RT_UOFFSETOF(VMCPUCC, iem.s.DataTlb.uTlbPhysRev));
    1044910450    off = iemNativeEmitCmpGprWithGprEx(pCodeBuf, off, pTlbState->idxReg1, pTlbState->idxReg3);
    1045010451# 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