VirtualBox

Changeset 90426 in vbox


Ignore:
Timestamp:
Jul 30, 2021 1:22:04 PM (4 years ago)
Author:
vboxsync
Message:

IOM: Be more careful checking the status of IOM_LOCK_SHARED(). bugref:6695

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

Legend:

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

    r90346 r90426  
    6565    /* For lookups we need to share lock IOM. */
    6666    int rc2 = IOM_LOCK_SHARED(pVM);
    67 #ifndef IN_RING3
    68     if (rc2 == VERR_SEM_BUSY)
     67    if (RT_SUCCESS(rc2))
     68    { /* likely */ }
     69#ifndef IN_RING3
     70    else if (rc2 == VERR_SEM_BUSY)
    6971        return VINF_IOM_R3_IOPORT_READ;
    7072#endif
    71     AssertRC(rc2);
     73    else
     74        AssertMsgFailedReturn(("rc2=%Rrc\n", rc2), rc2);
    7275
    7376    /*
     
    189192    /* For lookups we need to share lock IOM. */
    190193    int rc2 = IOM_LOCK_SHARED(pVM);
    191 #ifndef IN_RING3
    192     if (rc2 == VERR_SEM_BUSY)
     194    if (RT_SUCCESS(rc2))
     195    { /* likely */ }
     196#ifndef IN_RING3
     197    else if (rc2 == VERR_SEM_BUSY)
    193198        return VINF_IOM_R3_IOPORT_READ;
    194199#endif
    195     AssertRC(rc2);
     200    else
     201        AssertMsgFailedReturn(("rc2=%Rrc\n", rc2), rc2);
    196202
    197203    const uint32_t cRequestedTransfers = *pcTransfers;
     
    365371    /* For lookups we need to share lock IOM. */
    366372    int rc2 = IOM_LOCK_SHARED(pVM);
    367 #ifndef IN_RING3
    368     if (rc2 == VERR_SEM_BUSY)
     373    if (RT_SUCCESS(rc2))
     374    { /* likely */ }
     375#ifndef IN_RING3
     376    else if (rc2 == VERR_SEM_BUSY)
    369377        return iomIOPortRing3WritePending(pVCpu, Port, u32Value, cbValue);
    370378#endif
    371     AssertRC(rc2);
     379    else
     380        AssertMsgFailedReturn(("rc2=%Rrc\n", rc2), rc2);
    372381
    373382    /*
     
    475484    /* Take the IOM lock before performing any device I/O. */
    476485    int rc2 = IOM_LOCK_SHARED(pVM);
    477 #ifndef IN_RING3
    478     if (rc2 == VERR_SEM_BUSY)
     486    if (RT_SUCCESS(rc2))
     487    { /* likely */ }
     488#ifndef IN_RING3
     489    else if (rc2 == VERR_SEM_BUSY)
    479490        return VINF_IOM_R3_IOPORT_WRITE;
    480491#endif
    481     AssertRC(rc2);
     492    else
     493        AssertMsgFailedReturn(("rc2=%Rrc\n", rc2), rc2);
    482494
    483495    const uint32_t cRequestedTransfers = *pcTransfers;
  • trunk/src/VBox/VMM/VMMAll/IOMAllMmioNew.cpp

    r90346 r90426  
    10211021 * @returns VBox status code.  This API may return VINF_SUCCESS even if no
    10221022 *          remapping is made.
     1023 * @retval  VERR_SEM_BUSY in ring-0 if we cannot get the IOM lock.
    10231024 *
    10241025 * @param   pVM             The cross context VM structure.
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