VirtualBox

Changeset 84505 in vbox for trunk/src


Ignore:
Timestamp:
May 25, 2020 2:53:12 PM (5 years ago)
Author:
vboxsync
Message:

IEM: Adding iemMemFetchDataU32_ZX_U64 to deal with techically correct warning about using an uninitialized variable in vmx_write. bugref:9746

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

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

    r83890 r84505  
    956956IEM_STATIC VBOXSTRICTRC     iemMemCommitAndUnmap(PVMCPUCC pVCpu, void *pvMem, uint32_t fAccess);
    957957IEM_STATIC VBOXSTRICTRC     iemMemFetchDataU32(PVMCPUCC pVCpu, uint32_t *pu32Dst, uint8_t iSegReg, RTGCPTR GCPtrMem);
     958IEM_STATIC VBOXSTRICTRC     iemMemFetchDataU32_ZX_U64(PVMCPUCC pVCpu, uint64_t *pu64Dst, uint8_t iSegReg, RTGCPTR GCPtrMem);
    958959IEM_STATIC VBOXSTRICTRC     iemMemFetchDataU64(PVMCPUCC pVCpu, uint64_t *pu64Dst, uint8_t iSegReg, RTGCPTR GCPtrMem);
    959960IEM_STATIC VBOXSTRICTRC     iemMemFetchSysU8(PVMCPUCC pVCpu, uint32_t *pu32Dst, uint8_t iSegReg, RTGCPTR GCPtrMem);
     
    91609161
    91619162
     9163/**
     9164 * Fetches a data dword and zero extends it to a qword.
     9165 *
     9166 * @returns Strict VBox status code.
     9167 * @param   pVCpu               The cross context virtual CPU structure of the calling thread.
     9168 * @param   pu64Dst             Where to return the qword.
     9169 * @param   iSegReg             The index of the segment register to use for
     9170 *                              this access.  The base and limits are checked.
     9171 * @param   GCPtrMem            The address of the guest memory.
     9172 */
     9173IEM_STATIC VBOXSTRICTRC iemMemFetchDataU32_ZX_U64(PVMCPUCC pVCpu, uint64_t *pu64Dst, uint8_t iSegReg, RTGCPTR GCPtrMem)
     9174{
     9175    /* The lazy approach for now... */
     9176    uint32_t const *pu32Src;
     9177    VBOXSTRICTRC rc = iemMemMap(pVCpu, (void **)&pu32Src, sizeof(*pu32Src), iSegReg, GCPtrMem, IEM_ACCESS_DATA_R);
     9178    if (rc == VINF_SUCCESS)
     9179    {
     9180        *pu64Dst = *pu32Src;
     9181        rc = iemMemCommitAndUnmap(pVCpu, (void *)pu32Src, IEM_ACCESS_DATA_R);
     9182    }
     9183    return rc;
     9184}
     9185
     9186
    91629187#ifdef IEM_WITH_SETJMP
    91639188
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r82968 r84505  
    79087908            rcStrict = iemMemFetchDataU64(pVCpu, &u64Val, iEffSeg, GCPtrVal);
    79097909        else
    7910         {
    7911             uint32_t u32Val;
    7912             rcStrict = iemMemFetchDataU32(pVCpu, &u32Val, iEffSeg, GCPtrVal);
    7913             u64Val = u32Val;
    7914         }
     7910            rcStrict = iemMemFetchDataU32_ZX_U64(pVCpu, &u64Val, iEffSeg, GCPtrVal);
    79157911        if (RT_UNLIKELY(rcStrict != VINF_SUCCESS))
    79167912        {
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