VirtualBox

Changeset 88893 in vbox for trunk/src/VBox/Devices/Bus


Ignore:
Timestamp:
May 6, 2021 5:04:35 AM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 Interrupt remapping, work-in-progress. Also include reserved bits in the destination ID when xAPIC mode is used when validating reserved bits.

File:
1 edited

Legend:

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

    r88876 r88893  
    15641564         * high 24-bits of the upper 32-bits of the message address, see @bugref{9967#c22}.
    15651565         */
    1566         uint32_t const idDest = VTD_IRTE_0_GET_X2APIC_DEST_ID(uIrteQword0);
    1567         pMsiOut->Addr.n.u8DestId = idDest & 0xff;
    1568         pMsiOut->Addr.n.u32Rsvd0 = idDest & 0xffffff00;
     1566        uint32_t const idDest = RT_BF_GET(uIrteQword0, VTD_BF_0_IRTE_DST);
     1567        pMsiOut->Addr.n.u8DestId = idDest;
     1568        pMsiOut->Addr.n.u32Rsvd0 = idDest & UINT32_C(0xffffff00);
    15691569    }
    15701570    else
    1571         pMsiOut->Addr.n.u8DestId = VTD_IRTE_0_GET_XAPIC_DEST_ID(uIrteQword0);
     1571        pMsiOut->Addr.n.u8DestId = RT_BF_GET(uIrteQword0, VTD_BF_0_IRTE_DST_XAPIC);
    15721572
    15731573    pMsiOut->Data.n.u8Vector       = RT_BF_GET(uIrteQword0, VTD_BF_0_IRTE_V);
     
    16231623                {
    16241624                    /* Validate reserved bits in the IRTE. */
    1625                     if (   !(uIrteQword0 & ~VTD_IRTE_0_VALID_MASK)
     1625                    bool const     fExtIntrMode  = RT_BF_GET(uIrtaReg, VTD_BF_IRTA_REG_EIME);
     1626                    uint64_t const fQw0ValidMask = fExtIntrMode ? VTD_IRTE_0_X2APIC_VALID_MASK : VTD_IRTE_0_XAPIC_VALID_MASK;
     1627                    if (   !(uIrteQword0 & ~fQw0ValidMask)
    16261628                        && !(uIrteQword1 & ~VTD_IRTE_1_VALID_MASK))
    16271629                    {
     
    16731675                            if (!fPostedMode)
    16741676                            {
    1675                                 bool const fExtIntrMode = RT_BF_GET(uIrtaReg, VTD_BF_IRTA_REG_EIME);
    16761677                                dmarIrRemapFromIrte(fExtIntrMode, &Irte, pMsiIn, pMsiOut);
    16771678                                return VINF_SUCCESS;
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