VirtualBox

Changeset 108823 in vbox for trunk/src


Ignore:
Timestamp:
Apr 2, 2025 6:04:51 AM (13 days ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168269
Message:

VMM/GIC: bugref:10877 Minor architecture revision is being configured by Main now, handle it in GIC.

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/GICR3.cpp

    r108779 r108823  
    5151*********************************************************************************************************************************/
    5252/** GIC saved state version. */
    53 #define GIC_SAVED_STATE_VERSION                     7
     53#define GIC_SAVED_STATE_VERSION                     8
    5454
    5555# define GIC_SYSREGRANGE(a_uFirst, a_uLast, a_szName) \
     
    9191    pHlp->pfnPrintf(pHlp, "GIC:\n");
    9292    pHlp->pfnPrintf(pHlp, "  uArchRev         = %u\n",      pGicDev->uArchRev);
     93    pHlp->pfnPrintf(pHlp, "  uArchRevMinor    = %u\n",      pGicDev->uArchRevMinor);
    9394    pHlp->pfnPrintf(pHlp, "  uMaxSpi          = %u (upto IntId %u)\n", pGicDev->uMaxSpi, 32 * (pGicDev->uMaxSpi + 1));
    9495    pHlp->pfnPrintf(pHlp, "  fExtSpi          = %RTbool\n", pGicDev->fExtSpi);
     
    311312    pHlp->pfnSSMPutU32(pSSM,  pVM->cCpus);
    312313    pHlp->pfnSSMPutU8(pSSM,   pGicDev->uArchRev);
     314    pHlp->pfnSSMPutU8(pSSM,   pGicDev->uArchRevMinor);
    313315    pHlp->pfnSSMPutU8(pSSM,   pGicDev->uMaxSpi);
    314316    pHlp->pfnSSMPutBool(pSSM, pGicDev->fExtSpi);
     
    404406    PGICDEV pGicDev = PDMDEVINS_2_DATA(pDevIns, PGICDEV);
    405407    pHlp->pfnSSMGetU8(pSSM,   &pGicDev->uArchRev);
     408    pHlp->pfnSSMGetU8(pSSM,   &pGicDev->uArchRevMinor);
    406409    pHlp->pfnSSMGetU8(pSSM,   &pGicDev->uMaxSpi);
    407410    pHlp->pfnSSMGetBool(pSSM, &pGicDev->fExtSpi);
     
    504507        return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Invalid uArchRev, got %u expected range [1,31]"), pGicDev->uArchRev,
    505508                                       GIC_DIST_REG_PIDR2_ARCHREV_GICV1, GIC_DIST_REG_PIDR2_ARCHREV_GICV4);
     509    if (pGicDev->uArchRevMinor == 1)
     510    { /* likely */ }
     511    else
     512        return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Invalid uArchRevMinor, got %u expected 1"), pGicDev->uArchRevMinor);
    506513    if (pGicDev->uMaxSpi - 1 < 31)
    507514    { /* likely */ }
     
    590597    PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "DistributorMmioBase|RedistributorMmioBase|ItsMmioBase"
    591598                                           "|ArchRev"
     599                                           "|ArchRevMinor"
    592600                                           "|MaxSpi"
    593601                                           "|ExtSpi"
     
    618626    int rc = pHlp->pfnCFGMQueryU8Def(pCfg, "ArchRev", &pGicDev->uArchRev, 3);
    619627    AssertLogRelRCReturn(rc, rc);
    620     if (pGicDev->uArchRev == 3)
     628    if (pGicDev->uArchRev == GIC_DIST_REG_PIDR2_ARCHREV_GICV3)
    621629        pGicDev->Gits.uArchRev = pGicDev->uArchRev;
    622630    else
    623631        return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS,
    624                                    N_("Configuration error: \"ArchRev\" value %u is not supported"), pGicDev->uArchRev);
     632                                   N_("Configuration error: \"ArchRev\" must be %u, other revisions not supported"),
     633                                   GIC_DIST_REG_PIDR2_ARCHREV_GICV3);
     634
     635    /** @devcfgm{gic, ArchRevMinor, uint8_t, 1}
     636     * Configures the GIC architecture revision minor version.
     637     *
     638     * Currently we support GICv3.1 only. GICv3.1's only addition to GICv3 is supported
     639     * for extended INTID ranges which we currently always support. */
     640    rc = pHlp->pfnCFGMQueryU8Def(pCfg, "ArchRevMinor", &pGicDev->uArchRevMinor, 1);
     641    AssertLogRelRCReturn(rc, rc);
     642    if (pGicDev->uArchRevMinor == 1)
     643    { /* likely */ }
     644    else
     645        return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS,
     646                                   N_("Configuration error: \"ArchRevMinor\" must be 1, other minor revisions not supported"));
    625647
    626648    /** @devcfgm{gic, MaxSpi, uint8_t, 31}
     
    688710                                   N_("Configuration error: \"MaxExtPpi\" must be in the range [0,2]"));
    689711
    690     /** @devcfgm{gic, RangeSelSupport, bool, true}
     712    /** @devcfgm{gic, RangeSel, bool, true}
    691713     * Configures whether range-selector support is enabled (GICD_TYPER.RSS and
    692714     * ICC_CTLR_EL1.RSS). */
     
    882904     * Log features/config.
    883905     */
    884     uint8_t const uArchRev     = pGicDev->uArchRev;
    885     uint8_t const uMaxSpi      = pGicDev->uMaxSpi;
    886     bool const    fExtSpi      = pGicDev->fExtSpi;
    887     uint8_t const uMaxExtSpi   = pGicDev->uMaxExtSpi;
    888     bool const    fExtPpi      = pGicDev->fExtPpi;
    889     uint8_t const uMaxExtPpi   = pGicDev->uMaxExtPpi;
    890     bool const fRangeSel       = pGicDev->fRangeSel;
    891     bool const fNmi            = pGicDev->fNmi;
    892     bool const fMbi            = pGicDev->fMbi;
    893     bool const fAff3Levels     = pGicDev->fAff3Levels;
    894     bool const fLpi            = pGicDev->fLpi;
    895     uint16_t const uExtPpiLast = uMaxExtPpi == GIC_REDIST_REG_TYPER_PPI_NUM_MAX_1087 ? 1087 : GIC_INTID_RANGE_EXT_PPI_LAST;
    896     LogRel(("GIC: ArchRev=%u RangeSel=%RTbool Nmi=%RTbool Mbi=%RTbool Aff3Levels=%RTbool Lpi=%RTbool\n",
    897             uArchRev, fRangeSel, fNmi, fMbi, fAff3Levels, fLpi));
     906    uint8_t const uArchRev      = pGicDev->uArchRev;
     907    uint8_t const uArchRevMinor = pGicDev->uArchRevMinor;
     908    uint8_t const uMaxSpi       = pGicDev->uMaxSpi;
     909    bool const    fExtSpi       = pGicDev->fExtSpi;
     910    uint8_t const uMaxExtSpi    = pGicDev->uMaxExtSpi;
     911    bool const    fExtPpi       = pGicDev->fExtPpi;
     912    uint8_t const uMaxExtPpi    = pGicDev->uMaxExtPpi;
     913    bool const fRangeSel        = pGicDev->fRangeSel;
     914    bool const fNmi             = pGicDev->fNmi;
     915    bool const fMbi             = pGicDev->fMbi;
     916    bool const fAff3Levels      = pGicDev->fAff3Levels;
     917    bool const fLpi             = pGicDev->fLpi;
     918    uint16_t const uExtPpiLast  = uMaxExtPpi == GIC_REDIST_REG_TYPER_PPI_NUM_MAX_1087 ? 1087 : GIC_INTID_RANGE_EXT_PPI_LAST;
     919    LogRel(("GIC: ArchRev=%u.%u RangeSel=%RTbool Nmi=%RTbool Mbi=%RTbool Aff3Levels=%RTbool Lpi=%RTbool\n",
     920            uArchRev, uArchRevMinor, fRangeSel, fNmi, fMbi, fAff3Levels, fLpi));
    898921    LogRel(("GIC: SPIs=true (%u:32..%u) ExtSPIs=%RTbool (%u:4095..%u) ExtPPIs=%RTbool (%u:1056..%u)\n",
    899922            uMaxSpi, 32 * (uMaxSpi + 1),
  • trunk/src/VBox/VMM/include/GICInternal.h

    r108716 r108823  
    106106    /** @name Configurables.
    107107     * @{ */
    108     /** The GIC architecture (GICD_PIDR2.ArchRev and GICR_PIDR2.ArchRev). */
     108    /** The GIC architecture revision (GICD_PIDR2.ArchRev and GICR_PIDR2.ArchRev). */
    109109    uint8_t                     uArchRev;
     110    /** The GIC architecture minor revision (currently 1 as we only support GICv3.1). */
     111    uint8_t                     uArchRevMinor;
    110112    /** The maximum SPI supported (GICD_TYPER.ItLinesNumber). */
    111113    uint8_t                     uMaxSpi;
     
    132134    uint8_t                     uMaxLpi;
    133135    /** Padding. */
    134     bool                        afPadding[4];
     136    bool                        afPadding[3];
    135137    /** @} */
    136138
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