VirtualBox

Changeset 100847 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 9, 2023 11:27:22 PM (18 months ago)
Author:
vboxsync
Message:

VMM/IEM: Dedicated code for IEM_MC_MEM_COMMIT_AND_UNMAP_RW/WO/RO. bugref:10369

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

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

    r100820 r100847  
    68416841}
    68426842
     6843
     6844/** Fallback for iemMemCommitAndUnmapRwJmp.  */
     6845void iemMemCommitAndUnmapRwSafeJmp(PVMCPUCC pVCpu, void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP
     6846{
     6847    Assert(bMapInfo == (1 | ((IEM_ACCESS_TYPE_READ | IEM_ACCESS_TYPE_WRITE) << 4)) ); RT_NOREF_PV(bMapInfo);
     6848    iemMemCommitAndUnmapJmp(pVCpu, pvMem, IEM_ACCESS_DATA_RW);
     6849}
     6850
     6851
     6852/** Fallback for iemMemCommitAndUnmapWoJmp.  */
     6853void iemMemCommitAndUnmapWoSafeJmp(PVMCPUCC pVCpu, void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP
     6854{
     6855    Assert(bMapInfo == (1 | (IEM_ACCESS_TYPE_WRITE << 4)) ); RT_NOREF_PV(bMapInfo);
     6856    iemMemCommitAndUnmapJmp(pVCpu, pvMem, IEM_ACCESS_DATA_W);
     6857}
     6858
     6859
     6860/** Fallback for iemMemCommitAndUnmapRoJmp.  */
     6861void iemMemCommitAndUnmapRoSafeJmp(PVMCPUCC pVCpu, const void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP
     6862{
     6863    Assert(bMapInfo == (1 | (IEM_ACCESS_TYPE_READ << 4)) ); RT_NOREF_PV(bMapInfo);
     6864    iemMemCommitAndUnmapJmp(pVCpu, (void *)pvMem, IEM_ACCESS_DATA_R);
     6865}
     6866
    68436867#endif /* IEM_WITH_SETJMP */
    68446868
  • trunk/src/VBox/VMM/include/IEMInline.h

    r100830 r100847  
    34123412}
    34133413
     3414
     3415/*
     3416 * Unmap helpers.
     3417 */
     3418
     3419#ifdef IEM_WITH_SETJMP
     3420
     3421DECL_INLINE_THROW(void) iemMemCommitAndUnmapRwJmp(PVMCPUCC pVCpu, void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP
     3422{
     3423    iemMemCommitAndUnmapRwSafeJmp(pVCpu, pvMem, bMapInfo);
     3424}
     3425
     3426
     3427DECL_INLINE_THROW(void) iemMemCommitAndUnmapWoJmp(PVMCPUCC pVCpu, void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP
     3428{
     3429    iemMemCommitAndUnmapWoSafeJmp(pVCpu, pvMem, bMapInfo);
     3430}
     3431
     3432
     3433DECL_INLINE_THROW(void) iemMemCommitAndUnmapRoJmp(PVMCPUCC pVCpu, const void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP
     3434{
     3435    iemMemCommitAndUnmapRoSafeJmp(pVCpu, pvMem, bMapInfo);
     3436}
     3437
     3438#endif /* IEM_WITH_SETJMP */
     3439
     3440
    34143441/*
    34153442 * Instantiate R/W inline templates.
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r100840 r100847  
    46754675uint64_t       *iemMemMapDataU64WoSafeJmp(PVMCPUCC pVCpu, uint8_t *pbUnmapInfo, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
    46764676uint64_t const *iemMemMapDataU64RoSafeJmp(PVMCPUCC pVCpu, uint8_t *pbUnmapInfo, uint8_t iSegReg, RTGCPTR GCPtrMem) IEM_NOEXCEPT_MAY_LONGJMP;
     4677
     4678void            iemMemCommitAndUnmapRwSafeJmp(PVMCPUCC pVCpu, void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP;
     4679void            iemMemCommitAndUnmapWoSafeJmp(PVMCPUCC pVCpu, void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP;
     4680void            iemMemCommitAndUnmapRoSafeJmp(PVMCPUCC pVCpu, const void *pvMem, uint8_t bMapInfo) IEM_NOEXCEPT_MAY_LONGJMP;
    46774681#endif
    46784682
  • trunk/src/VBox/VMM/include/IEMMc.h

    r100840 r100847  
    4848    { \
    4949        VBOXSTRICTRC rcStrict2 = a_Expr; \
    50         if (rcStrict2 != VINF_SUCCESS) \
     50        if (rcStrict2 == VINF_SUCCESS) \
     51        { /* likely */ } \
     52        else \
    5153            return rcStrict2; \
    5254    } while (0)
     
    18871889 * @remarks     May return.
    18881890 */
    1889 #define IEM_MC_MEM_COMMIT_AND_UNMAP_RW(a_pvMem, a_bMapInfo) do { \
     1891#ifndef IEM_WITH_SETJMP
     1892# define IEM_MC_MEM_COMMIT_AND_UNMAP_RW(a_pvMem, a_bMapInfo) do { \
    18901893        RT_NOREF_PV(a_bMapInfo); Assert(a_bMapInfo == (1 | ((IEM_ACCESS_TYPE_READ | IEM_ACCESS_TYPE_WRITE) << 4)) ); \
    18911894        IEM_MC_RETURN_ON_FAILURE(iemMemCommitAndUnmap(pVCpu, (a_pvMem), IEM_ACCESS_DATA_RW)); \
    18921895    } while (0)
     1896#else
     1897# define IEM_MC_MEM_COMMIT_AND_UNMAP_RW(a_pvMem, a_bMapInfo) \
     1898    iemMemCommitAndUnmapRwJmp(pVCpu, (a_pvMem), (a_bMapInfo))
     1899#endif
    18931900
    18941901/** Commits the memory and unmaps guest memory previously mapped W.
    18951902 * @remarks     May return.
    18961903 */
    1897 #define IEM_MC_MEM_COMMIT_AND_UNMAP_WO(a_pvMem, a_bMapInfo) do { \
     1904#ifndef IEM_WITH_SETJMP
     1905# define IEM_MC_MEM_COMMIT_AND_UNMAP_WO(a_pvMem, a_bMapInfo) do { \
    18981906        RT_NOREF_PV(a_bMapInfo); Assert(a_bMapInfo == (1 | (IEM_ACCESS_TYPE_WRITE << 4)) ); \
    18991907        IEM_MC_RETURN_ON_FAILURE(iemMemCommitAndUnmap(pVCpu, (a_pvMem), IEM_ACCESS_DATA_W)); \
    19001908    } while (0)
     1909#else
     1910# define IEM_MC_MEM_COMMIT_AND_UNMAP_WO(a_pvMem, a_bMapInfo) \
     1911    iemMemCommitAndUnmapWoJmp(pVCpu, (a_pvMem), (a_bMapInfo))
     1912#endif
    19011913
    19021914/** Commits the memory and unmaps guest memory previously mapped R.
    19031915 * @remarks     May return.
    19041916 */
    1905 #define IEM_MC_MEM_COMMIT_AND_UNMAP_RO(a_pvMem, a_bMapInfo) do { \
     1917#ifndef IEM_WITH_SETJMP
     1918# define IEM_MC_MEM_COMMIT_AND_UNMAP_RO(a_pvMem, a_bMapInfo) do { \
    19061919        RT_NOREF_PV(a_bMapInfo); Assert(a_bMapInfo == (1 | (IEM_ACCESS_TYPE_READ << 4)) ); \
    19071920        IEM_MC_RETURN_ON_FAILURE(iemMemCommitAndUnmap(pVCpu, (void *)(a_pvMem), IEM_ACCESS_DATA_R)); \
    19081921    } while (0)
     1922#else
     1923# define IEM_MC_MEM_COMMIT_AND_UNMAP_RO(a_pvMem, a_bMapInfo) \
     1924    iemMemCommitAndUnmapRoJmp(pVCpu, (a_pvMem), (a_bMapInfo))
     1925#endif
    19091926
    19101927
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