Changeset 83988 in vbox for trunk/src/VBox/Devices/Bus
- Timestamp:
- Apr 27, 2020 8:40:58 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r83985 r83988 2092 2092 2093 2093 /** 2094 * An array of the masks to select the device table segment index from a device ID. 2095 */ 2096 static uint16_t const g_auDevTabSegMasks[] = { 0x0, 0x8000, 0xc000, 0xe000 }; 2097 2098 /** 2094 2099 * The maximum size (inclusive) of each device table segment (0 to 7). 2095 2100 * Indexed by the device table segment index. … … 2908 2913 2909 2914 /** 2915 * Reads a device table entry from guest memory given the device ID. 2916 * 2917 * @returns VBox status code. 2918 * @param pDevIns The IOMMU device instance. 2919 * @param uDevId The device ID. 2920 * @param pDevTabEntry Where to store the device table entry. 2921 */ 2922 static int iommuAmdReadDevTabEntry(PPDMDEVINS pDevIns, uint16_t uDevId, DEV_TAB_ENTRY_T *pDevTabEntry) 2923 { 2924 PCIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU); 2925 IOMMU_CTRL_T const Ctrl = iommuAmdGetCtrl(pThis); 2926 2927 uint8_t const idxSegsEn = Ctrl.n.u3DevTabSegEn; 2928 Assert(idxSegsEn < RT_ELEMENTS(g_auDevTabSegMasks)); 2929 2930 uint8_t const idxSeg = uDevId & g_auDevTabSegMasks[idxSegsEn] >> 13; 2931 Assert(idxSeg < RT_ELEMENTS(pThis->aDevTabBaseAddrs)); 2932 2933 RTGCPHYS const GCPhysDevTab = pThis->aDevTabBaseAddrs[idxSeg].n.u40Base; 2934 uint16_t const offDevTabEntry = uDevId & ~g_auDevTabSegMasks[idxSegsEn]; 2935 RTGCPHYS const GCPhysDevTabEntry = GCPhysDevTab + offDevTabEntry; 2936 2937 int rc = PDMDevHlpPCIPhysRead(pDevIns, GCPhysDevTabEntry, pDevTabEntry, sizeof(*pDevTabEntry)); 2938 if (RT_FAILURE(rc)) 2939 Log((IOMMU_LOG_PFX ": Failed to read device table entry at %#RGp. rc=%Rrc\n", GCPhysDevTabEntry, rc)); 2940 2941 return rc; 2942 } 2943 2944 2945 /** 2910 2946 * Memory read transaction from a device. 2911 2947 * 2912 2948 * @returns VBox status code. 2913 2949 * @param pDevIns The IOMMU device instance. 2914 * @param uDev iceIdThe device identifier (bus, device, function).2950 * @param uDevId The device identifier (bus, device, function). 2915 2951 * @param uDva The device virtual address being read. 2916 2952 * @param cbRead The number of bytes being read. … … 2919 2955 * @thread Any. 2920 2956 */ 2921 static int iommuAmdDeviceMemRead(PPDMDEVINS pDevIns, uint16_t uDev iceId, uint64_t uDva, size_t cbRead, PRTGCPHYS pGCPhysOut)2922 { 2923 RT_NOREF(pDevIns, uDev iceId, uDva, cbRead, pGCPhysOut);2957 static int iommuAmdDeviceMemRead(PPDMDEVINS pDevIns, uint16_t uDevId, uint64_t uDva, size_t cbRead, PRTGCPHYS pGCPhysOut) 2958 { 2959 RT_NOREF(pDevIns, uDevId, uDva, cbRead, pGCPhysOut); 2924 2960 return VERR_NOT_IMPLEMENTED; 2925 2961 } … … 2931 2967 * @returns VBox status code. 2932 2968 * @param pDevIns The IOMMU device instance. 2933 * @param uDev iceIdThe device identifier (bus, device, function).2969 * @param uDevId The device identifier (bus, device, function). 2934 2970 * @param uDva The device virtual address being written. 2935 2971 * @param cbWrite The number of bytes being written. … … 2938 2974 * @thread Any. 2939 2975 */ 2940 static int iommuAmdDeviceMemWrite(PPDMDEVINS pDevIns, uint16_t uDev iceId, uint64_t uDva, size_t cbWrite, PRTGCPHYS pGCPhysOut)2941 { 2942 RT_NOREF(pDevIns, uDev iceId, uDva, cbWrite, pGCPhysOut);2976 static int iommuAmdDeviceMemWrite(PPDMDEVINS pDevIns, uint16_t uDevId, uint64_t uDva, size_t cbWrite, PRTGCPHYS pGCPhysOut) 2977 { 2978 RT_NOREF(pDevIns, uDevId, uDva, cbWrite, pGCPhysOut); 2943 2979 return VERR_NOT_IMPLEMENTED; 2944 2980 }
Note:
See TracChangeset
for help on using the changeset viewer.