Changeset 83615 in vbox for trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
- Timestamp:
- Apr 8, 2020 5:58:15 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r83599 r83615 2780 2780 * Validate and read the configuration. 2781 2781 */ 2782 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Device|Function|MmioBase", ""); 2783 2784 uint64_t u64MmioBase; 2785 rc = pHlp->pfnCFGMQueryU64Def(pCfg, "MmioBase", &u64MmioBase, 0); 2786 if (RT_FAILURE(rc)) 2787 return PDMDEV_SET_ERROR(pDevIns, rc, N_("IOMMU: Failed to query \"MmioBase\"")); 2788 /* Must be 16KB aligned when we don't support IOMMU performance counters. */ 2789 if (u64MmioBase & 0x3fff) 2790 return PDMDEV_SET_ERROR(pDevIns, rc, N_("IOMMU: \"MmioBase\" must be 16 KB aligned")); 2791 /** @todo IOMMU: Ensure u64MmioBase isn't 0. */ 2782 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Device|Function", ""); 2792 2783 2793 2784 uint8_t uPciDevice; … … 2848 2839 2849 2840 /* Base Address Low Register. */ 2850 PDMPciDevSetDWord(pPciDev, offBaseAddrLo, 2851 RT_BF_MAKE(IOMMU_BF_BASEADDR_LO_ENABLE, 0x1) /* RW1S - Enable */ 2852 | RT_BF_MAKE(IOMMU_BF_BASEADDR_LO_ADDR, (u64MmioBase >> 14))); /* RO - Base address (Lo) */ 2841 PDMPciDevSetDWord(pPciDev, offBaseAddrLo, 0x0); /* RW - Base address (Lo) and enable bit. */ 2853 2842 2854 2843 /* Base Address High Register. */ 2855 PDMPciDevSetDWord(pPciDev, offBaseAddrHi, RT_HI_U32(u64MmioBase)); /* RO- Base address (Hi) */2844 PDMPciDevSetDWord(pPciDev, offBaseAddrHi, 0x0); /* RW - Base address (Hi) */ 2856 2845 2857 2846 /* IOMMU Range Register. */ 2858 PDMPciDevSetDWord(pPciDev, offRange, 0x0); 2847 PDMPciDevSetDWord(pPciDev, offRange, 0x0); /* RO - Range register. */ 2859 2848 2860 2849 /* Misc. Information Register 0. */ … … 2920 2909 2921 2910 /* 2922 * Map MMIO registers.2911 * Register the MMIO region. 2923 2912 */ 2924 rc = PDMDevHlpMmioCreate AndMap(pDevIns, u64MmioBase, IOMMU_MMIO_REGION_SIZE, iommuAmdMmioWrite, iommuAmdMmioRead,2925 IOMMMIO_FLAGS_READ_DWORD_QWORD | IOMMMIO_FLAGS_WRITE_DWORD_QWORD_READ_MISSING,2926 "IOMMU-AMD", &pThis->hMmio);2913 rc = PDMDevHlpMmioCreate(pDevIns, IOMMU_MMIO_REGION_SIZE, pPciDev, 0 /* iPciRegion */, iommuAmdMmioWrite, iommuAmdMmioRead, 2914 NULL /* pvUser */, IOMMMIO_FLAGS_READ_DWORD_QWORD | IOMMMIO_FLAGS_WRITE_DWORD_QWORD_ZEROED, 2915 "AMD-IOMMU", &pThis->hMmio); 2927 2916 AssertRCReturn(rc, rc); 2928 2917
Note:
See TracChangeset
for help on using the changeset viewer.