VirtualBox

Changeset 88310 in vbox for trunk


Ignore:
Timestamp:
Mar 29, 2021 12:52:12 PM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 WIP.

Location:
trunk/src/VBox/Devices
Files:
1 added
2 edited

Legend:

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

    r88260 r88310  
    2121*********************************************************************************************************************************/
    2222#define LOG_GROUP LOG_GROUP_DEV_IOMMU
    23 #include <VBox/vmm/pdmdev.h>
    24 #include <VBox/iommu-intel.h>
     23#include "VBoxDD.h"
     24#include "DevIommuIntel.h"
    2525
    2626#include <iprt/string.h>
    27 
    28 #include "VBoxDD.h"
    2927
    3028
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r88281 r88310  
    4747#ifdef VBOX_WITH_IOMMU_AMD
    4848# include "../Bus/DevIommuAmd.h"
     49#endif
     50#ifdef VBOX_WITH_IOMMU_INTEL
     51# include "../Bus/DevIommuIntel.h"
    4952#endif
    5053
     
    863866    ACPIDMAR            Dmar;
    864867    ACPIDRHD            Drhd;
     868    /* ACPIDMARDEVSCOPE    DevScope; */
    865869} ACPITBLDMAR;
    866870#endif  /* VBOX_WITH_IOMMU_INTEL */
     
    33573361    acpiR3PhysCopy(pDevIns, addr, (const uint8_t *)&Ivrs, sizeof(Ivrs));
    33583362}
    3359 #endif
     3363#endif  /* VBOX_WITH_IOMMU_AMD */
    33603364
    33613365
     
    33693373    RT_ZERO(VtdTable);
    33703374
    3371     /* VT-d/DMAR header. */
     3375    /* VT-d Table. */
    33723376    acpiR3PrepareHeader(pThis, &VtdTable.Dmar.Hdr, "DMAR", sizeof(ACPITBLVTD), ACPI_DMAR_REVISION);
    33733377
    3374     /** @todo Populate rest of DMAR table. */
     3378    /* DMAR. */
     3379    uint8_t cPhysAddrBits;
     3380    uint8_t cLinearAddrBits;
     3381    PDMDevHlpCpuGetGuestAddrWidths(pDevIns, &cPhysAddrBits, &cLinearAddrBits);
     3382    Assert(cPhysAddrBits > 0); NOREF(cLinearAddrBits);
     3383    VtdTable.Dmar.uHostAddrWidth = cPhysAddrBits - 1;
     3384    VtdTable.Dmar.fFlags         = VTD_ACPI_DMAR_FLAGS;
     3385
     3386    /* DRHD. */
     3387    VtdTable.Drhd.cbLength     = sizeof(ACPIDRHD) /* + sizeof(VtdTable.DevScope) */;
     3388    VtdTable.Drhd.fFlags       = ACPI_DRHD_F_INCLUDE_PCI_ALL;
     3389    VtdTable.Drhd.uRegBaseAddr = VTD_MMIO_BASE_ADDR;
    33753390
    33763391    /* Finally, compute checksum. */
     
    33803395    acpiR3PhysCopy(pDevIns, addr, (const uint8_t *)&VtdTable, sizeof(VtdTable));
    33813396}
    3382 #endif
     3397#endif  /* VBOX_WITH_IOMMU_INTEL */
    33833398
    33843399
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