VirtualBox

Changeset 89509 in vbox for trunk/src/VBox/Devices/Bus


Ignore:
Timestamp:
Jun 4, 2021 12:55:37 PM (3 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 Fix diagnostic reason not getting updated for qualified address translation faults.

File:
1 edited

Legend:

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

    r89499 r89509  
    14681468 *
    14691469 * @param   pDevIns     The IOMMU device instance.
    1470  * @param   enmDiag     The diagnostic reason.
    14711470 * @param   uFrcdHi     The FRCD_HI_REG value for this fault.
    14721471 * @param   uFrcdLo     The FRCD_LO_REG value for this fault.
    14731472 */
    1474 static void dmarPrimaryFaultRecord(PPDMDEVINS pDevIns, DMARDIAG enmDiag, uint64_t uFrcdHi, uint64_t uFrcdLo)
     1473static void dmarPrimaryFaultRecord(PPDMDEVINS pDevIns, uint64_t uFrcdHi, uint64_t uFrcdLo)
    14751474{
    14761475    PDMAR    pThis   = PDMDEVINS_2_DATA(pDevIns, PDMAR);
     
    14781477
    14791478    DMAR_LOCK(pDevIns, pThisCC);
    1480 
    1481     /* Update the diagnostic reason. */
    1482     pThis->enmDiag = enmDiag;
    14831479
    14841480    /* We don't support advance fault logging. */
     
    15131509static void dmarIrFaultRecord(PPDMDEVINS pDevIns, DMARDIAG enmDiag, VTDIRFAULT enmIrFault, uint16_t idDevice, uint16_t idxIntr)
    15141510{
     1511    /* Update the diagnostic reason. */
     1512    PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR);
     1513    pThis->enmDiag = enmDiag;
     1514
    15151515    uint64_t const uFrcdHi = RT_BF_MAKE(VTD_BF_1_FRCD_REG_SID, idDevice)
    15161516                           | RT_BF_MAKE(VTD_BF_1_FRCD_REG_FR,  enmIrFault)
    15171517                           | RT_BF_MAKE(VTD_BF_1_FRCD_REG_F,   1);
    15181518    uint64_t const uFrcdLo = (uint64_t)idxIntr << 48;
    1519     dmarPrimaryFaultRecord(pDevIns, enmDiag, uFrcdHi, uFrcdLo);
     1519    dmarPrimaryFaultRecord(pDevIns, uFrcdHi, uFrcdLo);
    15201520}
    15211521
     
    15411541    if (!(pIrte->au64[0] & VTD_BF_0_IRTE_FPD_MASK))
    15421542        return dmarIrFaultRecord(pDevIns, enmDiag, enmIrFault, idDevice, idxIntr);
     1543
     1544    /* Update the diagnostic reason (even if software wants to supress faults). */
     1545    PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR);
     1546    pThis->enmDiag = enmDiag;
    15431547}
    15441548
     
    15561560                                PCDMARMEMREQAUX pMemReqAux)
    15571561{
     1562    /* Update the diagnostic reason (even if software wants to supress faults). */
     1563    PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR);
     1564    pThis->enmDiag = enmDiag;
     1565
    15581566    /*
    15591567     * Qualified faults are those that can be suppressed by software using the FPD bit
     
    15821590                               | RT_BF_MAKE(VTD_BF_1_FRCD_REG_F,    1);
    15831591        uint64_t const uFrcdLo = pMemReqIn->AddrRange.uAddr & X86_PAGE_BASE_MASK;
    1584         dmarPrimaryFaultRecord(pDevIns, enmDiag, uFrcdHi, uFrcdLo);
     1592        dmarPrimaryFaultRecord(pDevIns, uFrcdHi, uFrcdLo);
    15851593    }
    15861594}
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