VirtualBox

Changeset 102428 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Dec 1, 2023 11:55:37 PM (17 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160571
Message:

VMM/IEM: Continue refactoring IEM_MC_MEM_MAP into type specific MCs using bUnmapInfo. bugref:10371

Location:
trunk/src/VBox/VMM/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMInline.h

    r102427 r102428  
    38473847#include "../VMMAll/IEMAllMemRWTmplInline.cpp.h"
    38483848
     3849#define TMPL_MEM_TYPE       RTUINT128U
     3850#define TMPL_MEM_TYPE_ALIGN 15
     3851#define TMPL_MEM_TYPE_SIZE  16
     3852#define TMPL_MEM_FN_SUFF    U128
     3853#define TMPL_MEM_FMT_TYPE   "%.16Rhxs"
     3854#define TMPL_MEM_FMT_DESC   "dqword"
     3855#include "../VMMAll/IEMAllMemRWTmplInline.cpp.h"
     3856
    38493857#undef TMPL_MEM_CHECK_UNALIGNED_WITHIN_PAGE_OK
    38503858
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r102427 r102428  
    51135113void            iemMemFetchDataR80Jmp(PVMCPUCC pVCpu, PRTFLOAT80U pr80Dst, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
    51145114void            iemMemFetchDataD80Jmp(PVMCPUCC pVCpu, PRTPBCD80U pd80Dst, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
     5115void            iemMemFetchDataU128Jmp(PVMCPUCC pVCpu, PRTUINT128U pu128Dst, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
    51155116# endif
    5116 void            iemMemFetchDataU128Jmp(PVMCPUCC pVCpu, PRTUINT128U pu128Dst, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
    51175117void            iemMemFetchDataU128AlignedSseJmp(PVMCPUCC pVCpu, PRTUINT128U pu128Dst, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
    51185118void            iemMemFetchDataU256Jmp(PVMCPUCC pVCpu, PRTUINT256U pu256Dst, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
     
    51405140void            iemMemStoreDataU32SafeJmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, uint32_t u32Value) IEM_NOEXCEPT_MAY_LONGJMP;
    51415141void            iemMemStoreDataU64SafeJmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, uint64_t u64Value) IEM_NOEXCEPT_MAY_LONGJMP;
    5142 void            iemMemStoreDataU128SafeJmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, RTUINT128U u128Value) IEM_NOEXCEPT_MAY_LONGJMP;
     5142void            iemMemStoreDataU128SafeJmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, PCRTUINT128U u128Value) IEM_NOEXCEPT_MAY_LONGJMP;
    51435143void            iemMemStoreDataU128AlignedSseSafeJmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, RTUINT128U u128Value) IEM_NOEXCEPT_MAY_LONGJMP;
    51445144void            iemMemStoreDataU256SafeJmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, PCRTUINT256U pu256Value) IEM_NOEXCEPT_MAY_LONGJMP;
     
    51515151void            iemMemStoreDataU32Jmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, uint32_t u32Value) IEM_NOEXCEPT_MAY_LONGJMP;
    51525152void            iemMemStoreDataU64Jmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, uint64_t u64Value) IEM_NOEXCEPT_MAY_LONGJMP;
    5153 #endif
    51545153void            iemMemStoreDataU128Jmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, RTUINT128U u128Value) IEM_NOEXCEPT_MAY_LONGJMP;
     5154#endif
    51555155void            iemMemStoreDataU128AlignedSseJmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, RTUINT128U u128Value) IEM_NOEXCEPT_MAY_LONGJMP;
    51565156void            iemMemStoreDataU256Jmp(PVMCPUCC pVCpu, uint8_t iSegReg, RTGCPTR GCPtrMem, PCRTUINT256U pu256Value) IEM_NOEXCEPT_MAY_LONGJMP;
     
    51775177PRTPBCD80U      iemMemMapDataD80WoSafeJmp(PVMCPUCC pVCpu, uint8_t *pbUnmapInfo, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
    51785178PCRTPBCD80U     iemMemMapDataD80RoSafeJmp(PVMCPUCC pVCpu, uint8_t *pbUnmapInfo, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
     5179PRTUINT128U     iemMemMapDataU128RwSafeJmp(PVMCPUCC pVCpu, uint8_t *pbUnmapInfo, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
     5180PRTUINT128U     iemMemMapDataU128WoSafeJmp(PVMCPUCC pVCpu, uint8_t *pbUnmapInfo, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
     5181PCRTUINT128U    iemMemMapDataU128RoSafeJmp(PVMCPUCC pVCpu, uint8_t *pbUnmapInfo, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
    51795182
    51805183void            iemMemCommitAndUnmapRwSafeJmp(PVMCPUCC pVCpu, void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP;
  • trunk/src/VBox/VMM/include/IEMMc.h

    r102427 r102428  
    14201420#ifndef IEM_WITH_SETJMP
    14211421# define IEM_MC_STORE_MEM_U128(a_iSeg, a_GCPtrMem, a_u128Value) \
    1422     IEM_MC_RETURN_ON_FAILURE(iemMemStoreDataU128(pVCpu, (a_iSeg), (a_GCPtrMem), (a_u128Value)))
     1422    IEM_MC_RETURN_ON_FAILURE(iemMemStoreDataU128(pVCpu, (a_iSeg), (a_GCPtrMem), &(a_u128Value)))
    14231423# define IEM_MC_STORE_MEM_U128_ALIGN_SSE(a_iSeg, a_GCPtrMem, a_u128Value) \
    14241424    IEM_MC_RETURN_ON_FAILURE(iemMemStoreDataU128AlignedSse(pVCpu, (a_iSeg), (a_GCPtrMem), (a_u128Value)))
    14251425#else
    14261426# define IEM_MC_STORE_MEM_U128(a_iSeg, a_GCPtrMem, a_u128Value) \
    1427     iemMemStoreDataU128Jmp(pVCpu, (a_iSeg), (a_GCPtrMem), (a_u128Value))
     1427    iemMemStoreDataU128Jmp(pVCpu, (a_iSeg), (a_GCPtrMem), &(a_u128Value))
    14281428# define IEM_MC_STORE_MEM_U128_ALIGN_SSE(a_iSeg, a_GCPtrMem, a_u128Value) \
    14291429    iemMemStoreDataU128AlignedSseJmp(pVCpu, (a_iSeg), (a_GCPtrMem), (a_u128Value))
    14301430
    14311431# define IEM_MC_STORE_MEM_FLAT_U128(a_GCPtrMem, a_u128Value) \
    1432     iemMemStoreDataU128Jmp(pVCpu, UINT8_MAX, (a_GCPtrMem), (a_u128Value))
     1432    iemMemStoreDataU128Jmp(pVCpu, UINT8_MAX, (a_GCPtrMem), &(a_u128Value))
    14331433# define IEM_MC_STORE_MEM_FLAT_U128_ALIGN_SSE(a_GCPtrMem, a_u128Value) \
    14341434    iemMemStoreDataU128AlignedSseJmp(pVCpu, UINT8_MAX, (a_GCPtrMem), (a_u128Value))
     
    21492149# define IEM_MC_MEM_FLAT_MAP_R64_WO(a_pr64Mem, a_bUnmapInfo, a_GCPtrMem) \
    21502150    (a_pr64Mem) = (PRTFLOAT64U)iemMemFlatMapDataU64WoJmp(pVCpu, &(a_bUnmapInfo), (a_GCPtrMem))
     2151#endif
     2152
     2153
     2154/* 128-bit */
     2155
     2156/**
     2157 * Maps guest memory for dqword read+write direct (or bounce) buffer acccess.
     2158 *
     2159 * @param[out] a_pu128Mem   Where to return the pointer to the mapping.
     2160 * @param[out] a_bUnmapInfo Where to return umapping instructions. uint8_t.
     2161 * @param[in]  a_iSeg       The segment register to access via. No UINT8_MAX!
     2162 * @param[in]  a_GCPtrMem   The memory address.
     2163 * @remarks Will return/long jump on errors.
     2164 * @see     IEM_MC_MEM_COMMIT_AND_UNMAP_RW
     2165 */
     2166#ifndef IEM_WITH_SETJMP
     2167# define IEM_MC_MEM_MAP_U128_RW(a_pu128Mem, a_bUnmapInfo, a_iSeg, a_GCPtrMem) do { \
     2168        IEM_MC_RETURN_ON_FAILURE(iemMemMap(pVCpu, (void **)&(a_pu128Mem), sizeof(RTUINT128U), (a_iSeg), \
     2169                                           (a_GCPtrMem), IEM_ACCESS_DATA_RW, sizeof(RTUINT128U) - 1)); \
     2170        a_bUnmapInfo = 1 | ((IEM_ACCESS_TYPE_READ | IEM_ACCESS_TYPE_WRITE) << 4); \
     2171    } while (0)
     2172#else
     2173# define IEM_MC_MEM_MAP_U128_RW(a_pu128Mem, a_bUnmapInfo, a_iSeg, a_GCPtrMem) \
     2174    (a_pu128Mem) = iemMemMapDataU128RwJmp(pVCpu, &(a_bUnmapInfo), (a_iSeg), (a_GCPtrMem))
     2175#endif
     2176
     2177/**
     2178 * Maps guest memory for dqword writeonly direct (or bounce) buffer acccess.
     2179 *
     2180 * @param[out] a_pu128Mem   Where to return the pointer to the mapping.
     2181 * @param[out] a_bUnmapInfo Where to return umapping instructions. uint8_t.
     2182 * @param[in]  a_iSeg       The segment register to access via. No UINT8_MAX!
     2183 * @param[in]  a_GCPtrMem   The memory address.
     2184 * @remarks Will return/long jump on errors.
     2185 * @see     IEM_MC_MEM_COMMIT_AND_UNMAP_WO
     2186 */
     2187#ifndef IEM_WITH_SETJMP
     2188# define IEM_MC_MEM_MAP_U128_WO(a_pu128Mem, a_bUnmapInfo, a_iSeg, a_GCPtrMem) do { \
     2189        IEM_MC_RETURN_ON_FAILURE(iemMemMap(pVCpu, (void **)&(a_pu128Mem), sizeof(RTUINT128), (a_iSeg), \
     2190                                           (a_GCPtrMem), IEM_ACCESS_DATA_W, sizeof(RTUINT128) - 1)); \
     2191        a_bUnmapInfo = 1 | (IEM_ACCESS_TYPE_WRITE << 4); \
     2192    } while (0)
     2193#else
     2194# define IEM_MC_MEM_MAP_U128_WO(a_pu128Mem, a_bUnmapInfo, a_iSeg, a_GCPtrMem) \
     2195    (a_pu128Mem) = iemMemMapDataU128WoJmp(pVCpu, &(a_bUnmapInfo), (a_iSeg), (a_GCPtrMem))
     2196#endif
     2197
     2198/**
     2199 * Maps guest memory for dqword readonly direct (or bounce) buffer acccess.
     2200 *
     2201 * @param[out] a_pu128Mem   Where to return the pointer to the mapping.
     2202 * @param[out] a_bUnmapInfo Where to return umapping instructions. uint8_t.
     2203 * @param[in]  a_iSeg       The segment register to access via. No UINT8_MAX!
     2204 * @param[in]  a_GCPtrMem   The memory address.
     2205 * @remarks Will return/long jump on errors.
     2206 * @see     IEM_MC_MEM_COMMIT_AND_UNMAP_RO
     2207 */
     2208#ifndef IEM_WITH_SETJMP
     2209# define IEM_MC_MEM_MAP_U128_RO(a_pu128Mem, a_bUnmapInfo, a_iSeg, a_GCPtrMem) do { \
     2210        IEM_MC_RETURN_ON_FAILURE(iemMemMap(pVCpu, (void **)&(a_pu128Mem), sizeof(RTUINT128), (a_iSeg), \
     2211                                           (a_GCPtrMem), IEM_ACCESS_DATA_R, sizeof(RTUINT128) - 1)); \
     2212        a_bUnmapInfo = 1 | (IEM_ACCESS_TYPE_READ << 4); \
     2213    } while (0)
     2214#else
     2215# define IEM_MC_MEM_MAP_U128_RO(a_pu128Mem, a_bUnmapInfo, a_iSeg, a_GCPtrMem) \
     2216    (a_pu128Mem) = iemMemMapDataU128RoJmp(pVCpu, &(a_bUnmapInfo), (a_iSeg), (a_GCPtrMem))
     2217#endif
     2218
     2219/**
     2220 * Maps guest memory for dqword read+write direct (or bounce) buffer acccess,
     2221 * flat address variant.
     2222 *
     2223 * @param[out] a_pu128Mem   Where to return the pointer to the mapping.
     2224 * @param[out] a_bUnmapInfo Where to return umapping instructions. uint8_t.
     2225 * @param[in]  a_GCPtrMem   The memory address.
     2226 * @remarks Will return/long jump on errors.
     2227 * @see     IEM_MC_MEM_COMMIT_AND_UNMAP_RW
     2228 */
     2229#ifndef IEM_WITH_SETJMP
     2230# define IEM_MC_MEM_FLAT_MAP_U128_RW(a_pu128Mem, a_bUnmapInfo, a_GCPtrMem) do { \
     2231        IEM_MC_RETURN_ON_FAILURE(iemMemMap(pVCpu, (void **)&(a_pu128Mem), sizeof(RTUINT128), UINT8_MAX, \
     2232                                           (a_GCPtrMem), IEM_ACCESS_DATA_RW, sizeof(RTUINT128) - 1)); \
     2233        a_bUnmapInfo = 1 | ((IEM_ACCESS_TYPE_READ | IEM_ACCESS_TYPE_WRITE) << 4); \
     2234    } while (0)
     2235#else
     2236# define IEM_MC_MEM_FLAT_MAP_U128_RW(a_pu128Mem, a_bUnmapInfo, a_GCPtrMem) \
     2237    (a_pu128Mem) = iemMemFlatMapDataU128RwJmp(pVCpu, &(a_bUnmapInfo), (a_GCPtrMem))
     2238#endif
     2239
     2240/**
     2241 * Maps guest memory for dqword writeonly direct (or bounce) buffer acccess,
     2242 * flat address variant.
     2243 *
     2244 * @param[out] a_pu128Mem   Where to return the pointer to the mapping.
     2245 * @param[out] a_bUnmapInfo Where to return umapping instructions. uint8_t.
     2246 * @param[in]  a_GCPtrMem   The memory address.
     2247 * @remarks Will return/long jump on errors.
     2248 * @see     IEM_MC_MEM_COMMIT_AND_UNMAP_WO
     2249 */
     2250#ifndef IEM_WITH_SETJMP
     2251# define IEM_MC_MEM_FLAT_MAP_U128_WO(a_pu128Mem, a_bUnmapInfo, a_GCPtrMem) do { \
     2252        IEM_MC_RETURN_ON_FAILURE(iemMemMap(pVCpu, (void **)&(a_pu128Mem), sizeof(RTUINT128), UINT8_MAX, \
     2253                                           (a_GCPtrMem), IEM_ACCESS_DATA_W, sizeof(RTUINT128) - 1)); \
     2254        a_bUnmapInfo = 1 | (IEM_ACCESS_TYPE_WRITE << 4); \
     2255    } while (0)
     2256#else
     2257# define IEM_MC_MEM_FLAT_MAP_U128_WO(a_pu128Mem, a_bUnmapInfo, a_GCPtrMem) \
     2258    (a_pu128Mem) = iemMemFlatMapDataU128WoJmp(pVCpu, &(a_bUnmapInfo), (a_GCPtrMem))
     2259#endif
     2260
     2261/**
     2262 * Maps guest memory for dqword readonly direct (or bounce) buffer acccess, flat
     2263 * address variant.
     2264 *
     2265 * @param[out] a_pu128Mem   Where to return the pointer to the mapping.
     2266 * @param[out] a_bUnmapInfo Where to return umapping instructions. uint8_t.
     2267 * @param[in]  a_GCPtrMem   The memory address.
     2268 * @remarks Will return/long jump on errors.
     2269 * @see     IEM_MC_MEM_COMMIT_AND_UNMAP_RO
     2270 */
     2271#ifndef IEM_WITH_SETJMP
     2272# define IEM_MC_MEM_FLAT_MAP_U128_RO(a_pu128Mem, a_bUnmapInfo, a_GCPtrMem) do { \
     2273        IEM_MC_RETURN_ON_FAILURE(iemMemMap(pVCpu, (void **)&(a_pu128Mem), sizeof(RTUINT128), UINT8_MAX, \
     2274                                           (a_GCPtrMem), IEM_ACCESS_DATA_R, sizeof(RTUINT128) - 1)); \
     2275        a_bUnmapInfo = 1 | (IEM_ACCESS_TYPE_READ << 4); \
     2276    } while (0)
     2277#else
     2278# define IEM_MC_MEM_FLAT_MAP_U128_RO(a_pu128Mem, a_bUnmapInfo, a_GCPtrMem) \
     2279    (a_pu128Mem) = iemMemFlatMapDataU128RoJmp(pVCpu, &(a_bUnmapInfo), (a_GCPtrMem))
    21512280#endif
    21522281
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