VirtualBox

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


Ignore:
Timestamp:
Apr 16, 2020 9:37:02 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137224
Message:

AMD IOMMU: bugref:9654 Bits.

File:
1 edited

Legend:

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

    r83712 r83714  
    20722072
    20732073
    2074 DECLINLINE(IOMMU_STATUS_T) iommuAmdGetStatus(PCIOMMU pThis)
     2074DECL_FORCE_INLINE(IOMMU_STATUS_T) iommuAmdGetStatus(PCIOMMU pThis)
    20752075{
    20762076    IOMMU_STATUS_T Status;
     
    21292129    pThis->CmdBufBaseAddr.u64 = u64Value & IOMMU_CMD_BUF_BAR_VALID_MASK;
    21302130    iommuAmdCheckBufferLength(pThis->CmdBufBaseAddr.n.u4CmdLen, __PRETTY_FUNCTION__);
     2131
     2132    /*
     2133     * While this is not explicitly specified like the event log base address register,
     2134     * the AMD spec. does specify "CmdBufRun must be 0b to modify the command buffer registers properly".
     2135     * Inconsistent specs :/
     2136     */
     2137    IOMMU_STATUS_T const Status = iommuAmdGetStatus(pThis);
     2138    if (Status.n.u1CmdBufRunning)
     2139    {
     2140        Log((IOMMU_LOG_PFX ": Setting CmdBufBar (%#RX64) when command buffer is running -> Ignored\n", u64Value));
     2141        return VINF_SUCCESS;
     2142    }
     2143
     2144    /*
     2145     * Writing the command log base address, clears the command buffer head and tail pointers.
     2146     * See AMD spec. 2.4 "Commands".
     2147     */
     2148    pThis->CmdBufHeadPtr.u64 = 0;
     2149    pThis->CmdBufTailPtr.u64 = 0;
     2150
    21312151    return VINF_SUCCESS;
    21322152}
     
    35393559    MsiReg.iMsiCapOffset  = IOMMU_PCI_OFF_MSI_CAP_HDR;
    35403560    MsiReg.iMsiNextOffset = 0; /* IOMMU_PCI_OFF_MSI_MAP_CAP_HDR */
     3561    MsiReg.fMsi64bit      = 1; /* 64-bit addressing support is mandatory; See AMD spec. 2.8 "IOMMU Interrupt Support". */
    35413562    rc = PDMDevHlpPCIRegisterMsi(pDevIns, &MsiReg);
    35423563    AssertRCReturn(rc, rc);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette