Changeset 89600 in vbox
- Timestamp:
- Jun 10, 2021 1:17:07 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmapi.h
r85121 r89600 55 55 VMM_INT_DECL(int) PDMIoApicSetIrq(PVM pVM, PCIBDF uBusDevFn, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc); 56 56 VMM_INT_DECL(VBOXSTRICTRC) PDMIoApicBroadcastEoi(PVM pVM, uint8_t uVector); 57 VMM_INT_DECL( int) PDMIoApicSendMsi(PVM pVM, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc);57 VMM_INT_DECL(void) PDMIoApicSendMsi(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc); 58 58 VMM_INT_DECL(int) PDMVmmDevHeapR3ToGCPhys(PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys); 59 59 VMM_INT_DECL(bool) PDMVmmDevHeapIsEnabled(PVM pVM); -
trunk/src/VBox/VMM/VMMAll/PDMAll.cpp
r89547 r89600 218 218 * Send a MSI to an I/O APIC. 219 219 * 220 * @returns VBox status code. 221 * @param pVM The cross context VM structure. 220 * @param pDevIns The PCI device instance. 222 221 * @param uBusDevFn The bus:device:function of the device initiating the MSI. 223 222 * Cannot be NIL_PCIBDF. … … 228 227 * instead. 229 228 */ 230 VMM_INT_DECL(int) PDMIoApicSendMsi(PVM pVM, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc) 231 { 232 /** @todo We should somehow move/make this to ring-3 only, as in ring-0, the helper 233 * code handles queuing the MSI to be sent from ring-3 when I/O APIC isn't 234 * available in R0. When this TODO is done, remove the remark in the doxygen 235 * above. */ 236 if (pVM->pdm.s.IoApic.CTX_SUFF(pDevIns)) 237 { 238 Assert(pVM->pdm.s.IoApic.CTX_SUFF(pfnSendMsi)); 239 pVM->pdm.s.IoApic.CTX_SUFF(pfnSendMsi)(pVM->pdm.s.IoApic.CTX_SUFF(pDevIns), uBusDevFn, pMsi, uTagSrc); 240 return VINF_SUCCESS; 241 } 242 return VERR_PDM_NO_PIC_INSTANCE; 229 VMM_INT_DECL(void) PDMIoApicSendMsi(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc) 230 { 231 #ifdef IN_RING0 232 PGVM pGVM = pDevIns->Internal.s.pGVM; 233 PCPDMIOAPIC pIoApic = &pGVM->pdm.s.IoApic; 234 if (pIoApic->pDevInsR0) 235 pIoApic->pfnSendMsiR0(pIoApic->pDevInsR0, uBusDevFn, pMsi, uTagSrc); 236 else if (pIoApic->pDevInsR3) 237 { 238 /* Queue for ring-3 execution. */ 239 PPDMDEVHLPTASK pTask = (PPDMDEVHLPTASK)PDMQueueAlloc(pGVM->pdm.s.pDevHlpQueueR0); 240 if (pTask) 241 { 242 pTask->enmOp = PDMDEVHLPTASKOP_IOAPIC_SEND_MSI; 243 pTask->pDevInsR3 = NIL_RTR3PTR; /* not required */ 244 pTask->u.IoApicSendMsi.uBusDevFn = uBusDevFn; 245 pTask->u.IoApicSendMsi.Msi = *pMsi; 246 pTask->u.IoApicSendMsi.uTagSrc = uTagSrc; 247 248 PDMQueueInsertEx(pGVM->pdm.s.pDevHlpQueueR0, &pTask->Core, 0); 249 } 250 else 251 AssertMsgFailed(("We're out of devhlp queue items!!!\n")); 252 } 253 #else 254 PVM pVM = pDevIns->Internal.s.pVMR3; 255 PCPDMIOAPIC pIoApic = &pVM->pdm.s.IoApic; 256 if (pIoApic->pDevInsR3) 257 { 258 Assert(pIoApic->pfnSendMsiR3); 259 pIoApic->pfnSendMsiR3(pIoApic->pDevInsR3, uBusDevFn, pMsi, uTagSrc); 260 } 261 #endif 243 262 } 244 263 -
trunk/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp
r89200 r89600 1626 1626 1627 1627 1628 /**1629 * Helper for sending an MSI via the I/O APIC.1630 *1631 * @param pDevIns PCI device instance.1632 * @param uBusDevFn The bus:device:function of the device initiating the MSI.1633 * @param pMsi The MSI to send.1634 * @param uTagSrc The IRQ tag and source (for tracing).1635 */1636 static void pdmR0IoApicSendMsi(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc)1637 {1638 PGVM pGVM = pDevIns->Internal.s.pGVM;1639 if (pGVM->pdm.s.IoApic.pDevInsR0)1640 pGVM->pdm.s.IoApic.pfnSendMsiR0(pGVM->pdm.s.IoApic.pDevInsR0, uBusDevFn, pMsi, uTagSrc);1641 else if (pGVM->pdm.s.IoApic.pDevInsR3)1642 {1643 /* queue for ring-3 execution. */1644 PPDMDEVHLPTASK pTask = (PPDMDEVHLPTASK)PDMQueueAlloc(pGVM->pdm.s.pDevHlpQueueR0);1645 if (pTask)1646 {1647 pTask->enmOp = PDMDEVHLPTASKOP_IOAPIC_SEND_MSI;1648 pTask->pDevInsR3 = NIL_RTR3PTR; /* not required */1649 pTask->u.IoApicSendMsi.uBusDevFn = uBusDevFn;1650 pTask->u.IoApicSendMsi.Msi = *pMsi;1651 pTask->u.IoApicSendMsi.uTagSrc = uTagSrc;1652 1653 PDMQueueInsertEx(pGVM->pdm.s.pDevHlpQueueR0, &pTask->Core, 0);1654 }1655 else1656 AssertMsgFailed(("We're out of devhlp queue items!!!\n"));1657 }1658 }1659 1660 1661 1628 /** @interface_method_impl{PDMPCIHLPR0,pfnIoApicSendMsi} */ 1662 1629 static DECLCALLBACK(void) pdmR0PciHlp_IoApicSendMsi(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc) … … 1666 1633 Log4(("pdmR0PciHlp_IoApicSendMsi: uBusDevFn=%#x Msi=(Addr:%#RX64 Data:%#RX32) uTagSrc=%#x\n", uBusDevFn, pMsi->Addr.u64, 1667 1634 pMsi->Data.u32, uTagSrc)); 1668 pdmR0IoApicSendMsi(pDevIns, uBusDevFn, pMsi, uTagSrc);1635 PDMIoApicSendMsi(pDevIns, uBusDevFn, pMsi, uTagSrc); 1669 1636 } 1670 1637 … … 1748 1715 { 1749 1716 PDMDEV_ASSERT_DEVINS(pDevIns); 1750 pdmR0IoApicSendMsi(pDevIns, NIL_PCIBDF, pMsi, uTagSrc);1717 PDMIoApicSendMsi(pDevIns, NIL_PCIBDF, pMsi, uTagSrc); 1751 1718 } 1752 1719 -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r88641 r89600 5394 5394 case PDMDEVHLPTASKOP_IOAPIC_SEND_MSI: 5395 5395 { 5396 PDMIoApicSendMsi(pVM, pTask->u.IoApicSendMsi.uBusDevFn, &pTask->u.IoApicSendMsi.Msi, pTask->u.IoApicSendMsi.uTagSrc); 5396 PDMIoApicSendMsi(pTask->pDevInsR3, pTask->u.IoApicSendMsi.uBusDevFn, &pTask->u.IoApicSendMsi.Msi, 5397 pTask->u.IoApicSendMsi.uTagSrc); 5397 5398 break; 5398 5399 } -
trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
r89200 r89600 215 215 Log4(("pdmR3PciHlp_IoApicSendMsi: uBusDevFn=%#x Msi (Addr=%#RX64 Data=%#x) uTagSrc=%#x\n", uBusDevFn, 216 216 pMsi->Addr.u64, pMsi->Data.u32, uTagSrc)); 217 PDMIoApicSendMsi(pDevIns ->Internal.s.pVMR3, uBusDevFn, pMsi, uTagSrc);217 PDMIoApicSendMsi(pDevIns, uBusDevFn, pMsi, uTagSrc); 218 218 } 219 219 … … 303 303 PDMDEV_ASSERT_DEVINS(pDevIns); 304 304 LogFlowFunc(("caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance)); 305 PDMIoApicSendMsi(pDevIns ->Internal.s.pVMR3, NIL_PCIBDF, pMsi, uTagSrc);305 PDMIoApicSendMsi(pDevIns, NIL_PCIBDF, pMsi, uTagSrc); 306 306 } 307 307 -
trunk/src/VBox/VMM/include/PDMInternal.h
r88641 r89600 819 819 DECLRCCALLBACKMEMBER(VBOXSTRICTRC, pfnSetEoiRC,(PPDMDEVINS pDevIns, uint8_t u8Vector)); 820 820 } PDMIOAPIC; 821 /** Pointer to a PDM IOAPIC instance. */ 822 typedef PDMIOAPIC *PPDMIOAPIC; 823 /** Pointer to a const PDM IOAPIC instance. */ 824 typedef PDMIOAPIC const *PCPDMIOAPIC; 821 825 822 826 /** Maximum number of PCI busses for a VM. */
Note:
See TracChangeset
for help on using the changeset viewer.