Changeset 86927 in vbox for trunk/src/VBox/Devices/PC/DevIoApic.cpp
- Timestamp:
- Nov 20, 2020 8:47:25 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141410
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevIoApic.cpp
r86901 r86927 485 485 * @param pThis The shared I/O APIC device state. 486 486 * @param pThisCC The I/O APIC device state for the current context. 487 * @param uBusDevFn The bus:device:function of the device initiating the IRQ.488 487 * @param idxRte The index of the RTE (validated). 489 488 * … … 492 491 * function. 493 492 */ 494 static void ioapicSignalIntrForRte(PPDMDEVINS pDevIns, PIOAPIC pThis, PIOAPICCC pThisCC, PCIBDF uBusDevFn,uint8_t idxRte)493 static void ioapicSignalIntrForRte(PPDMDEVINS pDevIns, PIOAPIC pThis, PIOAPICCC pThisCC, uint8_t idxRte) 495 494 { 496 495 #ifndef IOAPIC_WITH_PDM_CRITSECT … … 529 528 /* 530 529 * The interrupt may need to be remapped (or discarded) if an IOMMU is present. 530 * For line-based interrupts we must use the southbridge I/O APIC's BDF as 531 * the origin of the interrupt, see @bugref{9654#c74}. 531 532 */ 532 533 MSIMSG MsiOut; … … 535 536 RT_ZERO(MsiIn); 536 537 ioapicGetMsiFromApicIntr(&ApicIntr, &MsiIn); 537 if (!PCIBDF_IS_VALID(uBusDevFn)) 538 uBusDevFn = VBOX_PCI_BDF_SB_IOAPIC; 539 int rcRemap = pThisCC->pIoApicHlp->pfnIommuMsiRemap(pDevIns, uBusDevFn, &MsiIn, &MsiOut); 540 LogFlow(("IOAPIC: IOMMU Remap. rc=%Rrc VectorIn=%#x VectorOut=%#x\n", rcRemap, MsiIn.Data.n.u8Vector, MsiOut.Data.n.u8Vector)); 538 int rcRemap = pThisCC->pIoApicHlp->pfnIommuMsiRemap(pDevIns, VBOX_PCI_BDF_SB_IOAPIC, &MsiIn, &MsiOut); 541 539 if (RT_SUCCESS(rcRemap)) 542 540 { 543 541 STAM_COUNTER_INC(&pThis->StatIommuRemappedIntr); 542 LogFlow(("IOAPIC: IOMMU remapped interrupt %#x to %#x\n", rcRemap, MsiIn.Data.n.u8Vector, MsiOut.Data.n.u8Vector)); 544 543 ioapicGetApicIntrFromMsi(&MsiOut, &ApicIntr); 545 544 Assert(ApicIntr.u8Polarity == IOAPIC_RTE_GET_POLARITY(u64Rte)); /* Ensure polarity hasn't changed. */ … … 549 548 { 550 549 STAM_COUNTER_INC(&pThis->StatIommuDiscardedIntr); 551 Log(("IOAPIC: I nterrupt (%#x) discarded (rc=%Rrc)\n", ApicIntr.u8Vector, rcRemap));550 Log(("IOAPIC: IOMMU discarded interrupt %#x. rc=%Rrc\n", ApicIntr.u8Vector, rcRemap)); 552 551 return; 553 552 } 554 #else555 NOREF(uBusDevFn);556 553 #endif 557 554 … … 677 674 { 678 675 LogFlow(("IOAPIC: ioapicSetRedirTableEntry: Signalling pending interrupt. idxRte=%u\n", idxRte)); 679 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, VBOX_PCI_BDF_SB_IOAPIC,idxRte);676 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, idxRte); 680 677 } 681 678 … … 792 789 uint32_t const uPinMask = UINT32_C(1) << idxRte; 793 790 if (pThis->uIrr & uPinMask) 794 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, VBOX_PCI_BDF_SB_IOAPIC,idxRte);791 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, idxRte); 795 792 } 796 793 } 797 794 798 795 IOAPIC_UNLOCK(pDevIns, pThis, pThisCC); 796 #ifndef VBOX_WITH_IOMMU_AMD 799 797 AssertMsg(fRemoteIrrCleared, ("Failed to clear remote IRR for vector %#x (%u)\n", u8Vector, u8Vector)); 798 #endif 800 799 } 801 800 else … … 811 810 static DECLCALLBACK(void) ioapicSetIrq(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, int iIrq, int iLevel, uint32_t uTagSrc) 812 811 { 812 RT_NOREF(uBusDevFn); /** @todo r=ramshankar: Remove this argument if it's also unnecessary with Intel IOMMU. */ 813 813 #define IOAPIC_ASSERT_IRQ(a_uBusDevFn, a_idxRte, a_PinMask) do { \ 814 814 pThis->au32TagSrc[(a_idxRte)] = !pThis->au32TagSrc[(a_idxRte)] ? uTagSrc : RT_BIT_32(31); \ 815 815 pThis->uIrr |= a_PinMask; \ 816 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, (a_ uBusDevFn), (a_idxRte)); \816 ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, (a_idxRte)); \ 817 817 } while (0) 818 818 … … 930 930 { 931 931 STAM_COUNTER_INC(&pThis->StatIommuDiscardedMsi); 932 if (rcRemap == VERR_IOMMU_INTR_REMAP_DENIED) 933 Log3(("IOAPIC: MSI (Addr=%#RX64 Data=%#RX32) remapping denied. rc=%Rrc", pMsi->Addr.u64, pMsi->Data.u32, rcRemap)); 934 else 935 Log(("IOAPIC: MSI (Addr=%#RX64 Data=%#RX32) remapping failed. rc=%Rrc", pMsi->Addr.u64, pMsi->Data.u32, rcRemap)); 932 Log(("IOAPIC: MSI (Addr=%#RX64 Data=%#RX32) remapping failed. rc=%Rrc", pMsi->Addr.u64, pMsi->Data.u32, rcRemap)); 936 933 return; 937 934 } … … 1378 1375 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "NumCPUs|ChipType", ""); 1379 1376 1380 /* The number of CPUs is currently unused, but left in CFGM and saved-state in case an ID of 0 is1381 upsets some guest which we haven't yet tested. */1377 /* The number of CPUs is currently unused, but left in CFGM and saved-state in case an ID of 0 1378 upsets some guest which we haven't yet been tested. */ 1382 1379 uint32_t cCpus; 1383 1380 int rc = pHlp->pfnCFGMQueryU32Def(pCfg, "NumCPUs", &cCpus, 1);
Note:
See TracChangeset
for help on using the changeset viewer.