VirtualBox

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


Ignore:
Timestamp:
Feb 1, 2021 9:28:01 AM (4 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Nits.

File:
1 edited

Legend:

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

    r87483 r87496  
    25662566    {
    25672567        /* Check if device access to addresses in the exclusion range can be forwarded untranslated. */
    2568         if (    pThis->ExclRangeBaseAddr.n.u1AllowAll
    2569             ||  pDte->n.u1AllowExclusion)
     2568        if (   pThis->ExclRangeBaseAddr.n.u1AllowAll
     2569            || pDte->n.u1AllowExclusion)
    25702570            return true;
    25712571    }
     
    37873787     * and freeing buffers while processing commands.
    37883788     */
    3789     size_t cbMaxCmds = sizeof(CMD_GENERIC_T) * iommuAmdGetBufMaxEntries(15);
    3790     void *pvCmds = RTMemAllocZ(cbMaxCmds);
    3791     AssertReturn(pvCmds, VERR_NO_MEMORY);
     3789    size_t const cbMaxCmdBuf = sizeof(CMD_GENERIC_T) * iommuAmdGetBufMaxEntries(15);
     3790    void *pvCmds = RTMemAllocZ(cbMaxCmdBuf);
     3791    AssertPtrReturn(pvCmds, VERR_NO_MEMORY);
    37923792
    37933793    while (pThread->enmState == PDMTHREADSTATE_RUNNING)
     
    38173817        /** @todo r=ramshankar: We currently copy all commands from guest memory into a
    38183818         *        temporary host buffer before processing them as a batch. If we want to
    3819          *        save on host memory a bit we could, once PGM has the necessary APIs, lock
    3820          *        the page mappings and access them directly. */
     3819         *        save on host memory a bit, we could (once PGM has the necessary APIs)
     3820         *        lock the page mappings page mappings and access them directly. */
    38213821        IOMMU_LOCK(pDevIns);
    38223822
     
    38323832            Assert(!(offHead & ~IOMMU_CMD_BUF_HEAD_PTR_VALID_MASK));
    38333833            Assert(offHead < cbCmdBuf);
    3834             Assert(cbCmdBuf <= cbMaxCmds);
     3834            Assert(cbCmdBuf <= cbMaxCmdBuf);
    38353835
    38363836            if (offHead != offTail)
     
    38693869                            break;
    38703870                        }
     3871
     3872                        /* Move to the next command in the circular buffer. */
    38713873                        offHead = (offHead + sizeof(CMD_GENERIC_T)) % cbCmdBuf;
    38723874                    } while (offHead != offTail);
     
    38783880                    iommuAmdCmdHwErrorEventInit(GCPhysCmdBufBase, &EvtCmdHwErr);
    38793881                    iommuAmdCmdHwErrorEventRaise(pDevIns, &EvtCmdHwErr);
     3882
    38803883                    IOMMU_UNLOCK(pDevIns);
    38813884                }
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