VirtualBox

Ignore:
Timestamp:
Apr 8, 2020 5:58:15 AM (5 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Bits

File:
1 edited

Legend:

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

    r83599 r83615  
    27802780     * Validate and read the configuration.
    27812781     */
    2782     PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Device|Function|MmioBase", "");
    2783 
    2784     uint64_t u64MmioBase;
    2785     rc = pHlp->pfnCFGMQueryU64Def(pCfg, "MmioBase", &u64MmioBase, 0);
    2786     if (RT_FAILURE(rc))
    2787         return PDMDEV_SET_ERROR(pDevIns, rc, N_("IOMMU: Failed to query \"MmioBase\""));
    2788     /* Must be 16KB aligned when we don't support IOMMU performance counters.  */
    2789     if (u64MmioBase & 0x3fff)
    2790         return PDMDEV_SET_ERROR(pDevIns, rc, N_("IOMMU: \"MmioBase\" must be 16 KB aligned"));
    2791     /** @todo IOMMU: Ensure u64MmioBase isn't 0. */
     2782    PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Device|Function", "");
    27922783
    27932784    uint8_t uPciDevice;
     
    28482839
    28492840    /* Base Address Low Register. */
    2850     PDMPciDevSetDWord(pPciDev, offBaseAddrLo,
    2851                         RT_BF_MAKE(IOMMU_BF_BASEADDR_LO_ENABLE, 0x1)                    /* RW1S - Enable */
    2852                       | RT_BF_MAKE(IOMMU_BF_BASEADDR_LO_ADDR,   (u64MmioBase >> 14)));  /* RO - Base address (Lo) */
     2841    PDMPciDevSetDWord(pPciDev, offBaseAddrLo, 0x0);   /* RW - Base address (Lo) and enable bit. */
    28532842
    28542843    /* Base Address High Register. */
    2855     PDMPciDevSetDWord(pPciDev, offBaseAddrHi, RT_HI_U32(u64MmioBase));      /* RO - Base address (Hi) */
     2844    PDMPciDevSetDWord(pPciDev, offBaseAddrHi, 0x0);   /* RW - Base address (Hi) */
    28562845
    28572846    /* IOMMU Range Register. */
    2858     PDMPciDevSetDWord(pPciDev, offRange, 0x0);                              /* RO - Range register. */
     2847    PDMPciDevSetDWord(pPciDev, offRange, 0x0);        /* RO - Range register. */
    28592848
    28602849    /* Misc. Information Register 0. */
     
    29202909
    29212910    /*
    2922      * Map MMIO registers.
     2911     * Register the MMIO region.
    29232912     */
    2924     rc = PDMDevHlpMmioCreateAndMap(pDevIns, u64MmioBase, IOMMU_MMIO_REGION_SIZE, iommuAmdMmioWrite, iommuAmdMmioRead,
    2925                                    IOMMMIO_FLAGS_READ_DWORD_QWORD | IOMMMIO_FLAGS_WRITE_DWORD_QWORD_READ_MISSING,
    2926                                    "IOMMU-AMD", &pThis->hMmio);
     2913    rc = PDMDevHlpMmioCreate(pDevIns, IOMMU_MMIO_REGION_SIZE, pPciDev, 0 /* iPciRegion */, iommuAmdMmioWrite, iommuAmdMmioRead,
     2914                             NULL /* pvUser */, IOMMMIO_FLAGS_READ_DWORD_QWORD | IOMMMIO_FLAGS_WRITE_DWORD_QWORD_ZEROED,
     2915                             "AMD-IOMMU", &pThis->hMmio);
    29272916    AssertRCReturn(rc, rc);
    29282917
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