VirtualBox

Changeset 80923 in vbox for trunk


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

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

Location:
trunk/src/VBox/Devices
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r80704 r80923  
    16381638{
    16391639    E1kLog(("%s Hard reset triggered\n", pThis->szPrf));
     1640    /* No interrupts should survive device reset, see @bugref(9556). */
     1641    if (pThis->fIntRaised)
     1642    {
     1643        /* Lower(0) INTA(0) */
     1644        PDMDevHlpPCISetIrq(pThis->CTX_SUFF(pDevIns), 0, 0);
     1645        pThis->fIntRaised = false;
     1646        E1kLog(("%s e1kHardReset: Lowered IRQ: ICR=%08x\n", pThis->szPrf, ICR));
     1647    }
    16401648    memset(pThis->auRegs,        0, sizeof(pThis->auRegs));
    16411649    memset(pThis->aRecAddr.au32, 0, sizeof(pThis->aRecAddr.au32));
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r80704 r80923  
    34253425    uint16_t checksum;
    34263426
     3427    /* Lower any raised interrupts, see @bugref(9556) */
     3428    if (RT_UNLIKELY(pThis->iISR))
     3429    {
     3430        pThis->iISR = 0;
     3431        if (!PCNET_IS_ISA(pThis))
     3432        {
     3433            Log(("#%d INTA=%d\n", PCNET_INST_NR, pThis->iISR));
     3434            PDMDevHlpPCISetIrq(PCNETSTATE_2_DEVINS(pThis), 0, pThis->iISR);
     3435        }
     3436        else
     3437        {
     3438            Log(("#%d IRQ=%d, state=%d\n", PCNET_INST_NR, pThis->uIsaIrq, pThis->iISR));
     3439            PDMDevHlpISASetIrq(PCNETSTATE_2_DEVINS(pThis), pThis->uIsaIrq, pThis->iISR);
     3440        }
     3441    }
    34273442    /* Initialize the PROM */
    34283443    Assert(sizeof(pThis->MacConfigured) == 6);
  • 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