VirtualBox

Changeset 84539 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
May 26, 2020 1:34:11 PM (5 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Interrupt remapping bits.

File:
1 edited

Legend:

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

    r84530 r84539  
    768768        uint32_t    u3IntrType : 1;         /**< Bits 4:2   - IntType: Interrupt Type. */
    769769        uint32_t    u1ReqEoi : 1;           /**< Bit  5     - RqEoi: Request EOI. */
    770         uint32_t    u1DstMode : 1;          /**< Bit  6     - DM: Destination Mode. */
     770        uint32_t    u1DestMode : 1;         /**< Bit  6     - DM: Destination Mode. */
    771771        uint32_t    u1GuestMode : 1;        /**< Bit  7     - GuestMode. */
    772         uint32_t    u8Dst : 8;              /**< Bits 15:8  - Destination. */
     772        uint32_t    u8Dest : 8;             /**< Bits 15:8  - Destination. */
    773773        uint32_t    u8Vector : 8;           /**< Bits 23:16 - Vector. */
    774774        uint32_t    u8Rsvd0 : 8;            /**< Bits 31:24 - Reserved. */
     
    46154615    /* Ensure the IRTE offset is within the specified table size. */
    46164616    Assert(pDte->n.u4IntrTableLength < 12);
    4617     if (offIrte < (1 << pDte->n.u4IntrTableLength) << IOMMU_IRTE_SIZE_SHIFT)
     4617    if (offIrte + sizeof(IRTE_T) <= (1 << pDte->n.u4IntrTableLength) << IOMMU_IRTE_SIZE_SHIFT)
    46184618    { /* likely */ }
    46194619    else
     
    46334633        return VINF_SUCCESS;
    46344634
    4635     /** @todo r=ramshankar: The IOMMU spec. does not tell what kind of error is
    4636      *        reported in this situation. Is it an I/O page fault or a device table
    4637      *        hardware error? There's no interrupt table hardware error event, but
    4638      *        it's unclear what we should do here. */
     4635    /** @todo The IOMMU spec. does not tell what kind of error is reported in this
     4636     *        situation. Is it an I/O page fault or a device table hardware error?
     4637     *        There's no interrupt table hardware error event, but it's unclear what
     4638     *        we should do here. */
    46394639    Log((IOMMU_LOG_PFX ": Failed to read interrupt table entry at %#RGp. rc=%Rrc -> ???\n", GCPhysIrte, rc));
    46404640    return VERR_IOMMU_IPE_4;
     
    46664666    if (RT_SUCCESS(rc))
    46674667    {
    4668         /** @todo Remap. */
     4668        if (Irte.n.u1RemapEnable)
     4669        {
     4670            if (   !Irte.n.u1GuestMode
     4671                && Irte.n.u3IntrType < VBOX_MSI_DELIVERY_MODE_LOWEST_PRIO)
     4672            {
     4673                MSI_ADDR_T MsiAddrIn;
     4674                MsiAddrIn.u64 = GCPhysIn;
     4675
     4676                MSI_DATA_T MsiDataIn;
     4677                MsiDataIn.u32 = uDataIn;
     4678
     4679                PMSI_ADDR_T pMsiAddrOut = (PMSI_ADDR_T)pGCPhysOut;
     4680                PMSI_DATA_T pMsiDataOut = (PMSI_DATA_T)puDataOut;
     4681
     4682                /* Preserve all bits from the source MSI address that don't map 1:1 from the IRTE. */
     4683                pMsiAddrOut->u64 = GCPhysIn;
     4684                pMsiAddrOut->n.u1DestMode  = Irte.n.u1DestMode;
     4685                pMsiAddrOut->n.u8DestId    = Irte.n.u8Dest;
     4686
     4687                /* Preserve all bits from the source MSI data that don't map 1:1 from the IRTE. */
     4688                pMsiDataOut->u32 = uDataIn;
     4689                pMsiDataOut->n.u8Vector = Irte.n.u8Vector;
     4690                pMsiDataOut->n.u3DeliveryMode = Irte.n.u3IntrType;
     4691
     4692                return VINF_SUCCESS;
     4693            }
     4694            /** @todo IOMMU: Raise IOPF. */
     4695            return VERR_NOT_IMPLEMENTED;
     4696
     4697        }
     4698        /** @todo IOMMU: Raise IOPF. */
    46694699        return VERR_NOT_IMPLEMENTED;
    46704700    }
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