Changeset 89620 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 11, 2021 8:51:10 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevIoApic.cpp
r89098 r89620 313 313 /** Number of IOMMU denied or failed MSIs. */ 314 314 STAMCOUNTER StatIommuDiscardedMsi; 315 /** Number of returns to ring-3 due to EOI broadcast lock contention. */316 STAMCOUNTER StatEoiContention;317 315 /** Number of returns to ring-3 due to Set RTE lock contention. */ 318 316 STAMCOUNTER StatSetRteContention; … … 845 843 * @interface_method_impl{PDMIOAPICREG,pfnSetEoi} 846 844 */ 847 static DECLCALLBACK( VBOXSTRICTRC) ioapicSetEoi(PPDMDEVINS pDevIns, uint8_t u8Vector)845 static DECLCALLBACK(void) ioapicSetEoi(PPDMDEVINS pDevIns, uint8_t u8Vector) 848 846 { 849 847 PIOAPIC pThis = PDMDEVINS_2_DATA(pDevIns, PIOAPIC); 850 848 PIOAPICCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PIOAPICCC); 849 850 LogFlow(("IOAPIC: ioapicSetEoi: u8Vector=%#x (%u)\n", u8Vector, u8Vector)); 851 851 STAM_COUNTER_INC(&pThis->CTX_SUFF_Z(StatSetEoi)); 852 LogFlow(("IOAPIC: ioapicSetEoi: u8Vector=%#x (%u)\n", u8Vector, u8Vector));853 852 854 853 bool fRemoteIrrCleared = false; 855 VBOXSTRICTRC rc = IOAPIC_LOCK(pDevIns, pThis, pThisCC, VINF_IOM_R3_MMIO_WRITE); 856 if (rc == VINF_SUCCESS) 857 { 858 for (uint8_t idxRte = 0; idxRte < RT_ELEMENTS(pThis->au64RedirTable); idxRte++) 854 int rc = IOAPIC_LOCK(pDevIns, pThis, pThisCC, VINF_SUCCESS); 855 AssertRC(rc); 856 857 for (uint8_t idxRte = 0; idxRte < RT_ELEMENTS(pThis->au64RedirTable); idxRte++) 858 { 859 uint64_t const u64Rte = pThis->au64RedirTable[idxRte]; 860 if (IOAPIC_RTE_GET_VECTOR(u64Rte) == u8Vector) 859 861 { 860 uint64_t const u64Rte = pThis->au64RedirTable[idxRte];861 if (IOAPIC_RTE_GET_VECTOR(u64Rte) == u8Vector)862 {863 862 #ifdef DEBUG_ramshankar 864 865 863 /* This assertion may trigger when restoring saved-states created using the old, incorrect I/O APIC code. */ 864 Assert(IOAPIC_RTE_GET_REMOTE_IRR(u64Rte)); 866 865 #endif 867 pThis->au64RedirTable[idxRte] &= ~IOAPIC_RTE_REMOTE_IRR; 868 fRemoteIrrCleared = true; 869 STAM_COUNTER_INC(&pThis->StatEoiReceived); 870 Log2(("IOAPIC: ioapicSetEoi: Cleared remote IRR, idxRte=%u vector=%#x (%u)\n", idxRte, u8Vector, u8Vector)); 871 872 /* 873 * Signal the next pending interrupt for this RTE. 874 */ 875 uint32_t const uPinMask = UINT32_C(1) << idxRte; 876 if (pThis->uIrr & uPinMask) 877 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, idxRte); 878 } 866 pThis->au64RedirTable[idxRte] &= ~IOAPIC_RTE_REMOTE_IRR; 867 fRemoteIrrCleared = true; 868 STAM_COUNTER_INC(&pThis->StatEoiReceived); 869 Log2(("IOAPIC: ioapicSetEoi: Cleared remote IRR, idxRte=%u vector=%#x (%u)\n", idxRte, u8Vector, u8Vector)); 870 871 /* 872 * Signal the next pending interrupt for this RTE. 873 */ 874 uint32_t const uPinMask = UINT32_C(1) << idxRte; 875 if (pThis->uIrr & uPinMask) 876 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, idxRte); 879 877 } 880 881 IOAPIC_UNLOCK(pDevIns, pThis, pThisCC); 878 } 879 880 IOAPIC_UNLOCK(pDevIns, pThis, pThisCC); 881 882 882 #ifndef VBOX_WITH_IOMMU_AMD 883 883 AssertMsg(fRemoteIrrCleared, ("Failed to clear remote IRR for vector %#x (%u)\n", u8Vector, u8Vector)); 884 884 #endif 885 }886 else887 STAM_COUNTER_INC(&pThis->StatEoiContention);888 889 return rc;890 885 } 891 886 … … 1119 1114 case IOAPIC_DIRECT_OFF_EOI: 1120 1115 if (pThis->u8ApicVer == IOAPIC_VERSION_ICH9) 1121 rc =ioapicSetEoi(pDevIns, uValue);1116 ioapicSetEoi(pDevIns, uValue); 1122 1117 else 1123 1118 Log(("IOAPIC: ioapicMmioWrite: Write to EOI register ignored!\n")); … … 1668 1663 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatIommuDiscardedMsi, STAMTYPE_COUNTER, "Iommu/DiscardedMsi", STAMUNIT_OCCURENCES, "Number of MSIs discarded by the IOMMU."); 1669 1664 1670 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatEoiContention, STAMTYPE_COUNTER, "CritSect/ContentionSetEoi", STAMUNIT_OCCURENCES, "Number of times the critsect is busy during EOI writes causing trips to R3.");1671 1665 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatSetRteContention, STAMTYPE_COUNTER, "CritSect/ContentionSetRte", STAMUNIT_OCCURENCES, "Number of times the critsect is busy during RTE writes causing trips to R3."); 1672 1666
Note:
See TracChangeset
for help on using the changeset viewer.