Changeset 86982 in vbox for trunk/src/VBox/Devices/Bus
- Timestamp:
- Nov 26, 2020 11:29:29 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141528
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r86962 r86982 43 43 /** The IOTLB entry magic. */ 44 44 #define IOMMU_IOTLBE_MAGIC 0x10acce55 45 46 #ifndef DEBUG_ramshankar47 /** Temporary, make permanent later (get rid of define entirely and remove old48 * code). This allow ssub-qword accesses to qword registers. Write accesses49 * seems to work (needs testing one sub-path of the code), Read accesses not yet50 * converted. */51 # define IOMMU_NEW_REGISTER_ACCESS52 #endif53 45 54 46 … … 326 318 STAMCOUNTER StatMemBulkWriteRZ; /**< Number of memory write bulk translation requests in RZ. */ 327 319 328 STAMCOUNTER StatCmd; /**< Number of commands processed . */320 STAMCOUNTER StatCmd; /**< Number of commands processed in total. */ 329 321 STAMCOUNTER StatCmdCompWait; /**< Number of Completion Wait commands processed. */ 330 322 STAMCOUNTER StatCmdInvDte; /**< Number of Invalidate DTE commands processed. */ … … 347 339 AssertCompileMemberAlignment(IOMMU, hMmio, 8); 348 340 AssertCompileMemberAlignment(IOMMU, IommuBar, 8); 341 AssertCompileMemberAlignment(IOMMU, aDevTabBaseAddrs, 8); 342 AssertCompileMemberAlignment(IOMMU, CmdBufHeadPtr, 8); 343 AssertCompileMemberAlignment(IOMMU, Status, 8); 349 344 350 345 /** … … 555 550 { 556 551 IOMMU_ASSERT_LOCKED(pDevIns); 557 Log 5Func(("\n"));552 Log4Func(("\n")); 558 553 559 554 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); … … 561 556 if (Status.n.u1CmdBufRunning) 562 557 { 563 Log 5Func(("Signaling command thread\n"));558 Log4Func(("Signaling command thread\n")); 564 559 PDMDevHlpSUPSemEventSignal(pDevIns, pThis->hEvtCmdThread); 565 560 } … … 783 778 784 779 785 #ifdef IOMMU_NEW_REGISTER_ACCESS786 780 /** 787 781 * Reads the MSI Capability Header Register (32-bit) and the MSI Address (Lo) … … 813 807 return VINF_SUCCESS; 814 808 } 815 #endif816 809 817 810 … … 869 862 return VINF_SUCCESS; 870 863 } 871 872 #ifndef IOMMU_NEW_REGISTER_ACCESS873 static VBOXSTRICTRC iommuAmdIgnore_w(PPDMDEVINS pDevIns, PIOMMU pThis, uint32_t offReg, uint64_t u64Value)874 {875 RT_NOREF(pDevIns, pThis, offReg, u64Value);876 return VINF_SUCCESS;877 }878 #endif879 864 880 865 … … 1167 1152 1168 1153 1169 #ifndef IOMMU_NEW_REGISTER_ACCESS1170 /**1171 * Writes the MSI Capability Header Register.1172 */1173 static VBOXSTRICTRC iommuAmdMsiCapHdr_w(PPDMDEVINS pDevIns, PIOMMU pThis, uint32_t offReg, uint64_t u64Value)1174 {1175 RT_NOREF(pThis, offReg);1176 PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];1177 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev);1178 MSI_CAP_HDR_T MsiCapHdr;1179 MsiCapHdr.u32 = PDMPciDevGetDWord(pPciDev, IOMMU_PCI_OFF_MSI_CAP_HDR);1180 MsiCapHdr.n.u1MsiEnable = RT_BOOL(u64Value & IOMMU_MSI_CAP_HDR_MSI_EN_MASK);1181 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_CAP_HDR, MsiCapHdr.u32);1182 return VINF_SUCCESS;1183 }1184 1185 1186 /**1187 * Writes the MSI Address (Lo) Register (32-bit).1188 */1189 static VBOXSTRICTRC iommuAmdMsiAddrLo_w(PPDMDEVINS pDevIns, PIOMMU pThis, uint32_t offReg, uint64_t u64Value)1190 {1191 RT_NOREF(pThis, offReg);1192 Assert(!RT_HI_U32(u64Value));1193 PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];1194 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev);1195 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_ADDR_LO, u64Value & VBOX_MSI_ADDR_VALID_MASK);1196 return VINF_SUCCESS;1197 }1198 1199 1200 /**1201 * Writes the MSI Address (Hi) Register (32-bit).1202 */1203 static VBOXSTRICTRC iommuAmdMsiAddrHi_w(PPDMDEVINS pDevIns, PIOMMU pThis, uint32_t offReg, uint64_t u64Value)1204 {1205 RT_NOREF(pThis, offReg);1206 Assert(!RT_HI_U32(u64Value));1207 PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];1208 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev);1209 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_ADDR_HI, u64Value);1210 return VINF_SUCCESS;1211 }1212 1213 1214 /**1215 * Writes the MSI Data Register (32-bit).1216 */1217 static VBOXSTRICTRC iommuAmdMsiData_w(PPDMDEVINS pDevIns, PIOMMU pThis, uint32_t offReg, uint64_t u64Value)1218 {1219 RT_NOREF(pThis, offReg);1220 PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];1221 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev);1222 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_DATA, u64Value & VBOX_MSI_DATA_VALID_MASK);1223 return VINF_SUCCESS;1224 }1225 #else1226 1154 /** 1227 1155 * Writes the MSI Vector Register 0 (32-bit) and the MSI Vector Register 1 (32-bit). … … 1293 1221 return VINF_SUCCESS; 1294 1222 } 1295 #endif1296 1223 1297 1224 … … 1333 1260 iommuAmdCmdThreadWakeUpIfNeeded(pDevIns); 1334 1261 1335 Log 5Func(("Set CmdBufHeadPtr to %#RX32\n", offBuf));1262 Log4Func(("Set CmdBufHeadPtr to %#RX32\n", offBuf)); 1336 1263 return VINF_SUCCESS; 1337 1264 } … … 1374 1301 iommuAmdCmdThreadWakeUpIfNeeded(pDevIns); 1375 1302 1376 Log 5Func(("Set CmdBufTailPtr to %#RX32\n", offBuf));1303 Log4Func(("Set CmdBufTailPtr to %#RX32\n", offBuf)); 1377 1304 return VINF_SUCCESS; 1378 1305 } … … 1475 1402 } 1476 1403 1477 #ifdef IOMMU_NEW_REGISTER_ACCESS 1404 1478 1405 /** 1479 1406 * Register access table 0. … … 1637 1564 return pReg; 1638 1565 } 1639 #endif1640 1566 1641 1567 … … 1660 1586 AssertMsgReturn(!(off & 3), ("Invalid offset %#x\n", off), VINF_SUCCESS); 1661 1587 1662 Log5Func(("off=%#x cb=%u uValue=%#RX64\n", off, cb, uValue)); 1663 1664 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); 1665 #ifndef IOMMU_NEW_REGISTER_ACCESS 1666 switch (off) 1667 { 1668 case IOMMU_MMIO_OFF_DEV_TAB_BAR: return iommuAmdDevTabBar_w(pDevIns, pThis, off, uValue); 1669 case IOMMU_MMIO_OFF_CMD_BUF_BAR: return iommuAmdCmdBufBar_w(pDevIns, pThis, off, uValue); 1670 case IOMMU_MMIO_OFF_EVT_LOG_BAR: return iommuAmdEvtLogBar_w(pDevIns, pThis, off, uValue); 1671 case IOMMU_MMIO_OFF_CTRL: return iommuAmdCtrl_w(pDevIns, pThis, off, uValue); 1672 case IOMMU_MMIO_OFF_EXCL_BAR: return iommuAmdExclRangeBar_w(pDevIns, pThis, off, uValue); 1673 case IOMMU_MMIO_OFF_EXCL_RANGE_LIMIT: return iommuAmdExclRangeLimit_w(pDevIns, pThis, off, uValue); 1674 case IOMMU_MMIO_OFF_EXT_FEAT: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1675 1676 case IOMMU_MMIO_OFF_PPR_LOG_BAR: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1677 case IOMMU_MMIO_OFF_HW_EVT_HI: return iommuAmdHwEvtHi_w(pDevIns, pThis, off, uValue); 1678 case IOMMU_MMIO_OFF_HW_EVT_LO: return iommuAmdHwEvtLo_w(pDevIns, pThis, off, uValue); 1679 case IOMMU_MMIO_OFF_HW_EVT_STATUS: return iommuAmdHwEvtStatus_w(pDevIns, pThis, off, uValue); 1680 1681 case IOMMU_MMIO_OFF_GALOG_BAR: 1682 case IOMMU_MMIO_OFF_GALOG_TAIL_ADDR: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1683 1684 case IOMMU_MMIO_OFF_PPR_LOG_B_BAR: 1685 case IOMMU_MMIO_OFF_PPR_EVT_B_BAR: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1686 1687 case IOMMU_MMIO_OFF_DEV_TAB_SEG_1: 1688 case IOMMU_MMIO_OFF_DEV_TAB_SEG_2: 1689 case IOMMU_MMIO_OFF_DEV_TAB_SEG_3: 1690 case IOMMU_MMIO_OFF_DEV_TAB_SEG_4: 1691 case IOMMU_MMIO_OFF_DEV_TAB_SEG_5: 1692 case IOMMU_MMIO_OFF_DEV_TAB_SEG_6: 1693 case IOMMU_MMIO_OFF_DEV_TAB_SEG_7: return iommuAmdDevTabSegBar_w(pDevIns, pThis, off, uValue); 1694 1695 case IOMMU_MMIO_OFF_DEV_SPECIFIC_FEAT: 1696 case IOMMU_MMIO_OFF_DEV_SPECIFIC_CTRL: 1697 case IOMMU_MMIO_OFF_DEV_SPECIFIC_STATUS: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1698 1699 case IOMMU_MMIO_OFF_MSI_VECTOR_0: 1700 case IOMMU_MMIO_OFF_MSI_VECTOR_1: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1701 case IOMMU_MMIO_OFF_MSI_CAP_HDR: 1702 { 1703 VBOXSTRICTRC rcStrict = iommuAmdMsiCapHdr_w(pDevIns, pThis, off, (uint32_t)uValue); 1704 if (cb == 4 || RT_FAILURE(rcStrict)) 1705 return rcStrict; 1706 uValue >>= 32; 1707 RT_FALL_THRU(); 1708 } 1709 case IOMMU_MMIO_OFF_MSI_ADDR_LO: return iommuAmdMsiAddrLo_w(pDevIns, pThis, off, uValue); 1710 case IOMMU_MMIO_OFF_MSI_ADDR_HI: 1711 { 1712 VBOXSTRICTRC rcStrict = iommuAmdMsiAddrHi_w(pDevIns, pThis, off, (uint32_t)uValue); 1713 if (cb == 4 || RT_FAILURE(rcStrict)) 1714 return rcStrict; 1715 uValue >>= 32; 1716 RT_FALL_THRU(); 1717 } 1718 case IOMMU_MMIO_OFF_MSI_DATA: return iommuAmdMsiData_w(pDevIns, pThis, off, uValue); 1719 case IOMMU_MMIO_OFF_MSI_MAPPING_CAP_HDR: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1720 1721 case IOMMU_MMIO_OFF_PERF_OPT_CTRL: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1722 1723 case IOMMU_MMIO_OFF_XT_GEN_INTR_CTRL: 1724 case IOMMU_MMIO_OFF_XT_PPR_INTR_CTRL: 1725 case IOMMU_MMIO_OFF_XT_GALOG_INT_CTRL: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1726 1727 case IOMMU_MMIO_OFF_MARC_APER_BAR_0: 1728 case IOMMU_MMIO_OFF_MARC_APER_RELOC_0: 1729 case IOMMU_MMIO_OFF_MARC_APER_LEN_0: 1730 case IOMMU_MMIO_OFF_MARC_APER_BAR_1: 1731 case IOMMU_MMIO_OFF_MARC_APER_RELOC_1: 1732 case IOMMU_MMIO_OFF_MARC_APER_LEN_1: 1733 case IOMMU_MMIO_OFF_MARC_APER_BAR_2: 1734 case IOMMU_MMIO_OFF_MARC_APER_RELOC_2: 1735 case IOMMU_MMIO_OFF_MARC_APER_LEN_2: 1736 case IOMMU_MMIO_OFF_MARC_APER_BAR_3: 1737 case IOMMU_MMIO_OFF_MARC_APER_RELOC_3: 1738 case IOMMU_MMIO_OFF_MARC_APER_LEN_3: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1739 1740 case IOMMU_MMIO_OFF_RSVD_REG: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1741 1742 case IOMMU_MMIO_OFF_CMD_BUF_HEAD_PTR: return iommuAmdCmdBufHeadPtr_w(pDevIns, pThis, off, uValue); 1743 case IOMMU_MMIO_OFF_CMD_BUF_TAIL_PTR: return iommuAmdCmdBufTailPtr_w(pDevIns, pThis, off, uValue); 1744 case IOMMU_MMIO_OFF_EVT_LOG_HEAD_PTR: return iommuAmdEvtLogHeadPtr_w(pDevIns, pThis, off, uValue); 1745 case IOMMU_MMIO_OFF_EVT_LOG_TAIL_PTR: return iommuAmdEvtLogTailPtr_w(pDevIns, pThis, off, uValue); 1746 1747 case IOMMU_MMIO_OFF_STATUS: return iommuAmdStatus_w(pDevIns, pThis, off, uValue); 1748 1749 case IOMMU_MMIO_OFF_PPR_LOG_HEAD_PTR: 1750 case IOMMU_MMIO_OFF_PPR_LOG_TAIL_PTR: 1751 1752 case IOMMU_MMIO_OFF_GALOG_HEAD_PTR: 1753 case IOMMU_MMIO_OFF_GALOG_TAIL_PTR: 1754 1755 case IOMMU_MMIO_OFF_PPR_LOG_B_HEAD_PTR: 1756 case IOMMU_MMIO_OFF_PPR_LOG_B_TAIL_PTR: 1757 1758 case IOMMU_MMIO_OFF_EVT_LOG_B_HEAD_PTR: 1759 case IOMMU_MMIO_OFF_EVT_LOG_B_TAIL_PTR: return iommuAmdIgnore_w(pDevIns, pThis, off, uValue); 1760 1761 case IOMMU_MMIO_OFF_PPR_LOG_AUTO_RESP: 1762 case IOMMU_MMIO_OFF_PPR_LOG_OVERFLOW_EARLY: 1763 case IOMMU_MMIO_OFF_PPR_LOG_B_OVERFLOW_EARLY: 1764 1765 /* Not implemented. */ 1766 case IOMMU_MMIO_OFF_SMI_FLT_FIRST: 1767 case IOMMU_MMIO_OFF_SMI_FLT_LAST: 1768 { 1769 LogFunc(("Writing unsupported register: SMI filter %u -> Ignored\n", (off - IOMMU_MMIO_OFF_SMI_FLT_FIRST) >> 3)); 1770 return VINF_SUCCESS; 1771 } 1772 1773 /* Unknown. */ 1774 default: 1775 { 1776 LogFunc(("Writing unknown register %u (%#x) with %#RX64 -> Ignored\n", off, off, uValue)); 1777 return VINF_SUCCESS; 1778 } 1779 } 1780 #else 1781 PCIOMMUREGACC pReg = iommuAmdGetRegAccessForOffset(off); 1588 Log4Func(("off=%#x cb=%u uValue=%#RX64\n", off, cb, uValue)); 1589 1590 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); 1591 PCIOMMUREGACC pReg = iommuAmdGetRegAccessForOffset(off); 1782 1592 if (pReg) 1783 1593 { /* likely */ } … … 1858 1668 uValue = (uValue << 32) | (u64Read & UINT64_C(0xffffffff)); 1859 1669 return pReg->pfnWrite(pDevIns, pThis, off - 4, uValue); 1860 #endif1861 1670 } 1862 1671 … … 1887 1696 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); 1888 1697 PCPDMPCIDEV pPciDev = pDevIns->apPciDevs[0]; 1889 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev); 1890 1891 Log5Func(("off=%#x\n", off)); 1892 1893 #ifndef IOMMU_NEW_REGISTER_ACCESS 1894 /** @todo IOMMU: fine-grained locking? */ 1895 uint64_t uReg; 1896 switch (off) 1897 { 1898 case IOMMU_MMIO_OFF_DEV_TAB_BAR: uReg = pThis->aDevTabBaseAddrs[0].u64; break; 1899 case IOMMU_MMIO_OFF_CMD_BUF_BAR: uReg = pThis->CmdBufBaseAddr.u64; break; 1900 case IOMMU_MMIO_OFF_EVT_LOG_BAR: uReg = pThis->EvtLogBaseAddr.u64; break; 1901 case IOMMU_MMIO_OFF_CTRL: uReg = pThis->Ctrl.u64; break; 1902 case IOMMU_MMIO_OFF_EXCL_BAR: uReg = pThis->ExclRangeBaseAddr.u64; break; 1903 case IOMMU_MMIO_OFF_EXCL_RANGE_LIMIT: uReg = pThis->ExclRangeLimit.u64; break; 1904 case IOMMU_MMIO_OFF_EXT_FEAT: uReg = pThis->ExtFeat.u64; break; 1905 1906 case IOMMU_MMIO_OFF_PPR_LOG_BAR: uReg = pThis->PprLogBaseAddr.u64; break; 1907 case IOMMU_MMIO_OFF_HW_EVT_HI: uReg = pThis->HwEvtHi.u64; break; 1908 case IOMMU_MMIO_OFF_HW_EVT_LO: uReg = pThis->HwEvtLo; break; 1909 case IOMMU_MMIO_OFF_HW_EVT_STATUS: uReg = pThis->HwEvtStatus.u64; break; 1910 1911 case IOMMU_MMIO_OFF_GALOG_BAR: uReg = pThis->GALogBaseAddr.u64; break; 1912 case IOMMU_MMIO_OFF_GALOG_TAIL_ADDR: uReg = pThis->GALogTailAddr.u64; break; 1913 1914 case IOMMU_MMIO_OFF_PPR_LOG_B_BAR: uReg = pThis->PprLogBBaseAddr.u64; break; 1915 case IOMMU_MMIO_OFF_PPR_EVT_B_BAR: uReg = pThis->EvtLogBBaseAddr.u64; break; 1916 1917 case IOMMU_MMIO_OFF_DEV_TAB_SEG_1: 1918 case IOMMU_MMIO_OFF_DEV_TAB_SEG_2: 1919 case IOMMU_MMIO_OFF_DEV_TAB_SEG_3: 1920 case IOMMU_MMIO_OFF_DEV_TAB_SEG_4: 1921 case IOMMU_MMIO_OFF_DEV_TAB_SEG_5: 1922 case IOMMU_MMIO_OFF_DEV_TAB_SEG_6: 1923 case IOMMU_MMIO_OFF_DEV_TAB_SEG_7: 1924 { 1925 uint8_t const offDevTabSeg = (off - IOMMU_MMIO_OFF_DEV_TAB_SEG_FIRST) >> 3; 1926 uint8_t const idxDevTabSeg = offDevTabSeg + 1; 1927 Assert(idxDevTabSeg < RT_ELEMENTS(pThis->aDevTabBaseAddrs)); 1928 uReg = pThis->aDevTabBaseAddrs[idxDevTabSeg].u64; 1929 break; 1930 } 1931 1932 case IOMMU_MMIO_OFF_DEV_SPECIFIC_FEAT: uReg = pThis->DevSpecificFeat.u64; break; 1933 case IOMMU_MMIO_OFF_DEV_SPECIFIC_CTRL: uReg = pThis->DevSpecificCtrl.u64; break; 1934 case IOMMU_MMIO_OFF_DEV_SPECIFIC_STATUS: uReg = pThis->DevSpecificStatus.u64; break; 1935 1936 case IOMMU_MMIO_OFF_MSI_VECTOR_0: uReg = pThis->MiscInfo.u64; break; 1937 case IOMMU_MMIO_OFF_MSI_VECTOR_1: uReg = pThis->MiscInfo.au32[1]; break; 1938 case IOMMU_MMIO_OFF_MSI_CAP_HDR: 1939 { 1940 uint32_t const uMsiCapHdr = PDMPciDevGetDWord(pPciDev, IOMMU_PCI_OFF_MSI_CAP_HDR); 1941 uint32_t const uMsiAddrLo = PDMPciDevGetDWord(pPciDev, IOMMU_PCI_OFF_MSI_ADDR_LO); 1942 uReg = RT_MAKE_U64(uMsiCapHdr, uMsiAddrLo); 1943 break; 1944 } 1945 case IOMMU_MMIO_OFF_MSI_ADDR_LO: 1946 { 1947 uReg = PDMPciDevGetDWord(pPciDev, IOMMU_PCI_OFF_MSI_ADDR_LO); 1948 break; 1949 } 1950 case IOMMU_MMIO_OFF_MSI_ADDR_HI: 1951 { 1952 uint32_t const uMsiAddrHi = PDMPciDevGetDWord(pPciDev, IOMMU_PCI_OFF_MSI_ADDR_HI); 1953 uint32_t const uMsiData = PDMPciDevGetDWord(pPciDev, IOMMU_PCI_OFF_MSI_DATA); 1954 uReg = RT_MAKE_U64(uMsiAddrHi, uMsiData); 1955 break; 1956 } 1957 case IOMMU_MMIO_OFF_MSI_DATA: 1958 { 1959 uReg = PDMPciDevGetDWord(pPciDev, IOMMU_PCI_OFF_MSI_DATA); 1960 break; 1961 } 1962 case IOMMU_MMIO_OFF_MSI_MAPPING_CAP_HDR: 1963 { 1964 /* 1965 * The PCI spec. lists MSI Mapping Capability 08H as related to HyperTransport capability. 1966 * The AMD IOMMU spec. fails to mention it explicitly and lists values for this register as 1967 * though HyperTransport is supported. We don't support HyperTransport, we thus just return 1968 * 0 for this register. 1969 */ 1970 uReg = RT_MAKE_U64(0, pThis->PerfOptCtrl.u32); 1971 break; 1972 } 1973 1974 case IOMMU_MMIO_OFF_PERF_OPT_CTRL: uReg = pThis->PerfOptCtrl.u32; break; 1975 1976 case IOMMU_MMIO_OFF_XT_GEN_INTR_CTRL: uReg = pThis->XtGenIntrCtrl.u64; break; 1977 case IOMMU_MMIO_OFF_XT_PPR_INTR_CTRL: uReg = pThis->XtPprIntrCtrl.u64; break; 1978 case IOMMU_MMIO_OFF_XT_GALOG_INT_CTRL: uReg = pThis->XtGALogIntrCtrl.u64; break; 1979 1980 case IOMMU_MMIO_OFF_MARC_APER_BAR_0: uReg = pThis->aMarcApers[0].Base.u64; break; 1981 case IOMMU_MMIO_OFF_MARC_APER_RELOC_0: uReg = pThis->aMarcApers[0].Reloc.u64; break; 1982 case IOMMU_MMIO_OFF_MARC_APER_LEN_0: uReg = pThis->aMarcApers[0].Length.u64; break; 1983 case IOMMU_MMIO_OFF_MARC_APER_BAR_1: uReg = pThis->aMarcApers[1].Base.u64; break; 1984 case IOMMU_MMIO_OFF_MARC_APER_RELOC_1: uReg = pThis->aMarcApers[1].Reloc.u64; break; 1985 case IOMMU_MMIO_OFF_MARC_APER_LEN_1: uReg = pThis->aMarcApers[1].Length.u64; break; 1986 case IOMMU_MMIO_OFF_MARC_APER_BAR_2: uReg = pThis->aMarcApers[2].Base.u64; break; 1987 case IOMMU_MMIO_OFF_MARC_APER_RELOC_2: uReg = pThis->aMarcApers[2].Reloc.u64; break; 1988 case IOMMU_MMIO_OFF_MARC_APER_LEN_2: uReg = pThis->aMarcApers[2].Length.u64; break; 1989 case IOMMU_MMIO_OFF_MARC_APER_BAR_3: uReg = pThis->aMarcApers[3].Base.u64; break; 1990 case IOMMU_MMIO_OFF_MARC_APER_RELOC_3: uReg = pThis->aMarcApers[3].Reloc.u64; break; 1991 case IOMMU_MMIO_OFF_MARC_APER_LEN_3: uReg = pThis->aMarcApers[3].Length.u64; break; 1992 1993 case IOMMU_MMIO_OFF_RSVD_REG: uReg = pThis->RsvdReg; break; 1994 1995 case IOMMU_MMIO_OFF_CMD_BUF_HEAD_PTR: uReg = pThis->CmdBufHeadPtr.u64; break; 1996 case IOMMU_MMIO_OFF_CMD_BUF_TAIL_PTR: uReg = pThis->CmdBufTailPtr.u64; break; 1997 case IOMMU_MMIO_OFF_EVT_LOG_HEAD_PTR: uReg = pThis->EvtLogHeadPtr.u64; break; 1998 case IOMMU_MMIO_OFF_EVT_LOG_TAIL_PTR: uReg = pThis->EvtLogTailPtr.u64; break; 1999 2000 case IOMMU_MMIO_OFF_STATUS: uReg = pThis->Status.u64; break; 2001 2002 case IOMMU_MMIO_OFF_PPR_LOG_HEAD_PTR: uReg = pThis->PprLogHeadPtr.u64; break; 2003 case IOMMU_MMIO_OFF_PPR_LOG_TAIL_PTR: uReg = pThis->PprLogTailPtr.u64; break; 2004 2005 case IOMMU_MMIO_OFF_GALOG_HEAD_PTR: uReg = pThis->GALogHeadPtr.u64; break; 2006 case IOMMU_MMIO_OFF_GALOG_TAIL_PTR: uReg = pThis->GALogTailPtr.u64; break; 2007 2008 case IOMMU_MMIO_OFF_PPR_LOG_B_HEAD_PTR: uReg = pThis->PprLogBHeadPtr.u64; break; 2009 case IOMMU_MMIO_OFF_PPR_LOG_B_TAIL_PTR: uReg = pThis->PprLogBTailPtr.u64; break; 2010 2011 case IOMMU_MMIO_OFF_EVT_LOG_B_HEAD_PTR: uReg = pThis->EvtLogBHeadPtr.u64; break; 2012 case IOMMU_MMIO_OFF_EVT_LOG_B_TAIL_PTR: uReg = pThis->EvtLogBTailPtr.u64; break; 2013 2014 case IOMMU_MMIO_OFF_PPR_LOG_AUTO_RESP: uReg = pThis->PprLogAutoResp.u64; break; 2015 case IOMMU_MMIO_OFF_PPR_LOG_OVERFLOW_EARLY: uReg = pThis->PprLogOverflowEarly.u64; break; 2016 case IOMMU_MMIO_OFF_PPR_LOG_B_OVERFLOW_EARLY: uReg = pThis->PprLogBOverflowEarly.u64; break; 2017 2018 /* Not implemented. */ 2019 case IOMMU_MMIO_OFF_SMI_FLT_FIRST: 2020 case IOMMU_MMIO_OFF_SMI_FLT_LAST: 2021 { 2022 LogFunc(("Reading unsupported register: SMI filter %u\n", (off - IOMMU_MMIO_OFF_SMI_FLT_FIRST) >> 3)); 2023 uReg = 0; 2024 break; 2025 } 2026 2027 /* Unknown. */ 2028 default: 2029 { 2030 LogFunc(("Reading unknown register %u (%#x) -> 0\n", off, off)); 2031 uReg = 0; 2032 return VINF_IOM_MMIO_UNUSED_00; 2033 } 2034 } 2035 2036 *puResult = uReg; 2037 return VINF_SUCCESS; 2038 #else 2039 NOREF(pPciDev); 1698 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev); NOREF(pPciDev); 1699 1700 Log4Func(("off=%#x\n", off)); 1701 2040 1702 PCIOMMUREGACC pReg = iommuAmdGetRegAccessForOffset(off); 2041 1703 if (pReg) … … 2080 1742 2081 1743 return rcStrict; 2082 #endif2083 1744 } 2084 1745 … … 3779 3440 if (RT_UNLIKELY(pThread->enmState != PDMTHREADSTATE_RUNNING)) 3780 3441 break; 3781 Log 5Func(("Woken up with rc=%Rrc\n", rc));3442 Log4Func(("Woken up with rc=%Rrc\n", rc)); 3782 3443 ASMAtomicWriteBool(&pThis->fCmdThreadSignaled, false); 3783 3444 }
Note:
See TracChangeset
for help on using the changeset viewer.