Changeset 84826 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 15, 2020 8:20:40 AM (5 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r84808 r84826 4223 4223 if (uNextLevel == 7) 4224 4224 { 4225 /* The default page size of the translation is overrid en. */4225 /* The default page size of the translation is overridden. */ 4226 4226 RTGCPHYS const GCPhysPte = PtEntity.u64 & IOMMU_PTENTITY_ADDR_MASK; 4227 4227 uint8_t cShift = X86_PAGE_4K_SHIFT; -
trunk/src/VBox/Devices/Bus/DevPCI.cpp
r82968 r84826 246 246 /* This is only allowed to be called with a pointer to the host bus. */ 247 247 AssertMsg(pBus->iBus == 0, ("iBus=%u\n", pBus->iBus)); 248 uint16_t const uBusDevFn = PCIBDF_MAKE(pBus->iBus, uDevFn); 248 249 249 250 if (iAcpiIrq == -1) { … … 261 262 Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d\n", 262 263 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num)); 263 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, apic_irq, apic_level, uTagSrc);264 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, uBusDevFn, apic_irq, apic_level, uTagSrc); 264 265 265 266 if ((iLevel & PDM_IRQ_LEVEL_FLIP_FLOP) == PDM_IRQ_LEVEL_FLIP_FLOP) { … … 269 270 Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d (flop)\n", 270 271 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num)); 271 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, apic_irq, apic_level, uTagSrc);272 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, uBusDevFn, apic_irq, apic_level, uTagSrc); 272 273 } 273 274 } else { 274 Log3Func(("%s: irq_num1=%d level=%d iAcpiIrq=%d\n", 275 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, iAcpiIrq)); 276 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, iAcpiIrq, iLevel, uTagSrc); 275 Log3Func(("%s: irq_num1=%d level=%d iAcpiIrq=%d\n", R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, iAcpiIrq)); 276 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, uBusDevFn, iAcpiIrq, iLevel, uTagSrc); 277 277 } 278 278 } -
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r82968 r84826 547 547 /* This is only allowed to be called with a pointer to the root bus. */ 548 548 AssertMsg(pBus->iBus == 0, ("iBus=%u\n", pBus->iBus)); 549 uint16_t const uBusDevFn = PCIBDF_MAKE(pBus->iBus, uDevFn); 549 550 550 551 if (iForcedIrq == -1) … … 563 564 Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x\n", 564 565 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc)); 565 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, apic_irq, apic_level, uTagSrc);566 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, uBusDevFn, apic_irq, apic_level, uTagSrc); 566 567 567 568 if ((iLevel & PDM_IRQ_LEVEL_FLIP_FLOP) == PDM_IRQ_LEVEL_FLIP_FLOP) … … 576 577 Log3Func(("%s: irq_num1=%d level=%d apic_irq=%d apic_level=%d irq_num1=%d uTagSrc=%#x (flop)\n", 577 578 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc)); 578 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, apic_irq, apic_level, uTagSrc);579 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, uBusDevFn, apic_irq, apic_level, uTagSrc); 579 580 } 580 581 } else { 581 582 Log3Func(("(forced) %s: irq_num1=%d level=%d acpi_irq=%d uTagSrc=%#x\n", 582 583 R3STRING(pPciDev->pszNameR3), irq_num1, iLevel, iForcedIrq, uTagSrc)); 583 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, iForcedIrq, iLevel, uTagSrc);584 pBusCC->CTX_SUFF(pPciHlp)->pfnIoApicSetIrq(pDevIns, uBusDevFn, iForcedIrq, iLevel, uTagSrc); 584 585 } 585 586 } -
trunk/src/VBox/Devices/Bus/MsiCommon.cpp
r82968 r84826 27 27 #include "MsiCommon.h" 28 28 #include "PciInline.h" 29 #include "DevPciInternal.h" 29 30 30 31 … … 330 331 } 331 332 332 RTGCPHYS GCAddr = msiGetMsiAddress(pDev); 333 uint32_t u32Value = msiGetMsiData(pDev, iVector); 333 MSIMSG Msi; 334 Msi.Addr.u64 = msiGetMsiAddress(pDev); 335 Msi.Data.u32 = msiGetMsiData(pDev, iVector); 334 336 335 337 if (puPending) 336 338 *puPending &= ~(1<<iVector); 337 339 340 PPDMDEVINS pDevInsBus = pPciHlp->pfnGetBusByNo(pDevIns, pDev->Int.s.idxPdmBus); 341 Assert(pDevInsBus); 342 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevInsBus, PDEVPCIBUS); 343 uint16_t const uBusDevFn = PCIBDF_MAKE(pBus->iBus, pDev->uDevFn); 344 338 345 Assert(pPciHlp->pfnIoApicSendMsi != NULL); 339 pPciHlp->pfnIoApicSendMsi(pDevIns, GCAddr, u32Value, uTagSrc);340 } 341 346 pPciHlp->pfnIoApicSendMsi(pDevIns, uBusDevFn, &Msi, uTagSrc); 347 } 348 -
trunk/src/VBox/Devices/Bus/MsixCommon.cpp
r82968 r84826 29 29 30 30 #include "MsiCommon.h" 31 #include "DevPCIInternal.h" 31 32 #include "PciInline.h" 32 33 … … 268 269 msixClearPending(pDev, iVector); 269 270 270 RTGCPHYS GCAddr = msixGetMsiAddress(pDev, iVector); 271 uint32_t u32Value = msixGetMsiData(pDev, iVector); 272 273 pPciHlp->pfnIoApicSendMsi(pDevIns, GCAddr, u32Value, uTagSrc); 271 MSIMSG Msi; 272 Msi.Addr.u64 = msixGetMsiAddress(pDev, iVector); 273 Msi.Data.u32 = msixGetMsiData(pDev, iVector); 274 275 PPDMDEVINS pDevInsBus = pPciHlp->pfnGetBusByNo(pDevIns, pDev->Int.s.idxPdmBus); 276 Assert(pDevInsBus); 277 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevInsBus, PDEVPCIBUS); 278 uint16_t const uBusDevFn = PCIBDF_MAKE(pBus->iBus, pDev->uDevFn); 279 280 pPciHlp->pfnIoApicSendMsi(pDevIns, uBusDevFn, &Msi, uTagSrc); 274 281 } 275 282 -
trunk/src/VBox/Devices/PC/DevIoApic.cpp
r84677 r84826 166 166 #define IOAPIC_DIRECT_OFF_EOI 0x40 /* Newer I/O APIC only. */ 167 167 168 /** The I/O APIC's Bus:Device:Function. */ 169 #define IOAPIC_BUS_DEV_FN NIL_PCIBDF 170 168 171 /* Use PDM critsect for now for I/O APIC locking, see @bugref{8245#c121}. */ 169 172 #define IOAPIC_WITH_PDM_CRITSECT … … 472 475 * @param pThis The shared I/O APIC device state. 473 476 * @param pThisCC The I/O APIC device state for the current context. 477 * @param uBusDevFn The bus:device:function of the device initiating the IRQ. 474 478 * @param idxRte The index of the RTE (validated). 475 479 * … … 478 482 * function. 479 483 */ 480 static void ioapicSignalIntrForRte(PPDMDEVINS pDevIns, PIOAPIC pThis, PIOAPICCC pThisCC, uint8_t idxRte)484 static void ioapicSignalIntrForRte(PPDMDEVINS pDevIns, PIOAPIC pThis, PIOAPICCC pThisCC, PCIBDF uBusDevFn, uint8_t idxRte) 481 485 { 482 486 #ifndef IOAPIC_WITH_PDM_CRITSECT … … 499 503 } 500 504 } 505 506 /** @todo IOMMU: Call into the IOMMU on how to remap this interrupt. uBusDevFn 507 * will be needed then. */ 508 NOREF(uBusDevFn); 501 509 502 510 uint8_t const u8Vector = IOAPIC_RTE_GET_VECTOR(u64Rte); … … 622 630 uint32_t const uPinMask = UINT32_C(1) << idxRte; 623 631 if (pThis->uIrr & uPinMask) 624 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, idxRte);632 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, IOAPIC_BUS_DEV_FN, idxRte); 625 633 626 634 IOAPIC_UNLOCK(pDevIns, pThis, pThisCC); … … 737 745 uint32_t const uPinMask = UINT32_C(1) << idxRte; 738 746 if (pThis->uIrr & uPinMask) 739 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, idxRte);747 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, IOAPIC_BUS_DEV_FN, idxRte); 740 748 } 741 749 } … … 754 762 * @interface_method_impl{PDMIOAPICREG,pfnSetIrq} 755 763 */ 756 static DECLCALLBACK(void) ioapicSetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel, uint32_t uTagSrc)757 { 758 #define IOAPIC_ASSERT_IRQ(a_ idxRte, a_PinMask) do { \764 static DECLCALLBACK(void) ioapicSetIrq(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, int iIrq, int iLevel, uint32_t uTagSrc) 765 { 766 #define IOAPIC_ASSERT_IRQ(a_uBusDevFn, a_idxRte, a_PinMask) do { \ 759 767 pThis->au32TagSrc[(a_idxRte)] = !pThis->au32TagSrc[(a_idxRte)] ? uTagSrc : RT_BIT_32(31); \ 760 768 pThis->uIrr |= a_PinMask; \ 761 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, (a_ idxRte)); \769 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, (a_uBusDevFn), (a_idxRte)); \ 762 770 } while (0) 763 771 … … 803 811 */ 804 812 if (!uPrevIrr) 805 IOAPIC_ASSERT_IRQ( idxRte, uPinMask);813 IOAPIC_ASSERT_IRQ(uBusDevFn, idxRte, uPinMask); 806 814 else 807 815 { … … 827 835 } 828 836 829 IOAPIC_ASSERT_IRQ( idxRte, uPinMask);837 IOAPIC_ASSERT_IRQ(uBusDevFn, idxRte, uPinMask); 830 838 } 831 839 } … … 838 846 * hence just the assert is done. 839 847 */ 840 IOAPIC_ASSERT_IRQ( idxRte, uPinMask);848 IOAPIC_ASSERT_IRQ(uBusDevFn, idxRte, uPinMask); 841 849 } 842 850 … … 850 858 * @interface_method_impl{PDMIOAPICREG,pfnSendMsi} 851 859 */ 852 static DECLCALLBACK(void) ioapicSendMsi(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t uValue, uint32_t uTagSrc)860 static DECLCALLBACK(void) ioapicSendMsi(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc) 853 861 { 854 862 PIOAPICCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PIOAPICCC); 855 LogFlow(("IOAPIC: ioapicSendMsi: GCPhys=%#RGp uValue=%#RX32\n", GCPhys, uValue)); 856 857 MSIMSG Msi; 858 Msi.Addr.u64 = GCPhys; 859 Msi.Data.u32 = uValue; 863 LogFlow(("IOAPIC: ioapicSendMsi: uBusDevFn=%#x Addr=%#RX64 Data=%#RX32\n", uBusDevFn, pMsi->Addr.u64, pMsi->Data.u32)); 860 864 861 865 XAPICINTR ApicIntr; 862 866 RT_ZERO(ApicIntr); 863 ioapicGetApicIntrFromMsi(&Msi, &ApicIntr); 867 ioapicGetApicIntrFromMsi(pMsi, &ApicIntr); 868 869 /** @todo IOMMU: Call into the IOMMU to remap the MSI. uBusDevFn will be used 870 * then. */ 871 NOREF(uBusDevFn); 864 872 865 873 /*
Note:
See TracChangeset
for help on using the changeset viewer.