VirtualBox

Ignore:
Timestamp:
Apr 15, 2025 12:30:07 PM (4 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168496
Message:

VMM/GIC: bugref:10877 Minus 1 bites us again and LPI configuration table work-in-progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/GICAll.cpp

    r108946 r108976  
    661661
    662662
     663static void gicDistReadLpiConfigTableFromMemory(PPDMDEVINS pDevIns, PGICDEV pGicDev)
     664{
     665    Assert(pGicDev->fEnableLpis);
     666    LogFlowFunc(("\n"));
     667
     668    /* Check if the guest is disabling LPIs by setting GICR_PROPBASER.IDBits < 13. */
     669    uint8_t const cIdBits = RT_BF_GET(pGicDev->uLpiConfigBaseReg.u, GIC_BF_REDIST_REG_PROPBASER_ID_BITS) + 1;
     670    if (cIdBits < GIC_LPI_ID_BITS_MIN)
     671        return;
     672
     673    /* Copy the LPI config table from guest memory to our internal cache. */
     674    Assert(UINT32_C(2) << pGicDev->uMaxLpi <= RT_ELEMENTS(pGicDev->abLpiConfig));
     675    RTGCPHYS const GCPhysLpiConfigTable = pGicDev->uLpiConfigBaseReg.u & GIC_BF_REDIST_REG_PROPBASER_PHYS_ADDR_MASK;
     676    uint32_t const cbLpiConfigTable     = sizeof(pGicDev->abLpiConfig);
     677
     678    /** @todo Try releasing and re-acquiring the device critical section here.
     679     *        Probably safe, but haven't verified this... */
     680    int const rc = PDMDevHlpPhysReadMeta(pDevIns, GCPhysLpiConfigTable, (void *)&pGicDev->abLpiConfig[0], cbLpiConfigTable);
     681    AssertRC(rc);
     682}
     683
     684
    663685/**
    664686 * Updates the internal IRQ state and sets or clears the appropriate force action
     
    20502072                     | (pGicDev->fMbi ? GIC_DIST_REG_TYPER_MBIS : 0)
    20512073                     | (pGicDev->fRangeSel ? GIC_DIST_REG_TYPER_RSS : 0)
    2052                      | GIC_DIST_REG_TYPER_IDBITS_SET(16)             /* We only support 16-bit interrupt IDs. */
     2074                     | GIC_DIST_REG_TYPER_IDBITS_SET(15)             /* We only support 16-bit interrupt IDs. */
    20532075                     | (pGicDev->fAff3Levels ? GIC_DIST_REG_TYPER_A3V : 0);
    20542076            if (pGicDev->fExtSpi)
     
    24612483        case GIC_REDIST_REG_CTLR_OFF:
    24622484            pGicDev->fEnableLpis = RT_BOOL(uValue & GIC_REDIST_REG_CTLR_ENABLE_LPI);
     2485            if (pGicDev->fEnableLpis)
     2486                gicDistReadLpiConfigTableFromMemory(pDevIns, pGicDev);
    24632487            break;
    24642488        case GIC_REDIST_REG_PROPBASER_OFF:
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