VirtualBox

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


Ignore:
Timestamp:
Apr 8, 2021 8:26:26 AM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 WIP.

File:
1 edited

Legend:

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

    r88406 r88407  
    841841
    842842/**
    843  * Initializes read-write registers in the DMAR unit.
     843 * Initializes all registers in the DMAR unit.
    844844 *
    845845 * @param   pDevIns     The IOMMU device instance.
    846846 */
    847 static void dmarR3RegsInitMutable(PPDMDEVINS pDevIns)
    848 {
    849     NOREF(pDevIns);
     847static void dmarR3RegsInit(PPDMDEVINS pDevIns)
     848{
     849    PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR);
     850    RT_ZERO(pThis->abRegs0);
     851    RT_ZERO(pThis->abRegs1);
     852
     853    /* Initialize immutable registers prior to other registers. */
     854    dmarR3RegsInitImmutable(pDevIns);
     855
     856    /* FECTL_REG */
     857    {
     858        uint32_t const uReg = RT_BF_MAKE(VTD_BF_FECTL_REG_IM, 1);
     859        dmarRegWriteRaw32(pThis, VTD_MMIO_OFF_FECTL_REG, uReg);
     860    }
     861    /* ICETL_REG */
     862    {
     863        uint32_t const uReg = RT_BF_MAKE(VTD_BF_IECTL_REG_IM, 1);
     864        dmarRegWriteRaw32(pThis, VTD_MMIO_OFF_IECTL_REG, uReg);
     865    }
     866
     867#ifdef VBOX_STRICT
     868    uint64_t const fExtCap = dmarRegRead64(pThis, VTD_MMIO_OFF_ECAP_REG);
     869    Assert(!RT_BF_GET(fExtCap, VTD_BF_ECAP_REG_PRS));    /* PECTL_REG - Reserved if don't support PRS. */
     870    Assert(!RT_BF_GET(fExtCap, VTD_BF_ECAP_REG_MTS));    /* MTRRCAP_REG - Reserved if we don't support MTS. */
     871#endif
    850872}
    851873
     
    9871009     * Initialize all DMAR registers (order is important).
    9881010     */
    989     dmarR3RegsInitImmutable(pDevIns);
    990     dmarR3RegsInitMutable(pDevIns);
     1011    dmarR3RegsInit(pDevIns);
    9911012
    9921013    LogRel(("%s: Capabilities=%#RX64 Extended-Capabilities=%#RX64\n", DMAR_LOG_PFX, dmarRegRead64(pThis, VTD_MMIO_OFF_CAP_REG),
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