VirtualBox

Changeset 80923 in vbox for trunk/src/VBox/Devices/VirtIO


Ignore:
Timestamp:
Sep 20, 2019 12:01:11 PM (5 years ago)
Author:
vboxsync
Message:

Dev/Net: @bugref:9556 Lower interrupts on reset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VirtIO/Virtio.cpp

    r76553 r80923  
    309309}
    310310
     311
     312/**
     313 * Raise interrupt.
     314 *
     315 * @param   pState      The device state structure.
     316 * @param   rcBusy      Status code to return when the critical section is busy.
     317 * @param   u8IntCause  Interrupt cause bit mask to set in PCI ISR port.
     318 */
     319int vpciRaiseInterrupt(VPCISTATE *pState, int rcBusy, uint8_t u8IntCause)
     320{
     321    RT_NOREF_PV(rcBusy);
     322    // int rc = vpciCsEnter(pState, rcBusy);
     323    // if (RT_UNLIKELY(rc != VINF_SUCCESS))
     324    //     return rc;
     325
     326    STAM_COUNTER_INC(&pState->StatIntsRaised);
     327    LogFlow(("%s vpciRaiseInterrupt: u8IntCause=%x\n",
     328             INSTANCE(pState), u8IntCause));
     329
     330    pState->uISR |= u8IntCause;
     331    PDMDevHlpPCISetIrq(pState->CTX_SUFF(pDevIns), 0, 1);
     332    // vpciCsLeave(pState);
     333    return VINF_SUCCESS;
     334}
     335
     336/**
     337 * Lower interrupt.
     338 *
     339 * @param   pState      The device state structure.
     340 */
     341static void vpciLowerInterrupt(VPCISTATE *pState)
     342{
     343    LogFlow(("%s vpciLowerInterrupt\n", INSTANCE(pState)));
     344    PDMDevHlpPCISetIrq(pState->CTX_SUFF(pDevIns), 0, 0);
     345}
     346
     347
    311348void vpciReset(PVPCISTATE pState)
    312349{
     350    /* No interrupts should survive device reset, see @bugref(9556). */
     351    if (pState->uISR)
     352        vpciLowerInterrupt(pState);
     353
    313354    pState->uGuestFeatures = 0;
    314355    pState->uQueueSelector = 0;
     
    320361}
    321362
    322 
    323 /**
    324  * Raise interrupt.
    325  *
    326  * @param   pState      The device state structure.
    327  * @param   rcBusy      Status code to return when the critical section is busy.
    328  * @param   u8IntCause  Interrupt cause bit mask to set in PCI ISR port.
    329  */
    330 int vpciRaiseInterrupt(VPCISTATE *pState, int rcBusy, uint8_t u8IntCause)
    331 {
    332     RT_NOREF_PV(rcBusy);
    333     // int rc = vpciCsEnter(pState, rcBusy);
    334     // if (RT_UNLIKELY(rc != VINF_SUCCESS))
    335     //     return rc;
    336 
    337     STAM_COUNTER_INC(&pState->StatIntsRaised);
    338     LogFlow(("%s vpciRaiseInterrupt: u8IntCause=%x\n",
    339              INSTANCE(pState), u8IntCause));
    340 
    341     pState->uISR |= u8IntCause;
    342     PDMDevHlpPCISetIrq(pState->CTX_SUFF(pDevIns), 0, 1);
    343     // vpciCsLeave(pState);
    344     return VINF_SUCCESS;
    345 }
    346 
    347 /**
    348  * Lower interrupt.
    349  *
    350  * @param   pState      The device state structure.
    351  */
    352 static void vpciLowerInterrupt(VPCISTATE *pState)
    353 {
    354     LogFlow(("%s vpciLowerInterrupt\n", INSTANCE(pState)));
    355     PDMDevHlpPCISetIrq(pState->CTX_SUFF(pDevIns), 0, 0);
    356 }
    357363
    358364DECLINLINE(uint32_t) vpciGetHostFeatures(PVPCISTATE pState,
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