VirtualBox

Changeset 95307 in vbox for trunk/src


Ignore:
Timestamp:
Jun 19, 2022 8:37:16 PM (3 years ago)
Author:
vboxsync
Message:

VMM/IEMAll.cpp: Some data TLB tweaking. bugref:9898

File:
1 edited

Legend:

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

    r94868 r95307  
    60906090{
    60916091    /*
    6092      * Check the input and figure out which mapping entry to use.
     6092     * Check the input, check segment access and adjust address
     6093     * with segment base.
    60936094     */
    60946095    Assert(cbMem <= 64 || cbMem == 512 || cbMem == 108 || cbMem == 104 || cbMem == 94); /* 512 is the max! */
     
    60966097    Assert(pVCpu->iem.s.cActiveMappings < RT_ELEMENTS(pVCpu->iem.s.aMemMappings));
    60976098
     6099    VBOXSTRICTRC rcStrict = iemMemApplySegment(pVCpu, fAccess, iSegReg, cbMem, &GCPtrMem);
     6100    if (rcStrict == VINF_SUCCESS) { /*likely*/ }
     6101    else longjmp(*pVCpu->iem.s.CTX_SUFF(pJmpBuf), VBOXSTRICTRC_VAL(rcStrict));
     6102
     6103    /*
     6104     * Figure out which mapping entry to use.
     6105     */
    60986106    unsigned iMemMap = pVCpu->iem.s.iNextMapping;
    60996107    if (   iMemMap >= RT_ELEMENTS(pVCpu->iem.s.aMemMappings)
     
    61096117
    61106118    /*
    6111      * Map the memory, checking that we can actually access it.  If something
    6112      * slightly complicated happens, fall back on bounce buffering.
     6119     * Crossing a page boundary?
    61136120     */
    6114     VBOXSTRICTRC rcStrict = iemMemApplySegment(pVCpu, fAccess, iSegReg, cbMem, &GCPtrMem);
    6115     if (rcStrict == VINF_SUCCESS) { /*likely*/ }
    6116     else longjmp(*pVCpu->iem.s.CTX_SUFF(pJmpBuf), VBOXSTRICTRC_VAL(rcStrict));
    6117 
    6118     /* Crossing a page boundary? */
    61196121    if ((GCPtrMem & GUEST_PAGE_OFFSET_MASK) + cbMem <= GUEST_PAGE_SIZE)
    61206122    { /* No (likely). */ }
     
    65836585 * @param   GCPtrMem            The address of the guest memory.
    65846586 */
    6585 static uint32_t iemMemFetchDataU32SafeJmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem) RT_NOEXCEPT
     6587uint32_t iemMemFetchDataU32SafeJmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem) RT_NOEXCEPT
    65866588{
    65876589    uint32_t const *pu32Src = (uint32_t const *)iemMemMapJmp(pVCpu, sizeof(*pu32Src), iSegReg, GCPtrMem, IEM_ACCESS_DATA_R);
     
    66526654       outdated page pointer, or other troubles. */
    66536655    Log10(("iemMemFetchDataU32Jmp: %u:%RGv fallback\n", iSegReg, GCPtrMem));
     6656    return iemMemFetchDataU32SafeJmp(pVCpu, iSegReg, GCPtrMem);
     6657
     6658# else
     6659    uint32_t const *pu32Src = (uint32_t const *)iemMemMapJmp(pVCpu, sizeof(*pu32Src), iSegReg, GCPtrMem, IEM_ACCESS_DATA_R);
     6660    uint32_t const  u32Ret  = *pu32Src;
     6661    iemMemCommitAndUnmapJmp(pVCpu, (void *)pu32Src, IEM_ACCESS_DATA_R);
     6662    return u32Ret;
    66546663# endif
    6655     return iemMemFetchDataU32SafeJmp(pVCpu, iSegReg, GCPtrMem);
    66566664}
    66576665#endif
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