VirtualBox

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


Ignore:
Timestamp:
Apr 29, 2021 5:24:02 AM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 Off-by-one fix and other nits.

File:
1 edited

Legend:

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

    r88744 r88764  
    15081508                 *        don't think it needs to be checked/handled here? */
    15091509
     1510                /*
     1511                 * Get the current queue size.
     1512                 */
    15101513                uint64_t const uIqaReg     = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_IQA_REG);
    15111514                uint8_t const  cQueuePages = 1 << (uIqaReg & VTD_BF_IQA_REG_QS_MASK);
     
    15191522                Assert(fDw != VTD_IQA_REG_DW_256_BIT || !(offQueueTail & RT_BIT(4)));
    15201523                Assert(fDw != VTD_IQA_REG_DW_256_BIT || !(offQueueHead & RT_BIT(4)));
    1521 
    1522                 if (offQueueTail <= cbQueue)
     1524                Assert(offQueueHead < cbQueue);
     1525
     1526                /*
     1527                 * Read the requests in the queue from guest memory into our buffer.
     1528                 */
     1529                if (offQueueTail < cbQueue)
    15231530                {
    15241531                    RTGCPHYS const GCPhysRequests = (uIqaReg & VTD_BF_IQA_REG_IQA_MASK) + offQueueHead;
     
    15591566                        dmarRegWriteRaw64(pThis, VTD_MMIO_OFF_IQH_REG, offQueueTail);
    15601567
    1561                         /* Process all requests (in FIFO order) after more paranoid checks. */
     1568                        /* Process all requests (in FIFO order). */
    15621569                        Assert(cbRequests <= cbQueue);
    15631570                        dmarR3InvQueueProcessRequests(pDevIns, pvRequests, cbRequests, fDw);
     
    16171624     * temporaries and release the lock ASAP.
    16181625     *
    1619      * Order of register read and outputting according to
     1626     * Order of register being read and outputted is in according with the
    16201627     * Intel VT-d spec. 10.4 "Register Descriptions" for no particular reason.
    16211628     */
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