VirtualBox

Changeset 84320 in vbox


Ignore:
Timestamp:
May 15, 2020 1:09:47 PM (5 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Bits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp

    r84318 r84320  
    711711
    712712/**
    713  * I/O Page Table Entry/Entity.
     713 * I/O Page Table Entity.
    714714 * In accordance with the AMD spec.
    715715 *
     
    22602260/**
    22612261 * IOMMU I/O TLB Entry.
    2262  * @note Update iommuAmdInitIotlbe() when changes are made.
     2262 * Keep this as small and aligned as possible.
    22632263 */
    22642264typedef struct
    22652265{
    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;
    22702268    /** The I/O access permissions (IOMMU_IO_PERM_XXX). */
    22712269    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];
    22762272} IOTLBE_T;
    2277 AssertCompileSizeAlignment(IOTLBE_T, 8);
    2278 AssertCompileMemberAlignment(IOTLBE_T, GCPhysSpa, 8);
     2273AssertCompileSize(IOTLBE_T, 16);
    22792274/** Pointer to an IOMMU I/O TLB entry struct. */
    22802275typedef IOTLBE_T *PIOTLBE_T;
     
    40084003
    40094004    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;
    40454005}
    40464006
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette