Changeset 84320 in vbox
- Timestamp:
- May 15, 2020 1:09:47 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r84318 r84320 711 711 712 712 /** 713 * I/O Page Table Ent ry/Entity.713 * I/O Page Table Entity. 714 714 * In accordance with the AMD spec. 715 715 * … … 2260 2260 /** 2261 2261 * IOMMU I/O TLB Entry. 2262 * @note Update iommuAmdInitIotlbe() when changes are made.2262 * Keep this as small and aligned as possible. 2263 2263 */ 2264 2264 typedef struct 2265 2265 { 2266 /** Magic (IOMMU_IOTLBE_MAGIC). */ 2267 uint32_t uMagic; 2268 /** Reserved for future (eviction hints?). */ 2269 uint16_t uRsvd0; 2266 /** The translated system physical address (SPA) of the page. */ 2267 RTGCPHYS GCPhysSpa; 2270 2268 /** The I/O access permissions (IOMMU_IO_PERM_XXX). */ 2271 2269 uint8_t fIoPerm; 2272 /** The number of offset bits in the system physical address. */ 2273 uint8_t cShift; 2274 /** The translated system physical address (SPA) of the page. */ 2275 RTGCPHYS GCPhysSpa; 2270 /** Alignment padding. */ 2271 uint8_t afPadding[7]; 2276 2272 } IOTLBE_T; 2277 AssertCompileSizeAlignment(IOTLBE_T, 8); 2278 AssertCompileMemberAlignment(IOTLBE_T, GCPhysSpa, 8); 2273 AssertCompileSize(IOTLBE_T, 16); 2279 2274 /** Pointer to an IOMMU I/O TLB entry struct. */ 2280 2275 typedef IOTLBE_T *PIOTLBE_T; … … 4008 4003 4009 4004 IOMMU_UNLOCK(pDevIns); 4010 }4011 4012 4013 /**4014 * Initializes an IOTLB entry.4015 *4016 * @param GCPhysSpa The translated system physical address.4017 * @param cShift The number of offset bits in the system physical address.4018 * @param fIoPerm The I/O access permissions (IOMMU_IO_PERM_XXX).4019 * @param pIotlbe Where to store the initialized IOTLB entry.4020 */4021 static void iommuAmdInitIotlbe(RTGCPHYS GCPhysSpa, uint8_t cShift, uint8_t fIoPerm, PIOTLBE_T pIotlbe)4022 {4023 pIotlbe->uMagic = IOMMU_IOTLBE_MAGIC;4024 pIotlbe->uRsvd0 = 0;4025 pIotlbe->fIoPerm = fIoPerm;4026 pIotlbe->cShift = cShift;4027 pIotlbe->GCPhysSpa = GCPhysSpa;4028 }4029 4030 4031 /**4032 * Updates an IOTLB entry.4033 *4034 * @param GCPhysSpa The translated system physical address.4035 * @param cShift The number of offset bits in the system physical address.4036 * @param fIoPerm The I/O access permissions (IOMMU_IO_PERM_XXX).4037 * @param pIotlbe The IOTLB entry to update.4038 */4039 static void iommuAmdUpdateIotlbe(RTGCPHYS GCPhysSpa, uint8_t cShift, uint8_t fIoPerm, PIOTLBE_T pIotlbe)4040 {4041 Assert(pIotlbe->uMagic == IOMMU_IOTLBE_MAGIC);4042 pIotlbe->fIoPerm = fIoPerm;4043 pIotlbe->cShift = cShift;4044 pIotlbe->GCPhysSpa = GCPhysSpa;4045 4005 } 4046 4006
Note:
See TracChangeset
for help on using the changeset viewer.