VirtualBox

Changeset 84281 in vbox


Ignore:
Timestamp:
May 13, 2020 10:55:19 AM (5 years ago)
Author:
vboxsync
Message:

Devices/UartCore: Switch to the virtual sync timer for the unconnected and receive FIFO timeout as the standard virtual timer is too imprecise and causes a slow down in the OpenIndiana 2020 boot menu with multiple vCPUs enabled for example

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/UartCore.cpp

    r82968 r84281  
    15011501    RT_NOREF(pTimer);
    15021502
    1503     PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); /** @todo r=bird: You already own this crit sect, don't you?!? */
     1503    VBOXSTRICTRC rc1 = PDMDevHlpTimerLockClock2(pDevIns, pThis->hTimerRcvFifoTimeout, &pThis->CritSect,
     1504                                                VINF_SUCCESS /* must get it */);
     1505    AssertRCReturnVoid(VBOXSTRICTRC_VAL(rc1));
    15041506
    15051507    if (pThis->FifoRecv.cbUsed < pThis->FifoRecv.cbItl)
     
    15091511    }
    15101512
    1511     PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
     1513    PDMDevHlpTimerUnlockClock2(pDevIns, pThis->hTimerRcvFifoTimeout, &pThis->CritSect);
    15121514}
    15131515
     
    15221524    RT_NOREF(pTimer);
    15231525
    1524     PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); /** @todo r=bird: You already own this crit sect, don't you?!? */
     1526    VBOXSTRICTRC rc1 = PDMDevHlpTimerLockClock2(pDevIns, pThis->hTimerTxUnconnected, &pThis->CritSect,
     1527                                                VINF_SUCCESS /* must get it */);
     1528    AssertRCReturnVoid(VBOXSTRICTRC_VAL(rc1));
    15251529
    15261530    uint8_t bVal = 0;
     
    15701574    }
    15711575
    1572     PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect);
     1576    PDMDevHlpTimerUnlockClock2(pDevIns, pThis->hTimerTxUnconnected, &pThis->CritSect);
    15731577}
    15741578
     
    20562060     * Create the receive FIFO character timeout indicator timer.
    20572061     */
    2058     rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL, uartR3RcvFifoTimeoutTimer, pThisCC,
     2062    rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, uartR3RcvFifoTimeoutTimer, pThisCC,
    20592063                              TMTIMER_FLAGS_NO_CRIT_SECT, "UART Rcv FIFO Timer",
    20602064                              &pThis->hTimerRcvFifoTimeout);
    20612065    AssertRCReturn(rc, rc);
    20622066
    2063     rc = PDMDevHlpTimerSetCritSect(pDevIns, pThis->hTimerRcvFifoTimeout, &pThis->CritSect);
    2064     AssertRCReturn(rc, rc);
    2065 
    20662067    /*
    20672068     * Create the transmit timer when no device is connected.
    20682069     */
    2069     rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL, uartR3TxUnconnectedTimer, pThisCC,
     2070    rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, uartR3TxUnconnectedTimer, pThisCC,
    20702071                              TMTIMER_FLAGS_NO_CRIT_SECT, "UART TX uncon. Timer",
    20712072                              &pThis->hTimerTxUnconnected);
    2072     AssertRCReturn(rc, rc);
    2073 
    2074     rc = PDMDevHlpTimerSetCritSect(pDevIns, pThis->hTimerTxUnconnected, &pThis->CritSect);
    20752073    AssertRCReturn(rc, rc);
    20762074
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