VirtualBox

Changeset 84808 in vbox for trunk


Ignore:
Timestamp:
Jun 12, 2020 6:49:01 AM (5 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Fixes.

File:
1 edited

Legend:

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

    r84677 r84808  
    41264126
    41274127    /* Check permissions bits of the root page table. */
    4128     uint8_t const fPtePerm  = (pDte->au64[0] >> IOMMU_IO_PERM_SHIFT) & IOMMU_IO_PERM_MASK;
    4129     if ((fAccess & fPtePerm) == fAccess)
     4128    uint8_t const fRootPtePerm  = (pDte->au64[0] >> IOMMU_IO_PERM_SHIFT) & IOMMU_IO_PERM_MASK;
     4129    if ((fAccess & fRootPtePerm) == fAccess)
    41304130    { /* likely */ }
    41314131    else
    41324132    {
    4133         Log((IOMMU_LOG_PFX ": Permission denied (fAccess=%#x fPtePerm=%#x) -> IOPF", fAccess, fPtePerm));
     4133        Log((IOMMU_LOG_PFX ": Permission denied (fAccess=%#x fRootPtePerm=%#x) -> IOPF", fAccess, fRootPtePerm));
    41344134        EVT_IO_PAGE_FAULT_T EvtIoPageFault;
    41354135        iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, true /* fPresent */, false /* fRsvdNotZero */,
     
    41894189        else
    41904190        {
    4191             Log((IOMMU_LOG_PFX ": Page table entry not present -> IOPF", fAccess, fPtePerm));
     4191            Log((IOMMU_LOG_PFX ": Page table entry not present -> IOPF"));
    41924192            EVT_IO_PAGE_FAULT_T EvtIoPageFault;
    41934193            iommuAmdInitIoPageFaultEvent(uDevId, pDte->n.u16DomainId, uIova, false /* fPresent */, false /* fRsvdNotZero */,
     
    45144514    /* Ensure the IRTE offset is within the specified table size. */
    45154515    Assert(pDte->n.u4IntrTableLength < 12);
    4516     if (offIrte + sizeof(IRTE_T) <= (1 << pDte->n.u4IntrTableLength) << IOMMU_IRTE_SIZE_SHIFT)
     4516    if (offIrte + sizeof(IRTE_T) <= (1U << pDte->n.u4IntrTableLength) << IOMMU_IRTE_SIZE_SHIFT)
    45174517    { /* likely */ }
    45184518    else
     
    48794879                }
    48804880
    4881                 /* If command completion interrupt is requested, raise an interrupt. */
     4881                IOMMU_LOCK(pDevIns);
     4882
     4883                /* Indicate that this command has completed. */
     4884                ASMAtomicOrU64(&pThis->Status.u64, IOMMU_STATUS_COMPLETION_WAIT_INTR);
     4885
     4886                /* If the command requests an interrupt and completion wait interrupts are enabled, raise it. */
    48824887                if (pCmdComWait->n.u1Interrupt)
    48834888                {
    4884                     IOMMU_LOCK(pDevIns);
    48854889                    IOMMU_CTRL_T const Ctrl = iommuAmdGetCtrl(pThis);
    48864890                    if (Ctrl.n.u1CompWaitIntrEn)
    4887                     {
    4888                         /* Indicate that this command completed. */
    4889                         ASMAtomicOrU64(&pThis->Status.u64, IOMMU_STATUS_COMPLETION_WAIT_INTR);
    4890 
    4891                         /* Check and signal an interrupt if software wants to receive one when this command completes. */
    4892                         IOMMU_CTRL_T const Ctrl = iommuAmdGetCtrl(pThis);
    4893                         if (Ctrl.n.u1CompWaitIntrEn)
    4894                             iommuAmdRaiseMsiInterrupt(pDevIns);
    4895                     }
    4896                     IOMMU_UNLOCK(pDevIns);
     4891                        iommuAmdRaiseMsiInterrupt(pDevIns);
    48974892                }
     4893
     4894                IOMMU_UNLOCK(pDevIns);
    48984895                return VINF_SUCCESS;
    48994896            }
     
    60696066    pThis->ExtFeat.n.u1HwErrorSup            = 1;
    60706067    pThis->ExtFeat.n.u1PerfCounterSup        = 0;
    6071     pThis->ExtFeat.n.u2HostAddrTranslateSize = IOMMU_MAX_HOST_PT_LEVEL;
     6068    AssertCompile((IOMMU_MAX_HOST_PT_LEVEL & 0x3) < 3);
     6069    pThis->ExtFeat.n.u2HostAddrTranslateSize = (IOMMU_MAX_HOST_PT_LEVEL & 0x3);
    60726070    pThis->ExtFeat.n.u2GstAddrTranslateSize  = 0;   /* Requires GstTranslateSup. */
    60736071    pThis->ExtFeat.n.u2GstCr3RootTblLevel    = 0;   /* Requires GstTranslateSup. */
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