VirtualBox

Changeset 89002 in vbox for trunk


Ignore:
Timestamp:
May 12, 2021 8:44:10 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144340
Message:

Intel IOMMU: bugref:9967 VBox/msi.h: Add unions for IOMMU DMAR remappable format and x2APIC format.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/msi.h

    r84828 r89002  
    139139/**
    140140 * MSI Address Register.
    141  * In accordance with the Intel spec.
    142  * See Intel spec. 10.11.1 "Message Address Register Format".
    143  *
    144  * This also conforms to the AMD IOMMU spec. which omits specifying individual
    145  * fields but specifies reserved bits.
    146141 */
    147142typedef union MSIADDR
    148143{
    149     struct
    150     {
    151         uint32_t   u2Ign0 : 2;          /**< Bits 1:0   - Ignored (read as 0, writes ignored). */
    152         uint32_t   u1DestMode : 1;      /**< Bit  2     - DM: Destination Mode. */
    153         uint32_t   u1RedirHint : 1;     /**< Bit  3     - RH: Redirection Hint. */
    154         uint32_t   u8Rsvd0 : 8;         /**< Bits 11:4  - Reserved. */
    155         uint32_t   u8DestId : 8;        /**< Bits 19:12 - Destination Id. */
    156         uint32_t   u12Addr : 12;        /**< Bits 31:20 - Address. */
     144    /*
     145     * Intel and AMD xAPIC format.
     146     * See Intel spec. 10.11.1 "Message Address Register Format".
     147     * This also conforms to the AMD IOMMU spec. which omits specifying
     148     * individual fields but specifies reserved bits.
     149     */
     150    struct
     151    {
     152        uint32_t   u2Ign0      :  2;    /**< Bits 1:0   - Ignored (read as 0, writes ignored). */
     153        uint32_t   u1DestMode  :  1;    /**< Bit  2     - DM: Destination Mode. */
     154        uint32_t   u1RedirHint :  1;    /**< Bit  3     - RH: Redirection Hint. */
     155        uint32_t   u8Rsvd0     :  8;    /**< Bits 11:4  - Reserved. */
     156        uint32_t   u8DestId    :  8;    /**< Bits 19:12 - Destination Id. */
     157        uint32_t   u12Addr     : 12;    /**< Bits 31:20 - Address. */
    157158        uint32_t   u32Rsvd0;            /**< Bits 63:32 - Reserved. */
    158159    } n;
     160
     161    /*
     162     * Intel x2APIC Format.
     163     * See Intel VT-d spec. 5.1.6.2 "Programming in Intel 64 x2APIC Mode".
     164     */
     165    struct
     166    {
     167        uint32_t   u2Ign0      :  2;    /**< Bits 1:0   - Ignored (read as 0, writes ignored). */
     168        uint32_t   u1DestMode  :  1;    /**< Bit  2     - DM: Destination Mode. */
     169        uint32_t   u1RedirHint :  1;    /**< Bit  3     - RH: Redirection Hint. */
     170        uint32_t   u8Rsvd0     :  8;    /**< Bits 11:4  - Reserved. */
     171        uint32_t   u8DestIdLo  :  8;    /**< Bits 19:12 - Destination Id (bits 7:0). */
     172        uint32_t   u12Addr     : 12;    /**< Bits 31:20 - Address. */
     173        uint32_t   u8Rsvd      :  8;    /**< Bits 39:32 - Reserved. */
     174        uint32_t   u24DestIdHi : 24;    /**< Bits 63:40 - Destination Id (bits 31:8). */
     175    } x2apic;
     176
     177    /*
     178     * Intel IOMMU Remappable Interrupt Format.
     179     * See Intel VT-d spec. 5.1.2.2 "Interrupt Requests in Remappable Format".
     180     */
     181    struct
     182    {
     183        uint32_t   u2Ign0         :  2; /**< Bits 1:0   - Ignored (read as 0, writes ignored). */
     184        uint32_t   u1IntrIndexHi  :  1; /**< Bit  2     - Interrupt Index[15]. */
     185        uint32_t   fShv           :  1; /**< Bit  3     - Sub-Handle Valid. */
     186        uint32_t   fIntrFormat    :  1; /**< Bit  4     - Interrupt Format (1=remappable, 0=compatibility). */
     187        uint32_t   u14IntrIndexLo : 15; /**< Bits 19:5  - Interrupt Index[14:0]. */
     188        uint32_t   u12Addr        : 12; /**< Bits 31:20 - Address. */
     189        uint32_t   u32Rsvd0;            /**< Bits 63:32 - Reserved. */
     190    } dmar_remap;
     191
    159192    /** The 32-bit unsigned integer view. */
    160193    uint32_t    au32[2];
     194
    161195    /** The 64-bit unsigned integer view. */
    162196    uint64_t    u64;
     
    178212/**
    179213 * MSI Data Register.
    180  * In accordance with the Intel spec.
    181  * See Intel spec. 10.11.2 "Message Data Register Format".
    182  *
    183  * This also conforms to the AMD IOMMU spec. which omits specifying individual
    184  * fields but specifies reserved bits.
    185214 */
    186215typedef union MSIDATA
    187216{
    188     struct
    189     {
    190         uint32_t    u8Vector : 8;           /**< Bits 7:0   - Vector. */
     217    /*
     218     * Intel and AMD xAPIC format.
     219     * See Intel spec. 10.11.2 "Message Data Register Format".
     220     * This also conforms to the AMD IOMMU spec. which omits specifying
     221     * individual fields but specifies reserved bits.
     222     */
     223    struct
     224    {
     225        uint32_t    u8Vector       : 8;     /**< Bits 7:0   - Vector. */
    191226        uint32_t    u3DeliveryMode : 3;     /**< Bits 10:8  - Delivery Mode. */
    192         uint32_t    u3Rsvd0 : 3;            /**< Bits 13:11 - Reserved. */
    193         uint32_t    u1Level : 1;            /**< Bit  14    - Level. */
    194         uint32_t    u1TriggerMode : 1;      /**< Bit  15    - Trigger Mode (0=edge, 1=level). */
    195         uint32_t    u16Rsvd0 : 16;          /**< Bits 31:16 - Reserved. */
     227        uint32_t    u3Rsvd0        : 3;     /**< Bits 13:11 - Reserved. */
     228        uint32_t    u1Level        : 1;     /**< Bit  14    - Level. */
     229        uint32_t    u1TriggerMode  : 1;     /**< Bit  15    - Trigger Mode (0=edge, 1=level). */
     230        uint32_t    u16Rsvd0       : 16;    /**< Bits 31:16 - Reserved. */
    196231    } n;
     232
     233    /*
     234     * Intel x2APIC Format.
     235     * See Intel VT-d spec. 5.1.6.2 "Programming in Intel 64 x2APIC Mode".
     236     */
     237    struct
     238    {
     239        uint32_t    u8Vector       :  8;    /**< Bits 7:0   - Vector. */
     240        uint32_t    u1DeliveryMode :  1;    /**< Bit  8     - Delivery Mode (0=fixed, 1=lowest priority). */
     241        uint32_t    u23Rsvd0       : 23;    /**< Bits 31:9  - Reserved. */
     242    } x2apic;
     243
     244    /*
     245     * Intel IOMMU Remappable Interrupt Format.
     246     * See Intel VT-d spec. 5.1.2.2 "Interrupt Requests in Remappable Format".
     247     */
     248    struct
     249    {
     250        uint16_t    u16SubHandle;
     251        uint16_t    u16Rsvd0;
     252    } dmar_remap;
     253
    197254    /** The 32-bit unsigned integer view. */
    198255    uint32_t    u32;
Note: See TracChangeset for help on using the changeset viewer.

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