Changeset 85971 in vbox for trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
- Timestamp:
- Sep 1, 2020 4:56:26 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r85930 r85971 36 36 * Defined Constants And Macros * 37 37 *********************************************************************************************************************************/ 38 /** Log prefix string. */38 /** Release log prefix string. */ 39 39 #define IOMMU_LOG_PFX "IOMMU-AMD" 40 40 /** The current saved state version. */ … … 522 522 { 523 523 RT_NOREF(pDevIns, pThis, iReg, u64Value); 524 Log ((IOMMU_LOG_PFX ":Write to read-only register (%#x) with value %#RX64 ignored\n", iReg, u64Value));524 LogFunc(("Write to read-only register (%#x) with value %#RX64 ignored\n", iReg, u64Value)); 525 525 return VINF_SUCCESS; 526 526 } … … 558 558 if (Status.n.u1CmdBufRunning) 559 559 { 560 Log ((IOMMU_LOG_PFX ":Setting CmdBufBar (%#RX64) when command buffer is running -> Ignored\n", u64Value));560 LogFunc(("Setting CmdBufBar (%#RX64) when command buffer is running -> Ignored\n", u64Value)); 561 561 return VINF_SUCCESS; 562 562 } … … 580 580 } 581 581 else 582 Log ((IOMMU_LOG_PFX ":Command buffer length (%#x) invalid -> Ignored\n", CmdBufBaseAddr.n.u4Len));582 LogFunc(("Command buffer length (%#x) invalid -> Ignored\n", CmdBufBaseAddr.n.u4Len)); 583 583 584 584 return VINF_SUCCESS; … … 601 601 if (Status.n.u1EvtLogRunning) 602 602 { 603 Log ((IOMMU_LOG_PFX ":Setting EvtLogBar (%#RX64) when event logging is running -> Ignored\n", u64Value));603 LogFunc(("Setting EvtLogBar (%#RX64) when event logging is running -> Ignored\n", u64Value)); 604 604 return VINF_SUCCESS; 605 605 } … … 624 624 } 625 625 else 626 Log ((IOMMU_LOG_PFX ":Event log length (%#x) invalid -> Ignored\n", EvtLogBaseAddr.n.u4Len));626 LogFunc(("Event log length (%#x) invalid -> Ignored\n", EvtLogBaseAddr.n.u4Len)); 627 627 628 628 return VINF_SUCCESS; … … 713 713 /** @todo IOMMU: Why the heck is this marked read/write by the AMD IOMMU spec? */ 714 714 RT_NOREF(pDevIns, iReg); 715 Log ((IOMMU_LOG_PFX ":Writing %#RX64 to hardware event (Hi) register!\n", u64Value));715 LogFlowFunc(("Writing %#RX64 to hardware event (Hi) register!\n", u64Value)); 716 716 pThis->HwEvtHi.u64 = u64Value; 717 717 return VINF_SUCCESS; … … 726 726 /** @todo IOMMU: Why the heck is this marked read/write by the AMD IOMMU spec? */ 727 727 RT_NOREF(pDevIns, iReg); 728 Log ((IOMMU_LOG_PFX ":Writing %#RX64 to hardware event (Lo) register!\n", u64Value));728 LogFlowFunc(("Writing %#RX64 to hardware event (Lo) register!\n", u64Value)); 729 729 pThis->HwEvtLo = u64Value; 730 730 return VINF_SUCCESS; … … 787 787 } 788 788 else 789 Log ((IOMMU_LOG_PFX ":Device table segment (%u) size invalid (%#RX32) -> Ignored\n", idxSegment, uSegSize));789 LogFunc(("Device table segment (%u) size invalid (%#RX32) -> Ignored\n", idxSegment, uSegSize)); 790 790 791 791 return VINF_SUCCESS; … … 865 865 if (Status.n.u1CmdBufRunning) 866 866 { 867 Log ((IOMMU_LOG_PFX ":Setting CmdBufHeadPtr (%#RX64) when command buffer is running -> Ignored\n", u64Value));867 LogFunc(("Setting CmdBufHeadPtr (%#RX64) when command buffer is running -> Ignored\n", u64Value)); 868 868 return VINF_SUCCESS; 869 869 } … … 878 878 if (offBuf >= cbBuf) 879 879 { 880 Log((IOMMU_LOG_PFX ": Setting CmdBufHeadPtr (%#RX32) to a value that exceeds buffer length (%#RX23) -> Ignored\n", 881 offBuf, cbBuf)); 880 LogFunc(("Setting CmdBufHeadPtr (%#RX32) to a value that exceeds buffer length (%#RX23) -> Ignored\n", offBuf, cbBuf)); 882 881 return VINF_SUCCESS; 883 882 } … … 888 887 iommuAmdCmdThreadWakeUpIfNeeded(pDevIns); 889 888 890 LogFlow ((IOMMU_LOG_PFX ":Set CmdBufHeadPtr to %#RX32\n", offBuf));889 LogFlowFunc(("Set CmdBufHeadPtr to %#RX32\n", offBuf)); 891 890 return VINF_SUCCESS; 892 891 } … … 910 909 if (offBuf >= cbBuf) 911 910 { 912 Log((IOMMU_LOG_PFX ": Setting CmdBufTailPtr (%#RX32) to a value that exceeds buffer length (%#RX32) -> Ignored\n", 913 offBuf, cbBuf)); 911 LogFunc(("Setting CmdBufTailPtr (%#RX32) to a value that exceeds buffer length (%#RX32) -> Ignored\n", offBuf, cbBuf)); 914 912 return VINF_SUCCESS; 915 913 } … … 930 928 iommuAmdCmdThreadWakeUpIfNeeded(pDevIns); 931 929 932 LogFlow ((IOMMU_LOG_PFX ":Set CmdBufTailPtr to %#RX32\n", offBuf));930 LogFlowFunc(("Set CmdBufTailPtr to %#RX32\n", offBuf)); 933 931 return VINF_SUCCESS; 934 932 } … … 952 950 if (offBuf >= cbBuf) 953 951 { 954 Log((IOMMU_LOG_PFX ": Setting EvtLogHeadPtr (%#RX32) to a value that exceeds buffer length (%#RX32) -> Ignored\n", 955 offBuf, cbBuf)); 952 LogFunc(("Setting EvtLogHeadPtr (%#RX32) to a value that exceeds buffer length (%#RX32) -> Ignored\n", offBuf, cbBuf)); 956 953 return VINF_SUCCESS; 957 954 } … … 960 957 pThis->EvtLogHeadPtr.au32[0] = offBuf; 961 958 962 LogFlow ((IOMMU_LOG_PFX ":Set EvtLogHeadPtr to %#RX32\n", offBuf));959 LogFlowFunc(("Set EvtLogHeadPtr to %#RX32\n", offBuf)); 963 960 return VINF_SUCCESS; 964 961 } … … 981 978 if (Status.n.u1EvtLogRunning) 982 979 { 983 Log ((IOMMU_LOG_PFX ":Setting EvtLogTailPtr (%#RX64) when event log is running -> Ignored\n", u64Value));980 LogFunc(("Setting EvtLogTailPtr (%#RX64) when event log is running -> Ignored\n", u64Value)); 984 981 return VINF_SUCCESS; 985 982 } … … 994 991 if (offBuf >= cbBuf) 995 992 { 996 Log((IOMMU_LOG_PFX ": Setting EvtLogTailPtr (%#RX32) to a value that exceeds buffer length (%#RX32) -> Ignored\n", 997 offBuf, cbBuf)); 993 LogFunc(("Setting EvtLogTailPtr (%#RX32) to a value that exceeds buffer length (%#RX32) -> Ignored\n", offBuf, cbBuf)); 998 994 return VINF_SUCCESS; 999 995 } … … 1002 998 pThis->EvtLogTailPtr.au32[0] = offBuf; 1003 999 1004 LogFlow ((IOMMU_LOG_PFX ":Set EvtLogTailPtr to %#RX32\n", offBuf));1000 LogFlowFunc(("Set EvtLogTailPtr to %#RX32\n", offBuf)); 1005 1001 return VINF_SUCCESS; 1006 1002 } … … 1068 1064 Assert(cb == 4 || cb == 8); 1069 1065 Assert(!(off & (cb - 1))); 1066 1067 LogFlowFunc(("off=%#x cb=%u uValue=%#RX64\n", off, cb, uValue)); 1070 1068 1071 1069 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); … … 1173 1171 case IOMMU_MMIO_OFF_SMI_FLT_LAST: 1174 1172 { 1175 Log((IOMMU_LOG_PFX ": Writing unsupported register: SMI filter %u -> Ignored\n", 1176 (off - IOMMU_MMIO_OFF_SMI_FLT_FIRST) >> 3)); 1173 LogFunc(("Writing unsupported register: SMI filter %u -> Ignored\n", (off - IOMMU_MMIO_OFF_SMI_FLT_FIRST) >> 3)); 1177 1174 return VINF_SUCCESS; 1178 1175 } … … 1181 1178 default: 1182 1179 { 1183 Log ((IOMMU_LOG_PFX ":Writing unknown register %u (%#x) with %#RX64 -> Ignored\n", off, off, uValue));1180 LogFunc(("Writing unknown register %u (%#x) with %#RX64 -> Ignored\n", off, off, uValue)); 1184 1181 return VINF_SUCCESS; 1185 1182 } … … 1214 1211 PCPDMPCIDEV pPciDev = pDevIns->apPciDevs[0]; 1215 1212 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev); 1213 1214 LogFlowFunc(("off=%#x\n", off)); 1216 1215 1217 1216 /** @todo IOMMU: fine-grained locking? */ … … 1343 1342 case IOMMU_MMIO_OFF_SMI_FLT_LAST: 1344 1343 { 1345 Log ((IOMMU_LOG_PFX ":Reading unsupported register: SMI filter %u\n", (off - IOMMU_MMIO_OFF_SMI_FLT_FIRST) >> 3));1344 LogFunc(("Reading unsupported register: SMI filter %u\n", (off - IOMMU_MMIO_OFF_SMI_FLT_FIRST) >> 3)); 1346 1345 uReg = 0; 1347 1346 break; … … 1351 1350 default: 1352 1351 { 1353 Log ((IOMMU_LOG_PFX ":Reading unknown register %u (%#x) -> 0\n", off, off));1352 LogFunc(("Reading unknown register %u (%#x) -> 0\n", off, off)); 1354 1353 uReg = 0; 1355 1354 return VINF_IOM_MMIO_UNUSED_00; … … 1426 1425 int rc = PDMDevHlpPCIPhysWrite(pDevIns, GCPhysEvtLogEntry, pEvent, cbEvt); 1427 1426 if (RT_FAILURE(rc)) 1428 Log ((IOMMU_LOG_PFX ":Failed to write event log entry at %#RGp. rc=%Rrc\n", GCPhysEvtLogEntry, rc));1427 LogFunc(("Failed to write event log entry at %#RGp. rc=%Rrc\n", GCPhysEvtLogEntry, rc)); 1429 1428 1430 1429 /* Increment the event log tail pointer. */ … … 1530 1529 IOMMU_UNLOCK(pDevIns); 1531 1530 1532 Log ((IOMMU_LOG_PFX ":Raised PAGE_TAB_HARDWARE_ERROR. uDevId=%#x uDomainId=%#x GCPhysPtEntity=%#RGp enmOp=%u u2Type=%u\n",1531 LogFunc(("Raised PAGE_TAB_HARDWARE_ERROR. uDevId=%#x uDomainId=%#x GCPhysPtEntity=%#RGp enmOp=%u u2Type=%u\n", 1533 1532 pEvtPageTabHwErr->n.u16DevId, pEvtPageTabHwErr->n.u16DomainOrPasidLo, pEvtPageTabHwErr->n.u64Addr, enmOp, 1534 1533 pEvtPageTabHwErr->n.u2Type)); … … 1573 1572 IOMMU_UNLOCK(pDevIns); 1574 1573 1575 Log((IOMMU_LOG_PFX ": Raised COMMAND_HARDWARE_ERROR. GCPhysCmd=%#RGp u2Type=%u\n", pEvtCmdHwErr->n.u64Addr, 1576 pEvtCmdHwErr->n.u2Type)); 1574 LogFunc(("Raised COMMAND_HARDWARE_ERROR. GCPhysCmd=%#RGp u2Type=%u\n", pEvtCmdHwErr->n.u64Addr, pEvtCmdHwErr->n.u2Type)); 1577 1575 } 1578 1576 … … 1625 1623 IOMMU_UNLOCK(pDevIns); 1626 1624 1627 Log ((IOMMU_LOG_PFX ": Raised DEV_TAB_HARDWARE_ERROR. uDevId=%#x GCPhysDte=%#RGp enmOp=%u u2Type=%u\n",1628 pEvtDevTabHwErr->n.u16DevId,pEvtDevTabHwErr->n.u64Addr, enmOp, pEvtDevTabHwErr->n.u2Type));1625 LogFunc(("Raised DEV_TAB_HARDWARE_ERROR. uDevId=%#x GCPhysDte=%#RGp enmOp=%u u2Type=%u\n", pEvtDevTabHwErr->n.u16DevId, 1626 pEvtDevTabHwErr->n.u64Addr, enmOp, pEvtDevTabHwErr->n.u2Type)); 1629 1627 } 1630 1628 … … 1665 1663 IOMMU_UNLOCK(pDevIns); 1666 1664 1667 Log ((IOMMU_LOG_PFX ":Raised ILLEGAL_COMMAND_ERROR. Addr=%#RGp\n", pEvtIllegalCmd->n.u64Addr));1665 LogFunc(("Raised ILLEGAL_COMMAND_ERROR. Addr=%#RGp\n", pEvtIllegalCmd->n.u64Addr)); 1668 1666 } 1669 1667 … … 1721 1719 IOMMU_UNLOCK(pDevIns); 1722 1720 1723 Log ((IOMMU_LOG_PFX ":Raised ILLEGAL_DTE_EVENT. uDevId=%#x uIova=%#RX64 enmOp=%u enmEvtType=%u\n", pEvtIllegalDte->n.u16DevId,1724 pEvtIllegalDte->n.u64Addr, enmOp, enmEvtType));1721 LogFunc(("Raised ILLEGAL_DTE_EVENT. uDevId=%#x uIova=%#RX64 enmOp=%u enmEvtType=%u\n", pEvtIllegalDte->n.u16DevId, 1722 pEvtIllegalDte->n.u64Addr, enmOp, enmEvtType)); 1725 1723 NOREF(enmEvtType); 1726 1724 } … … 1953 1951 if (RT_FAILURE(rc)) 1954 1952 { 1955 Log ((IOMMU_LOG_PFX ":Failed to read device table entry at %#RGp. rc=%Rrc -> DevTabHwError\n", GCPhysDte, rc));1953 LogFunc(("Failed to read device table entry at %#RGp. rc=%Rrc -> DevTabHwError\n", GCPhysDte, rc)); 1956 1954 1957 1955 EVT_DEV_TAB_HW_ERROR_T EvtDevTabHwErr; … … 1999 1997 * the DTE) return the state computed so far and raises an I/O page fault. So 2000 1998 * returning an invalid translation rather than skipping translation. */ 2001 Log ((IOMMU_LOG_PFX ":Translation valid bit not set -> IOPF"));1999 LogFunc(("Translation valid bit not set -> IOPF")); 2002 2000 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2003 2001 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, false /* fPresent */, false /* fRsvdNotZero */, … … 2017 2015 if ((fAccess & fDtePerm) != fAccess) 2018 2016 { 2019 Log ((IOMMU_LOG_PFX ":Access denied for IOVA (%#RX64). fAccess=%#x fDtePerm=%#x\n", uIova, fAccess, fDtePerm));2017 LogFunc(("Access denied for IOVA (%#RX64). fAccess=%#x fDtePerm=%#x\n", uIova, fAccess, fDtePerm)); 2020 2018 return VERR_IOMMU_ADDR_ACCESS_DENIED; 2021 2019 } … … 2034 2032 * raising an ILLEGAL_DEV_TABLE_ENTRY event or an IO_PAGE_FAULT event here. 2035 2033 * I'm just going with I/O page fault. */ 2036 Log ((IOMMU_LOG_PFX ":Invalid root page table level %#x -> IOPF", uMaxLevel));2034 LogFunc(("Invalid root page table level %#x -> IOPF", uMaxLevel)); 2037 2035 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2038 2036 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 2049 2047 else 2050 2048 { 2051 Log ((IOMMU_LOG_PFX ":Permission denied (fAccess=%#x fRootPtePerm=%#x) -> IOPF", fAccess, fRootPtePerm));2049 LogFunc(("Permission denied (fAccess=%#x fRootPtePerm=%#x) -> IOPF", fAccess, fRootPtePerm)); 2052 2050 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2053 2051 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 2094 2092 if (RT_FAILURE(rc)) 2095 2093 { 2096 Log ((IOMMU_LOG_PFX ":Failed to read page table entry at %#RGp. rc=%Rrc -> PageTabHwError\n", GCPhysPtEntity, rc));2094 LogFunc(("Failed to read page table entry at %#RGp. rc=%Rrc -> PageTabHwError\n", GCPhysPtEntity, rc)); 2097 2095 EVT_PAGE_TAB_HW_ERR_T EvtPageTabHwErr; 2098 2096 iommuAmdInitPageTabHwErrorEvent(uDevId, pDte->n.u16DomainId, GCPhysPtEntity, enmOp, &EvtPageTabHwErr); … … 2107 2105 else 2108 2106 { 2109 Log ((IOMMU_LOG_PFX ":Page table entry not present -> IOPF"));2107 LogFunc(("Page table entry not present -> IOPF")); 2110 2108 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2111 2109 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, false /* fPresent */, false /* fRsvdNotZero */, … … 2121 2119 else 2122 2120 { 2123 Log ((IOMMU_LOG_PFX ":Page table entry permission denied (fAccess=%#x fPtePerm=%#x) -> IOPF", fAccess, fPtePerm));2121 LogFunc(("Page table entry permission denied (fAccess=%#x fPtePerm=%#x) -> IOPF", fAccess, fPtePerm)); 2124 2122 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2125 2123 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 2158 2156 } 2159 2157 2160 Log ((IOMMU_LOG_PFX ":Page size invalid cShift=%#x -> IOPF", cShift));2158 LogFunc(("Page size invalid cShift=%#x -> IOPF", cShift)); 2161 2159 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2162 2160 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 2173 2171 else 2174 2172 { 2175 Log ((IOMMU_LOG_PFX ":Next level of PDE invalid uNextLevel=%#x -> IOPF", uNextLevel));2173 LogFunc(("Next level of PDE invalid uNextLevel=%#x -> IOPF", uNextLevel)); 2176 2174 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2177 2175 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 2190 2188 else 2191 2189 { 2192 Log ((IOMMU_LOG_PFX ":Next level (%#x) must be less than the current level (%#x) -> IOPF", uNextLevel, uLevel));2190 LogFunc(("Next level (%#x) must be less than the current level (%#x) -> IOPF", uNextLevel, uLevel)); 2193 2191 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2194 2192 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 2208 2206 else 2209 2207 { 2210 Log ((IOMMU_LOG_PFX ":IOVA of skipped levels are not zero %#RX64 (SkipMask=%#RX64) -> IOPF", uIova, uIovaSkipMask));2208 LogFunc(("IOVA of skipped levels are not zero %#RX64 (SkipMask=%#RX64) -> IOPF", uIova, uIovaSkipMask)); 2211 2209 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2212 2210 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */, … … 2267 2265 else 2268 2266 { 2269 Log ((IOMMU_LOG_PFX ":Invalid reserved bits in DTE (u64[0]=%#RX64 u64[1]=%#RX64) -> Illegal DTE\n", fRsvd0, fRsvd1));2267 LogFunc(("Invalid reserved bits in DTE (u64[0]=%#RX64 u64[1]=%#RX64) -> Illegal DTE\n", fRsvd0, fRsvd1)); 2270 2268 EVT_ILLEGAL_DTE_T Event; 2271 2269 iommuAmdInitIllegalDteEvent(uDevId, uIova, true /* fRsvdNotZero */, enmOp, &Event); … … 2319 2317 else 2320 2318 { 2321 Log ((IOMMU_LOG_PFX ":I/O page table walk failed. uIova=%#RX64 uBaseIova=%#RX64 fAccess=%u rc=%Rrc\n", uIova,2319 LogFunc(("I/O page table walk failed. uIova=%#RX64 uBaseIova=%#RX64 fAccess=%u rc=%Rrc\n", uIova, 2322 2320 uBaseIova, fAccess, rc)); 2323 2321 *pGCPhysSpa = NIL_RTGCPHYS; … … 2329 2327 } 2330 2328 2331 Log ((IOMMU_LOG_PFX ":Failed to read device table entry. uDevId=%#x rc=%Rrc\n", uDevId, rc));2329 LogFunc(("Failed to read device table entry. uDevId=%#x rc=%Rrc\n", uDevId, rc)); 2332 2330 return VERR_IOMMU_ADDR_TRANSLATION_FAILED; 2333 2331 } … … 2455 2453 * There's no interrupt table hardware error event, but it's unclear what 2456 2454 * we should do here. */ 2457 Log ((IOMMU_LOG_PFX ":Failed to read interrupt table entry at %#RGp. rc=%Rrc -> ???\n", GCPhysIrte, rc));2455 LogFunc(("Failed to read interrupt table entry at %#RGp. rc=%Rrc -> ???\n", GCPhysIrte, rc)); 2458 2456 return VERR_IOMMU_IPE_4; 2459 2457 } … … 2501 2499 } 2502 2500 2503 Log ((IOMMU_LOG_PFX ":Interrupt type (%#x) invalid -> IOPF", Irte.n.u3IntrType));2501 LogFunc(("Interrupt type (%#x) invalid -> IOPF", Irte.n.u3IntrType)); 2504 2502 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2505 2503 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, pMsiIn->Addr.u64, Irte.n.u1RemapEnable, … … 2509 2507 } 2510 2508 2511 Log ((IOMMU_LOG_PFX ":Guest mode not supported -> IOPF"));2509 LogFunc(("Guest mode not supported -> IOPF")); 2512 2510 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2513 2511 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, pMsiIn->Addr.u64, Irte.n.u1RemapEnable, … … 2517 2515 } 2518 2516 2519 Log ((IOMMU_LOG_PFX ":Remapping disabled -> IOPF"));2517 LogFunc(("Remapping disabled -> IOPF")); 2520 2518 EVT_IO_PAGE_FAULT_T EvtIoPageFault; 2521 2519 iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, pMsiIn->Addr.u64, Irte.n.u1RemapEnable, … … 2559 2557 else 2560 2558 { 2561 Log ((IOMMU_LOG_PFX ":Invalid reserved bits in DTE (u64[2]=%#RX64 u64[3]=%#RX64) -> Illegal DTE\n", fRsvd0,2559 LogFunc(("Invalid reserved bits in DTE (u64[2]=%#RX64 u64[3]=%#RX64) -> Illegal DTE\n", fRsvd0, 2562 2560 fRsvd1)); 2563 2561 EVT_ILLEGAL_DTE_T Event; … … 2600 2598 if (uIntrCtrl == IOMMU_INTR_CTRL_TARGET_ABORT) 2601 2599 { 2602 Log ((IOMMU_LOG_PFX ":IntCtl=0: Target aborting fixed/arbitrated interrupt -> Target abort\n"));2600 LogFunc(("IntCtl=0: Target aborting fixed/arbitrated interrupt -> Target abort\n")); 2603 2601 iommuAmdSetPciTargetAbort(pDevIns); 2604 2602 return VERR_IOMMU_INTR_REMAP_DENIED; … … 2631 2629 } 2632 2630 2633 Log ((IOMMU_LOG_PFX ":Invalid interrupt table length %#x -> Illegal DTE\n", uIntTabLen));2631 LogFunc(("Invalid interrupt table length %#x -> Illegal DTE\n", uIntTabLen)); 2634 2632 EVT_ILLEGAL_DTE_T Event; 2635 2633 iommuAmdInitIllegalDteEvent(uDevId, pMsiIn->Addr.u64, false /* fRsvdNotZero */, enmOp, &Event); … … 2641 2639 Assert(uIntrCtrl == IOMMU_INTR_CTRL_RSVD); 2642 2640 2643 Log((IOMMU_LOG_PFX ":IntCtl mode invalid %#x -> Illegal DTE", uIntrCtrl)); 2641 LogFunc(("IntCtl mode invalid %#x -> Illegal DTE", uIntrCtrl)); 2642 2644 2643 EVT_ILLEGAL_DTE_T Event; 2645 2644 iommuAmdInitIllegalDteEvent(uDevId, pMsiIn->Addr.u64, true /* fRsvdNotZero */, enmOp, &Event); … … 2655 2654 default: 2656 2655 { 2657 Log ((IOMMU_LOG_PFX ":MSI data delivery mode invalid %#x -> Target abort", u8DeliveryMode));2656 LogFunc(("MSI data delivery mode invalid %#x -> Target abort", u8DeliveryMode)); 2658 2657 iommuAmdSetPciTargetAbort(pDevIns); 2659 2658 return VERR_IOMMU_INTR_REMAP_FAILED; … … 2672 2671 else 2673 2672 { 2674 Log ((IOMMU_LOG_PFX ":MSI address region invalid %#RX64.", pMsiIn->Addr.u64));2673 LogFunc(("MSI address region invalid %#RX64.", pMsiIn->Addr.u64)); 2675 2674 return VERR_IOMMU_INTR_REMAP_FAILED; 2676 2675 } … … 2684 2683 } 2685 2684 2686 Log ((IOMMU_LOG_PFX ":Failed to read device table entry. uDevId=%#x rc=%Rrc\n", uDevId, rc));2685 LogFunc(("Failed to read device table entry. uDevId=%#x rc=%Rrc\n", uDevId, rc)); 2687 2686 return VERR_IOMMU_INTR_REMAP_FAILED; 2688 2687 } … … 2731 2730 Assert(!(off & (cb - 1))); 2732 2731 2733 LogFlowFunc(("off=%RGp cb=%u\n", off, cb));2734 2735 2732 uint64_t const uValue = cb == 8 ? *(uint64_t const *)pv : *(uint32_t const *)pv; 2736 2733 return iommuAmdWriteRegister(pDevIns, off, cb, uValue); … … 2746 2743 Assert(cb == 4 || cb == 8); 2747 2744 Assert(!(off & (cb - 1))); 2748 2749 LogFlowFunc(("off=%RGp cb=%u\n", off, cb));2750 2745 2751 2746 uint64_t uResult; … … 2796 2791 if (RT_FAILURE(rc)) 2797 2792 { 2798 Log ((IOMMU_LOG_PFX ":Cmd(%#x): Failed to write StoreData (%#RX64) to %#RGp, rc=%Rrc\n", bCmd, u64Data,2793 LogFunc(("Cmd(%#x): Failed to write StoreData (%#RX64) to %#RGp, rc=%Rrc\n", bCmd, u64Data, 2799 2794 GCPhysStore, rc)); 2800 2795 iommuAmdInitCmdHwErrorEvent(GCPhysStore, (PEVT_CMD_HW_ERR_T)pEvtError); … … 2887 2882 } 2888 2883 2889 Log ((IOMMU_LOG_PFX ":Cmd(%#x): Unrecognized\n", bCmd));2884 LogFunc(("Cmd(%#x): Unrecognized\n", bCmd)); 2890 2885 iommuAmdInitIllegalCmdEvent(GCPhysCmd, (PEVT_ILLEGAL_CMD_ERR_T)pEvtError); 2891 2886 return VERR_IOMMU_CMD_NOT_SUPPORTED; … … 2992 2987 } 2993 2988 2994 LogFlow ((IOMMU_LOG_PFX ":Command thread terminating\n"));2989 LogFlowFunc(("Command thread terminating\n")); 2995 2990 return VINF_SUCCESS; 2996 2991 } … … 3019 3014 unsigned cb, uint32_t *pu32Value) 3020 3015 { 3021 LogFlowFunc(("\n"));3022 3016 /** @todo IOMMU: PCI config read stat counter. */ 3023 3017 VBOXSTRICTRC rcStrict = PDMDevHlpPCIConfigRead(pDevIns, pPciDev, uAddress, cb, pu32Value); 3024 Log3 ((IOMMU_LOG_PFX ":Reading PCI config register %#x (cb=%u) -> %#x %Rrc\n", uAddress, cb, *pu32Value,3025 VBOXSTRICTRC_VAL(rcStrict)));3018 Log3Func(("Reading PCI config register %#x (cb=%u) -> %#x %Rrc\n", uAddress, cb, *pu32Value, 3019 VBOXSTRICTRC_VAL(rcStrict))); 3026 3020 return rcStrict; 3027 3021 } … … 3035 3029 { 3036 3030 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); 3037 LogFlowFunc(("\n"));3038 3031 3039 3032 /* … … 3049 3042 case IOMMU_PCI_OFF_MISCINFO_REG_1: /* We don't support guest-address translation. */ 3050 3043 { 3051 Log ((IOMMU_LOG_PFX ":PCI config write (%#RX32) to read-only register %#x -> Ignored\n", u32Value, uAddress));3044 LogFunc(("PCI config write (%#RX32) to read-only register %#x -> Ignored\n", u32Value, uAddress)); 3052 3045 return VINF_SUCCESS; 3053 3046 } … … 3064 3057 { 3065 3058 rcStrict = VINF_SUCCESS; 3066 Log ((IOMMU_LOG_PFX ":Writing Base Address (Lo) when it's already enabled -> Ignored\n"));3059 LogFunc(("Writing Base Address (Lo) when it's already enabled -> Ignored\n")); 3067 3060 break; 3068 3061 } … … 3077 3070 rcStrict = PDMDevHlpMmioMap(pDevIns, pThis->hMmio, GCPhysMmioBase); 3078 3071 if (RT_FAILURE(rcStrict)) 3079 Log ((IOMMU_LOG_PFX ":Failed to map IOMMU MMIO region at %#RGp. rc=%Rrc\n", GCPhysMmioBase, rcStrict));3072 LogFunc(("Failed to map IOMMU MMIO region at %#RGp. rc=%Rrc\n", GCPhysMmioBase, rcStrict)); 3080 3073 } 3081 3074 break; … … 3089 3082 { 3090 3083 rcStrict = VINF_SUCCESS; 3091 Log ((IOMMU_LOG_PFX ":Writing Base Address (Hi) when it's already enabled -> Ignored\n"));3084 LogFunc(("Writing Base Address (Hi) when it's already enabled -> Ignored\n")); 3092 3085 } 3093 3086 break; … … 3108 3101 IOMMU_UNLOCK(pDevIns); 3109 3102 3110 Log3 ((IOMMU_LOG_PFX ":PCI config write: %#x -> To %#x (%u) %Rrc\n", u32Value, uAddress, cb, VBOXSTRICTRC_VAL(rcStrict)));3103 Log3Func(("PCI config write: %#x -> To %#x (%u) %Rrc\n", u32Value, uAddress, cb, VBOXSTRICTRC_VAL(rcStrict))); 3111 3104 return rcStrict; 3112 3105 } … … 3122 3115 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev); 3123 3116 3124 LogFlow ((IOMMU_LOG_PFX ": iommuAmdR3DbgInfo:pThis=%p pszArgs=%s\n", pThis, pszArgs));3117 LogFlowFunc(("pThis=%p pszArgs=%s\n", pThis, pszArgs)); 3125 3118 bool const fVerbose = !strncmp(pszArgs, RT_STR_TUPLE("verbose")) ? true : false; 3126 3119 … … 3717 3710 3718 3711 pThis->Ctrl.u64 = 0; 3712 pThis->Ctrl.n.u1Coherent = 1; 3713 Assert(!pThis->ExtFeat.n.u1BlockStopMarkSup); 3719 3714 3720 3715 pThis->ExclRangeBaseAddr.u64 = 0;
Note:
See TracChangeset
for help on using the changeset viewer.