VirtualBox

Changeset 88744 in vbox


Ignore:
Timestamp:
Apr 28, 2021 11:59:02 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144066
Message:

Intel IOMMU: Queued Invalidation WIP. The descriptor reads seem to work now, have to implement handling of the supported descriptor types next.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/iommu-intel.h

    r88704 r88744  
    15171517    kIqei_InfoNotAvailable = 0,
    15181518    kIqei_InvalidTailPointer,
    1519     kIqei_FetchDescriptorFailed,
     1519    kIqei_FetchDescriptorError,
    15201520    kIqei_InvalidDescriptorType,
    15211521    kIqei_RsvdFieldViolation,
     
    18191819/** RW: Read/write mask. */
    18201820#define VTD_VCRSP_REG_RW_MASK                                   UINT64_C(0)
     1821/** @} */
     1822
     1823
     1824/** @name Generic Invalidation Descriptor.
     1825 *  These are fields common to EVERY invalidation descriptor.
     1826 * @{ */
     1827/** Type (Lo). */
     1828#define VTD_BF_0_GENERIC_INV_DSC_TYPE_LO_SHIFT                  0
     1829#define VTD_BF_0_GENERIC_INV_DSC_TYPE_LO_MASK                   UINT64_C(0x000000000000000f)
     1830/** R: Reserved (bits 8:4). */
     1831#define VTD_BF_0_GENERIC_INV_DSC_RSVD_8_4_SHIFT                 4
     1832#define VTD_BF_0_GENERIC_INV_DSC_RSVD_8_4_MASK                  UINT64_C(0x00000000000001f0)
     1833/** Type (Hi). */
     1834#define VTD_BF_0_GENERIC_INV_DSC_TYPE_HI_SHIFT                  9
     1835#define VTD_BF_0_GENERIC_INV_DSC_TYPE_HI_MASK                   UINT64_C(0x0000000000000e00)
     1836/** R: Reserved (bits 63:12). */
     1837#define VTD_BF_0_GENERIC_INV_DSC_RSVD_63_12_SHIFT               12
     1838#define VTD_BF_0_GENERIC_INV_DSC_RSVD_63_12_MASK                UINT64_C(0xfffffffffffff000)
     1839RT_BF_ASSERT_COMPILE_CHECKS(VTD_BF_0_GENERIC_INV_DSC_, UINT64_C(0), UINT64_MAX,
     1840                            (TYPE_LO, RSVD_8_4, TYPE_HI, RSVD_63_12));
     1841
     1842/** GENERIC_INV_DSC: Type. */
     1843#define VTD_GENERIC_INV_DSC_GET_TYPE(a)                         ((((a) & VTD_BF_0_GENERIC_INV_DSC_TYPE_HI_MASK) >> 5) \
     1844                                                                 | ((a) & VTD_BF_0_GENERIC_INV_DSC_TYPE_LO_MASK))
    18211845/** @} */
    18221846
     
    21552179
    21562180
     2181/** @name Invalidation descriptor types.
     2182 * In accordance with the Intel spec.
     2183 * @{ */
     2184#define VTD_CC_INV_DSC_TYPE                                     1
     2185#define VTD_IOTLB_INV_DSC_TYPE                                  2
     2186#define VTD_DEV_TLB_INV_DSC_TYPE                                3
     2187#define VTD_IEC_INV_DSC_TYPE                                    4
     2188#define VTD_INV_WAIT_DSC_TYPE                                   5
     2189#define VTD_P_IOTLB_INV_DSC_TYPE                                6
     2190#define VTD_PC_INV_DSC_TYPE                                     7
     2191#define VTD_P_DEV_TLB_INV_DSC_TYPE                              8
     2192/** @} */
     2193
     2194
    21572195/** @name ACPI_DMAR_F_XXX: DMA Remapping Reporting Structure Flags.
    21582196 * In accordance with the Intel spec.
  • trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp

    r88705 r88744  
    146146    kDmarDiag_IqtReg_Qt_Invalid,
    147147    kDmarDiag_IqaReg_Dw_Invalid,
    148     kDmarDiag_IqaReg_Dsc_Fetch_Failed,
     148    kDmarDiag_IqaReg_Dsc_Fetch_Error,
     149    kDmarDiag_Iqei_Dsc_Type_Invalid,
    149150    kDmarDiag_CcmdReg_Ttm_Invalid,
    150151    kDmarDiag_CcmdReg_Qi_Enabled,
    151152    kDmarDiag_CcmdReg_NotSupported,
    152     /* Last member for determining array index limit. */
    153     kDmarDiag_End
     153    /* Member for determining array index limit. */
     154    kDmarDiag_End,
     155    /* Type size hack. */
     156    kDmarDiag_32Bit_Hack = 0x7fffffff
    154157} DMARDIAG;
    155158AssertCompileSize(DMARDIAG, 4);
    156159
    157 /** DMAR diagnostic enum description expansion. */
    158 #define DMARDIAG_DESC(a_Def, a_Desc)                #a_Def " - " #a_Desc
     160/** DMAR diagnostic enum description expansion.
     161 * The below construct ensures typos in the input to this macro are caught
     162 * during compile time. */
     163#define DMARDIAG_DESC(a_Name)        RT_CONCAT(kDmarDiag_, a_Name) < kDmarDiag_End ? RT_STR(a_Name) : "Ignored"
    159164
    160165/** DMAR diagnostics description. */
    161166static const char *const g_apszDmarDiagDesc[] =
    162167{
    163     DMARDIAG_DESC(kNone                            ,    "None"                  ),
    164     DMARDIAG_DESC(kDmarDiag_IqtReg_Qt_NotAligned   ,    "IqtReg_Qt_NotAligned"  ),
    165     DMARDIAG_DESC(kDmarDiag_IqtReg_Qt_Invalid      ,    "IqtReg_Qt_Invalid"     ),
    166     DMARDIAG_DESC(kDmarDiag_IqaReg_Dw_Invalid      ,    "IqaReg_Dw_Invalid"     ),
    167     DMARDIAG_DESC(kDmarDiag_IqaReg_Dsc_Fetch_Failed,    "IqaReg_Dsc_Fetch_Failed"),
    168     DMARDIAG_DESC(kDmarDiag_CcmdReg_Ttm_Invalid    ,    "CcmdReg_Ttm_Invalid"   ),
    169     DMARDIAG_DESC(kDmarDiag_CcmdReg_Qi_Enabled     ,    "CcmdReg_Qi_Enabled"    ),
    170     DMARDIAG_DESC(kDmarDiag_CcmdReg_NotSupported   ,    "CcmdReg_NotSupported"  )
     168    DMARDIAG_DESC(None                  ),
     169    DMARDIAG_DESC(IqtReg_Qt_NotAligned  ),
     170    DMARDIAG_DESC(IqtReg_Qt_Invalid     ),
     171    DMARDIAG_DESC(IqaReg_Dw_Invalid     ),
     172    DMARDIAG_DESC(IqaReg_Dsc_Fetch_Error),
     173    DMARDIAG_DESC(Iqei_Dsc_Type_Invalid ),
     174    DMARDIAG_DESC(CcmdReg_Ttm_Invalid   ),
     175    DMARDIAG_DESC(CcmdReg_Qi_Enabled    ),
     176    DMARDIAG_DESC(CcmdReg_NotSupported  )
    171177    /* kDmarDiag_End */
    172178};
     
    188194    /** Registers (group 1). */
    189195    uint8_t                     abRegs1[DMAR_MMIO_GROUP_1_SIZE];
     196
     197    /** @name Lazily activated registers.
     198     * These are the active values for lazily activated registers. Software is free to
     199     * modify the actual register values while remapping/translation is enabled but they
     200     * take effect only when explicitly signaled by software, hence we need to hold the
     201     * active values separately.
     202     * @{ */
     203    /** Currently active IRTA_REG. */
     204    uint64_t                    uIrtaReg;
     205    /** Currently active RTADDR_REG. */
     206    uint64_t                    uRtaReg;
     207    /** @} */
    190208
    191209    /** @name Register copies for a tiny bit faster and more convenient access.
     
    661679 * Reads a 32-bit register with exactly the value it contains.
    662680 *
     681 * @returns The raw register value.
    663682 * @param   pThis   The shared DMAR device state.
    664683 * @param   offReg  The MMIO offset of the register.
     
    676695 * Reads a 64-bit register with exactly the value it contains.
    677696 *
     697 * @returns The raw register value.
    678698 * @param   pThis   The shared DMAR device state.
    679699 * @param   offReg  The MMIO offset of the register.
    680700 */
    681 static uint32_t dmarRegReadRaw64(PCDMAR pThis, uint16_t offReg)
     701static uint64_t dmarRegReadRaw64(PCDMAR pThis, uint16_t offReg)
    682702{
    683703    uint8_t idxGroup;
     
    793813 * Reads a 32-bit register as it would be when read by software.
    794814 *
    795  * @returns The 32-bit register value.
     815 * @returns The register value.
    796816 * @param   pThis   The shared DMAR device state.
    797817 * @param   offReg  The MMIO offset of the register.
     
    806826 * Reads a 64-bit register as it would be when read by software.
    807827 *
    808  * @returns The 64-bit register value.
     828 * @returns The register value.
    809829 * @param   pThis   The shared DMAR device state.
    810830 * @param   offReg  The MMIO offset of the register.
     
    10771097    uint32_t const uGstsReg = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_GSTS_REG);
    10781098    uint32_t const fChanged = uGstsReg ^ uGcmdReg;
    1079 
    1080     Assert(pThis->fExtCap & VTD_BF_ECAP_REG_QI_MASK);
    1081     if (fChanged & VTD_BF_GCMD_REG_QIE_MASK)
     1099    uint64_t const fExtCap  = pThis->fExtCap;
     1100
     1101    /*
     1102     * Queued-invalidation.
     1103     */
     1104    if (   (fExtCap & VTD_BF_ECAP_REG_QI_MASK)
     1105        && (fChanged & VTD_BF_GCMD_REG_QIE_MASK))
    10821106    {
    10831107        if (uGcmdReg & VTD_BF_GCMD_REG_QIE_MASK)
     
    10931117            dmarRegWriteRaw32(pThis, VTD_MMIO_OFF_IQH_REG, 0);
    10941118        }
     1119    }
     1120
     1121    /*
     1122     * Set interrupt remapping table pointer.
     1123     */
     1124    if (   (fExtCap & VTD_BF_ECAP_REG_IR_MASK)
     1125        && (uGcmdReg & VTD_BF_GCMD_REG_SIRTP_MASK))
     1126    {
     1127        pThis->uIrtaReg = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_IRTA_REG);
     1128        dmarRegChangeRaw32(pThis, VTD_MMIO_OFF_GSTS_REG, UINT32_MAX /* fAndMask */, VTD_BF_GSTS_REG_IRTPS_MASK /* fOrMask */);
    10951129    }
    10961130
     
    13291363
    13301364        DMAR_UNLOCK(pDevIns, pThisCC);
    1331         LogFlowFunc(("offReg=%#x rc=%Rrc\n", offReg, VBOXSTRICTRC_VAL(rcStrict)));
     1365        LogFlowFunc(("offReg=%#x uRegWritten=%#RX64 rc=%Rrc\n", offReg, uRegWritten, VBOXSTRICTRC_VAL(rcStrict)));
    13321366        return rcStrict;
    13331367    }
     
    13761410#ifdef IN_RING3
    13771411/**
     1412 * Process requests in the invalidation queue.
     1413 *
     1414 * @param   pDevIns     The IOMMU device instance.
     1415 * @param   pvRequests  The requests data.
     1416 * @param   cbRequests  The size of all requests (in bytes).
     1417 * @param   fDw         The descriptor width (VTD_IQA_REG_DW_128_BIT or
     1418 *                      VTD_IQA_REG_DW_256_BIT).
     1419 */
     1420static void dmarR3InvQueueProcessRequests(PPDMDEVINS pDevIns, void const *pvRequests, uint32_t cbRequests, uint8_t fDw)
     1421{
     1422    uint8_t const cbDsc = fDw == VTD_IQA_REG_DW_256_BIT ? 32 : 16;
     1423    for (uint32_t offDsc = 0; offDsc < cbRequests; offDsc += cbDsc)
     1424    {
     1425        uint64_t const *puDscQwords = (uint64_t const *)((uintptr_t)pvRequests + offDsc);
     1426        uint8_t const   fDscType    = VTD_GENERIC_INV_DSC_GET_TYPE(puDscQwords[0]);
     1427        switch (fDscType)
     1428        {
     1429            case VTD_CC_INV_DSC_TYPE:           LogRelMax(32, ("%s: CC\n", DMAR_LOG_PFX));              break;
     1430            case VTD_IOTLB_INV_DSC_TYPE:        LogRelMax(32, ("%s: IOTLB\n", DMAR_LOG_PFX));           break;
     1431            case VTD_DEV_TLB_INV_DSC_TYPE:      LogRelMax(32, ("%s: DEV_TLB\n", DMAR_LOG_PFX));         break;
     1432            case VTD_IEC_INV_DSC_TYPE:          LogRelMax(32, ("%s: IEC_INV\n", DMAR_LOG_PFX));         break;
     1433            case VTD_INV_WAIT_DSC_TYPE:         LogRelMax(32, ("%s: INV_WAIT\n", DMAR_LOG_PFX));        break;
     1434            case VTD_P_IOTLB_INV_DSC_TYPE:      LogRelMax(32, ("%s: P_IOTLB\n", DMAR_LOG_PFX));         break;
     1435            case VTD_PC_INV_DSC_TYPE:           LogRelMax(32, ("%s: PC_INV\n", DMAR_LOG_PFX));          break;
     1436            case VTD_P_DEV_TLB_INV_DSC_TYPE:    LogRelMax(32, ("%s: P_DEVL_TLB\n", DMAR_LOG_PFX));      break;
     1437            {
     1438                break;
     1439            }
     1440
     1441            default:
     1442            {
     1443                LogFunc(("Invalid descriptor type: %#x\n", fDscType));
     1444                dmarIqeFaultRecord(pDevIns, kDmarDiag_Iqei_Dsc_Type_Invalid, kIqei_InvalidDescriptorType);
     1445                return;
     1446            }
     1447        }
     1448    }
     1449}
     1450
     1451
     1452
     1453/**
    13781454 * The invalidation-queue thread.
    13791455 *
     
    13901466        return VINF_SUCCESS;
    13911467
    1392     uint8_t const  cMaxPages = 1 << VTD_BF_IQA_REG_QS_MASK;
    1393     size_t const   cbMaxQs   = cMaxPages << X86_PAGE_SHIFT;
    1394     void *pvQueue = RTMemAllocZ(cbMaxQs);
    1395     AssertPtrReturn(pvQueue, VERR_NO_MEMORY);
     1468    /*
     1469     * Pre-allocate the maximum size of the invalidation queue allowed by the spec.
     1470     * This prevents trashing the heap as well as deal with out-of-memory situations
     1471     * up-front while starting the VM. It also simplifies the code from having to
     1472     * dynamically grow/shrink the allocation based on how software sizes the queue.
     1473     * Guests normally don't alter the queue size all the time, but that's not an
     1474     * assumption we can make.
     1475     */
     1476    uint8_t const cMaxPages = 1 << VTD_BF_IQA_REG_QS_MASK;
     1477    size_t const  cbMaxQs   = cMaxPages << X86_PAGE_SHIFT;
     1478    void *pvRequests = RTMemAllocZ(cbMaxQs);
     1479    AssertPtrReturn(pvRequests, VERR_NO_MEMORY);
    13961480
    13971481    while (pThread->enmState == PDMTHREADSTATE_RUNNING)
     
    14211505            if (!fIsEmpty)
    14221506            {
    1423                 uint64_t const uIqaReg     = dmarRegRead64(pThis, VTD_MMIO_OFF_IQA_REG);
     1507                /** @todo Handle RTADDR_REG MMIO write first, for handling kIqei_InvalidTtm. I
     1508                 *        don't think it needs to be checked/handled here? */
     1509
     1510                uint64_t const uIqaReg     = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_IQA_REG);
    14241511                uint8_t const  cQueuePages = 1 << (uIqaReg & VTD_BF_IQA_REG_QS_MASK);
    14251512                uint32_t const cbQueue     = cQueuePages << X86_PAGE_SHIFT;
     1513                uint8_t const  fDw         = RT_BF_GET(uIqaReg, VTD_BF_IQA_REG_DW);
     1514
     1515                /* Paranoia. */
     1516                Assert(cbQueue <= cbMaxQs);
     1517                Assert(!(offQueueTail & ~VTD_IQT_REG_RW_MASK));
     1518                Assert(!(offQueueHead & ~VTD_IQH_REG_RW_MASK));
     1519                Assert(fDw != VTD_IQA_REG_DW_256_BIT || !(offQueueTail & RT_BIT(4)));
     1520                Assert(fDw != VTD_IQA_REG_DW_256_BIT || !(offQueueHead & RT_BIT(4)));
     1521
    14261522                if (offQueueTail <= cbQueue)
    14271523                {
    1428                     Assert(offQueueTail > offQueueHead);
    1429                     uint32_t const cbDescriptors   = offQueueTail - offQueueHead;
    1430                     RTGCPHYS const GCPhysQueueBase = uIqaReg & VTD_BF_IQA_REG_IQA_MASK;
    1431 
     1524                    RTGCPHYS const GCPhysRequests = (uIqaReg & VTD_BF_IQA_REG_IQA_MASK) + offQueueHead;
     1525
     1526                    /* Don't hold the lock while reading (potentially large amount of) requests. */
    14321527                    DMAR_UNLOCK(pDevIns, pThisR3);
    1433                     int rc = PDMDevHlpPhysRead(pDevIns, GCPhysQueueBase, pvQueue, cbDescriptors);
     1528
     1529                    int      rc;
     1530                    uint32_t cbRequests;
     1531                    if (offQueueTail > offQueueHead)
     1532                    {
     1533                        /* The requests have not wrapped around, read them in one go. */
     1534                        cbRequests = offQueueTail - offQueueHead;
     1535                        rc = PDMDevHlpPhysRead(pDevIns, GCPhysRequests, pvRequests, cbRequests);
     1536                    }
     1537                    else
     1538                    {
     1539                        /* The requests have wrapped around, read forward and wrapped-around. */
     1540                        uint32_t const cbForward = cbQueue - offQueueHead;
     1541                        rc  = PDMDevHlpPhysRead(pDevIns, GCPhysRequests, pvRequests, cbForward);
     1542
     1543                        uint32_t const cbWrapped = offQueueTail;
     1544                        if (   RT_SUCCESS(rc)
     1545                            && cbWrapped > 0)
     1546                        {
     1547                            rc = PDMDevHlpPhysRead(pDevIns, GCPhysRequests + cbForward,
     1548                                                   (void *)((uintptr_t)pvRequests + cbForward), cbWrapped);
     1549                        }
     1550                        cbRequests = cbForward + cbWrapped;
     1551                    }
     1552
     1553                    /* Re-acquire the lock since we need to update device state. */
    14341554                    DMAR_LOCK(pDevIns, pThisR3);
    14351555
    14361556                    if (RT_SUCCESS(rc))
    14371557                    {
    1438                         /** @todo Handle RTADDR_REG MMIO write first, for handling kIqei_InvalidTtm. I
    1439                          *        don't think it needs to be checked/handled here? */
    1440                         /** @todo Process invalidation descriptors. */
     1558                        /* Indicate to software we've fetched all requests. */
     1559                        dmarRegWriteRaw64(pThis, VTD_MMIO_OFF_IQH_REG, offQueueTail);
     1560
     1561                        /* Process all requests (in FIFO order) after more paranoid checks. */
     1562                        Assert(cbRequests <= cbQueue);
     1563                        dmarR3InvQueueProcessRequests(pDevIns, pvRequests, cbRequests, fDw);
    14411564                    }
    14421565                    else
    1443                         dmarIqeFaultRecord(pDevIns, kDmarDiag_IqaReg_Dsc_Fetch_Failed, kIqei_FetchDescriptorFailed);
     1566                        dmarIqeFaultRecord(pDevIns, kDmarDiag_IqaReg_Dsc_Fetch_Error, kIqei_FetchDescriptorError);
    14441567                }
    14451568                else
     
    14501573    }
    14511574
    1452     RTMemFree(pvQueue);
    1453     pvQueue = NULL;
     1575    RTMemFree(pvRequests);
     1576    pvRequests = NULL;
    14541577
    14551578    LogFlowFunc(("Invalidation-queue thread terminating\n"));
     
    14831606{
    14841607    PCDMAR      pThis   = PDMDEVINS_2_DATA(pDevIns, PDMAR);
     1608    PCDMARR3    pThisR3 = PDMDEVINS_2_DATA_CC(pDevIns, PCDMARR3);
    14851609    PCPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];
    14861610    PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev);
     
    14881612    bool const fVerbose = RTStrCmp(pszArgs, "verbose") == 0;
    14891613
    1490     DMARDIAG const enmDiag = pThis->enmDiag;
    1491     const char *pszDiag    = enmDiag < RT_ELEMENTS(g_apszDmarDiagDesc) ? g_apszDmarDiagDesc[enmDiag] : "(Unknown)";
    1492 
     1614    /*
     1615     * We lock the device to get a consistent register state, but it is
     1616     * ASSUMED pHlp->pfnPrintf is expensive, so we copy the registers into
     1617     * temporaries and release the lock ASAP.
     1618     *
     1619     * Order of register read and outputting according to
     1620     * Intel VT-d spec. 10.4 "Register Descriptions" for no particular reason.
     1621     */
     1622    DMAR_LOCK(pDevIns, pThisR3);
     1623
     1624    DMARDIAG const enmDiag      = pThis->enmDiag;
     1625    uint32_t const uVerReg      = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_VER_REG);
     1626    uint64_t const uCapReg      = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_CAP_REG);
     1627    uint64_t const uEcapReg     = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_ECAP_REG);
     1628    uint32_t const uGcmdReg     = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_GCMD_REG);
     1629    uint32_t const uGstsReg     = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_GSTS_REG);
     1630    uint64_t const uRtaddrReg   = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_RTADDR_REG);
     1631    uint64_t const uCcmdReg     = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_CCMD_REG);
     1632    uint32_t const uFstsReg     = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_FSTS_REG);
     1633    uint32_t const uFectlReg    = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_FECTL_REG);
     1634    uint32_t const uFedataReg   = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_FEDATA_REG);
     1635    uint32_t const uFeaddrReg   = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_FEADDR_REG);
     1636    uint32_t const uFeuaddrReg  = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_FEUADDR_REG);
     1637    uint64_t const uAflogReg    = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_AFLOG_REG);
     1638    uint32_t const uPmenReg     = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_PMEN_REG);
     1639    uint32_t const uPlmbaseReg  = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_PLMBASE_REG);
     1640    uint32_t const uPlmlimitReg = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_PLMLIMIT_REG);
     1641    uint64_t const uPhmbaseReg  = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_PHMBASE_REG);
     1642    uint64_t const uPhmlimitReg = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_PHMLIMIT_REG);
     1643    uint64_t const uIqhReg      = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_IQH_REG);
     1644    uint64_t const uIqtReg      = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_IQT_REG);
     1645    uint64_t const uIqaReg      = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_IQA_REG);
     1646    uint32_t const uIcsReg      = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_ICS_REG);
     1647    uint32_t const uIectlReg    = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_IECTL_REG);
     1648    uint32_t const uIedataReg   = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_IEDATA_REG);
     1649    uint32_t const uIeaddrReg   = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_IEADDR_REG);
     1650    uint32_t const uIeuaddrReg  = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_IEUADDR_REG);
     1651    uint64_t const uIqercdReg   = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_IQERCD_REG);
     1652    uint64_t const uIrtaReg     = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_IRTA_REG);
     1653    uint64_t const uPqhReg      = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_PQH_REG);
     1654    uint64_t const uPqtReg      = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_PQT_REG);
     1655    uint64_t const uPqaReg      = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_PQA_REG);
     1656    uint32_t const uPrsReg      = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_PRS_REG);
     1657    uint32_t const uPectlReg    = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_PECTL_REG);
     1658    uint32_t const uPedataReg   = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_PEDATA_REG);
     1659    uint32_t const uPeaddrReg   = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_PEADDR_REG);
     1660    uint32_t const uPeuaddrReg  = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_PEUADDR_REG);
     1661    uint64_t const uMtrrcapReg  = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_MTRRCAP_REG);
     1662    uint64_t const uMtrrdefReg  = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_MTRRDEF_REG);
     1663    /** @todo Do other registers as required, we don't implement them for now. */
     1664
     1665    DMAR_UNLOCK(pDevIns, pThisR3);
     1666
     1667    const char *const pszDiag = enmDiag < RT_ELEMENTS(g_apszDmarDiagDesc) ? g_apszDmarDiagDesc[enmDiag] : "(Unknown)";
    14931668    pHlp->pfnPrintf(pHlp, "Intel-IOMMU:\n");
    1494     pHlp->pfnPrintf(pHlp, " Diag = %u (%s)\n", enmDiag, pszDiag);
     1669    pHlp->pfnPrintf(pHlp, " Diag         = %s\n", pszDiag);
     1670    pHlp->pfnPrintf(pHlp, " VER_REG      = %#RX32\n", uVerReg);
     1671    pHlp->pfnPrintf(pHlp, " CAP_REG      = %#RX64\n", uCapReg);
     1672    pHlp->pfnPrintf(pHlp, " ECAP_REG     = %#RX64\n", uEcapReg);
     1673    pHlp->pfnPrintf(pHlp, " GCMD_REG     = %#RX32\n", uGcmdReg);
     1674    pHlp->pfnPrintf(pHlp, " GSTS_REG     = %#RX32\n", uGstsReg);
     1675    pHlp->pfnPrintf(pHlp, " RTADDR_REG   = %#RX64\n", uRtaddrReg);
     1676    pHlp->pfnPrintf(pHlp, " CCMD_REG     = %#RX64\n", uCcmdReg);
     1677    pHlp->pfnPrintf(pHlp, " FSTS_REG     = %#RX32\n", uFstsReg);
     1678    pHlp->pfnPrintf(pHlp, " FECTL_REG    = %#RX32\n", uFectlReg);
     1679    pHlp->pfnPrintf(pHlp, " FEDATA_REG   = %#RX32\n", uFedataReg);
     1680    pHlp->pfnPrintf(pHlp, " FEADDR_REG   = %#RX32\n", uFeaddrReg);
     1681    pHlp->pfnPrintf(pHlp, " FEUADDR_REG  = %#RX32\n", uFeuaddrReg);
     1682    pHlp->pfnPrintf(pHlp, " AFLOG_REG    = %#RX64\n", uAflogReg);
     1683    pHlp->pfnPrintf(pHlp, " PMEN_REG     = %#RX32\n", uPmenReg);
     1684    pHlp->pfnPrintf(pHlp, " PLMBASE_REG  = %#RX32\n", uPlmbaseReg);
     1685    pHlp->pfnPrintf(pHlp, " PLMLIMIT_REG = %#RX32\n", uPlmlimitReg);
     1686    pHlp->pfnPrintf(pHlp, " PHMBASE_REG  = %#RX64\n", uPhmbaseReg);
     1687    pHlp->pfnPrintf(pHlp, " PHMLIMIT_REG = %#RX64\n", uPhmlimitReg);
     1688    pHlp->pfnPrintf(pHlp, " IQH_REG      = %#RX64\n", uIqhReg);
     1689    pHlp->pfnPrintf(pHlp, " IQT_REG      = %#RX64\n", uIqtReg);
     1690    pHlp->pfnPrintf(pHlp, " IQA_REG      = %#RX64\n", uIqaReg);
     1691    pHlp->pfnPrintf(pHlp, " ICS_REG      = %#RX32\n", uIcsReg);
     1692    pHlp->pfnPrintf(pHlp, " IECTL_REG    = %#RX32\n", uIectlReg);
     1693    pHlp->pfnPrintf(pHlp, " IEDATA_REG   = %#RX32\n", uIedataReg);
     1694    pHlp->pfnPrintf(pHlp, " IEADDR_REG   = %#RX32\n", uIeaddrReg);
     1695    pHlp->pfnPrintf(pHlp, " IEUADDR_REG  = %#RX32\n", uIeuaddrReg);
     1696    pHlp->pfnPrintf(pHlp, " IQERCD_REG   = %#RX64\n", uIqercdReg);
     1697    pHlp->pfnPrintf(pHlp, " IRTA_REG     = %#RX64\n", uIrtaReg);
     1698    pHlp->pfnPrintf(pHlp, " PQH_REG      = %#RX64\n", uPqhReg);
     1699    pHlp->pfnPrintf(pHlp, " PQT_REG      = %#RX64\n", uPqtReg);
     1700    pHlp->pfnPrintf(pHlp, " PQA_REG      = %#RX64\n", uPqaReg);
     1701    pHlp->pfnPrintf(pHlp, " PRS_REG      = %#RX32\n", uPrsReg);
     1702    pHlp->pfnPrintf(pHlp, " PECTL_REG    = %#RX32\n", uPectlReg);
     1703    pHlp->pfnPrintf(pHlp, " PEDATA_REG   = %#RX32\n", uPedataReg);
     1704    pHlp->pfnPrintf(pHlp, " PEADDR_REG   = %#RX32\n", uPeaddrReg);
     1705    pHlp->pfnPrintf(pHlp, " PEUADDR_REG  = %#RX32\n", uPeuaddrReg);
     1706    pHlp->pfnPrintf(pHlp, " MTRRCAP_REG  = %#RX64\n", uMtrrcapReg);
     1707    pHlp->pfnPrintf(pHlp, " MTRRDEF_REG  = %#RX64\n", uMtrrdefReg);
    14951708    pHlp->pfnPrintf(pHlp, "\n");
    14961709}
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