VirtualBox

Changeset 62162 in vbox for trunk/src


Ignore:
Timestamp:
Jul 11, 2016 3:03:44 PM (9 years ago)
Author:
vboxsync
Message:

VMM, IOAPIC: Temporarily enable using the PDM lock instead of the dedicated I/O APIC lock.

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevIOAPIC_New.cpp

    r62033 r62162  
    177177#endif
    178178
     179#define IOAPIC_WITH_PDM_CRITSECT
     180#ifdef IOAPIC_WITH_PDM_CRITSECT
     181# define IOAPIC_LOCK(pThis, rcBusy)         (pThis)->CTX_SUFF(pIoApicHlp)->pfnLock((pThis)->CTX_SUFF(pDevIns), (rcBusy))
     182# define IOAPIC_UNLOCK(pThis)               (pThis)->CTX_SUFF(pIoApicHlp)->pfnUnlock((pThis)->CTX_SUFF(pDevIns))
     183#else
     184# define IOAPIC_LOCK(pThis, rcBusy)         PDMCritSectEnter(&(pThis)->CritSect, (rcBusy))
     185# define IOAPIC_UNLOCK(pThis)               PDMCritSectLeave(&(pThis)->CritSect)
     186#endif
     187
    179188
    180189/*********************************************************************************************************************************
     
    220229    uint32_t                uIrr;
    221230
     231#ifndef IOAPIC_WITH_PDM_CRITSECT
    222232    /** The critsect for updating to the RTEs. */
    223233    PDMCRITSECT             CritSect;
     234#endif
    224235
    225236#ifdef VBOX_WITH_STATISTICS
     
    362373static void ioapicSignalIntrForRte(PIOAPIC pThis, uint8_t idxRte)
    363374{
     375#ifndef IOAPIC_WITH_PDM_CRITSECT
    364376    Assert(PDMCritSectIsOwner(&pThis->CritSect));
     377#endif
    365378
    366379    /* Ensure the RTE isn't masked. */
     
    463476                                                            RT_ELEMENTS(pThis->au64RedirTable)));
    464477
    465     int rc = PDMCritSectEnter(&pThis->CritSect, VINF_IOM_R3_MMIO_WRITE);
     478    int rc = IOAPIC_LOCK(pThis, VINF_IOM_R3_MMIO_WRITE);
    466479    if (rc == VINF_SUCCESS)
    467480    {
     
    496509            ioapicSignalIntrForRte(pThis, idxRte);
    497510
    498         PDMCritSectLeave(&pThis->CritSect);
     511        IOAPIC_UNLOCK(pThis);
    499512        LogFlow(("IOAPIC: ioapicSetRedirTableEntry: uIndex=%#RX32 idxRte=%u uValue=%#RX32\n", uIndex, idxRte, uValue));
    500513    }
     
    579592
    580593    bool fRemoteIrrCleared = false;
    581     int rc = PDMCritSectEnter(&pThis->CritSect, VINF_IOM_R3_MMIO_WRITE);
     594    int rc = IOAPIC_LOCK(pThis, VINF_IOM_R3_MMIO_WRITE);
    582595    if (rc == VINF_SUCCESS)
    583596    {
     
    605618        }
    606619
    607         PDMCritSectLeave(&pThis->CritSect);
     620        IOAPIC_UNLOCK(pThis);
    608621        AssertMsg(fRemoteIrrCleared, ("Failed to clear remote IRR for vector %#x (%u)\n", u8Vector, u8Vector));
    609622    }
     
    633646    if (RT_LIKELY(iIrq >= 0 && iIrq < (int)RT_ELEMENTS(pThis->au64RedirTable)))
    634647    {
    635         int rc = PDMCritSectEnter(&pThis->CritSect, VINF_SUCCESS);
     648        int rc = IOAPIC_LOCK(pThis, VINF_SUCCESS);
    636649        AssertRC(rc);
    637650
     
    651664        {
    652665            pThis->uIrr &= ~uPinMask;
    653             PDMCritSectLeave(&pThis->CritSect);
     666            IOAPIC_UNLOCK(pThis);
    654667            return;
    655668        }
     
    704717        }
    705718
    706         PDMCritSectLeave(&pThis->CritSect);
     719        IOAPIC_UNLOCK(pThis);
    707720    }
    708721#undef IOAPIC_ASSERT_IRQ
     
    10781091
    10791092    /* There might be devices threads calling ioapicSetIrq() in parallel, hence the lock. */
    1080     PDMCritSectEnter(&pThis->CritSect, VERR_IGNORED);
     1093    IOAPIC_LOCK(pThis, VERR_IGNORED);
    10811094
    10821095    pThis->uIrr    = 0;
     
    10901103    }
    10911104
    1092     PDMCritSectLeave(&pThis->CritSect);
     1105    IOAPIC_UNLOCK(pThis);
    10931106}
    10941107
     
    11161129    PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns);
    11171130
     1131#ifndef IOAPIC_WITH_PDM_CRITSECT
    11181132    /*
    11191133     * Destroy the RTE critical section.
     
    11211135    if (PDMCritSectIsInitialized(&pThis->CritSect))
    11221136        PDMR3CritSectDelete(&pThis->CritSect);
     1137#endif
    11231138
    11241139    return VINF_SUCCESS;
     
    11691184    AssertRCReturn(rc, rc);
    11701185
     1186#ifndef IOAPIC_WITH_PDM_CRITSECT
    11711187    /*
    11721188     * Setup the critical section to protect concurrent writes to the RTEs.
     
    11751191    if (RT_FAILURE(rc))
    11761192        return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, N_("IOAPIC: Failed to create critical section. rc=%Rrc"), rc);
     1193#endif
    11771194
    11781195    /*
  • trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp

    r61776 r62162  
    716716{
    717717    PDMDEV_ASSERT_DEVINS(pDevIns);
    718 #ifdef VBOX_WITH_NEW_IOAPIC
    719     AssertFailed();
    720 #endif
    721718    return pdmLockEx(pDevIns->Internal.s.pVMR0, rc);
    722719}
     
    727724{
    728725    PDMDEV_ASSERT_DEVINS(pDevIns);
    729 #ifdef VBOX_WITH_NEW_IOAPIC
    730     AssertFailed();
    731 #endif
    732726    pdmUnlock(pDevIns->Internal.s.pVMR0);
    733727}
  • trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp

    r61776 r62162  
    482482    PDMDEV_ASSERT_DEVINS(pDevIns);
    483483    LogFlow(("pdmR3IoApicHlp_Lock: caller='%s'/%d: rc=%Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
    484 #ifdef VBOX_WITH_NEW_IOAPIC
    485     AssertFailed();
    486 #endif
    487484    return pdmLockEx(pDevIns->Internal.s.pVMR3, rc);
    488485}
     
    494491    PDMDEV_ASSERT_DEVINS(pDevIns);
    495492    LogFlow(("pdmR3IoApicHlp_Unlock: caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
    496 #ifdef VBOX_WITH_NEW_IOAPIC
    497     AssertFailed();
    498 #endif
    499493    pdmUnlock(pDevIns->Internal.s.pVMR3);
    500494}
  • trunk/src/VBox/VMM/VMMRC/PDMRCDevice.cpp

    r61776 r62162  
    671671{
    672672    PDMDEV_ASSERT_DEVINS(pDevIns);
    673 #ifdef VBOX_WITH_NEW_IOAPIC
    674     AssertFailed();
    675 #endif
    676673    return pdmLockEx(pDevIns->Internal.s.pVMRC, rc);
    677674}
     
    682679{
    683680    PDMDEV_ASSERT_DEVINS(pDevIns);
    684 #ifdef VBOX_WITH_NEW_IOAPIC
    685     AssertFailed();
    686 #endif
    687681    pdmUnlock(pDevIns->Internal.s.pVMRC);
    688682}
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