Changeset 107984 in vbox
- Timestamp:
- Jan 30, 2025 6:43:18 AM (3 weeks ago)
- svn:sync-xref-src-repo-rev:
- 167247
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/gic.h
r107957 r107984 162 162 # define GIC_DIST_REG_TYPER_ESPI_RANGE ( RT_BIT_32(27) | RT_BIT_32(28) | RT_BIT(29) \ 163 163 | RT_BIT_32(30) | RT_BIT_32(31)) 164 # define GIC_DIST_REG_TYPER_ESPI_RANGE_BIT 27 164 165 # define GIC_DIST_REG_TYPER_ESPI_RANGE_SET(a_Range) (((a_Range) << 27) & GIC_DIST_REG_TYPER_ESPI_RANGE) 165 166 -
trunk/src/VBox/VMM/VMMAll/GICAll.cpp
r107957 r107984 407 407 break; 408 408 case GIC_DIST_REG_TYPER_OFF: 409 *puValue = GIC_DIST_REG_TYPER_NUM_ITLINES_SET(pThis->uItLinesNumber) 409 Assert(pThis->uMaxSpi > 0 && pThis->uMaxSpi < GIC_DIST_REG_TYPER_NUM_ITLINES); 410 *puValue = GIC_DIST_REG_TYPER_NUM_ITLINES_SET(pThis->uMaxSpi) 410 411 | GIC_DIST_REG_TYPER_NUM_PES_SET(0) /* 1 PE */ /** @todo r=ramshankar: Should this be pVCpu->cCpus? Currently it means 'ARE' must always be used? */ 411 412 /*| GIC_DIST_REG_TYPER_ESPI*/ /** @todo */ -
trunk/src/VBox/VMM/VMMR3/GICR3.cpp
r107957 r107984 398 398 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "DistributorMmioBase|RedistributorMmioBase|ItsMmioBase" 399 399 "|ArchRev" 400 "|ArchExtNmi" 401 "|ItLinesNumber", ""); 400 "|Nmi" 401 "|MaxSpi" 402 "|MaxExtSpi" 403 "|PpiNum", ""); 402 404 403 405 #if 0 … … 422 424 else 423 425 return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS, 424 N_("Configuration error: \"ArchRev\" %u is not supported"), pGicDev->uArchRev);425 426 /** @devcfgm{gic, ArchExtNmi, bool, false}426 N_("Configuration error: \"ArchRev\" value %u is not supported"), pGicDev->uArchRev); 427 428 /** @devcfgm{gic, Nmi, bool, false} 427 429 * Configures whether NMIs are supported (GICD_TYPER.NMI). */ 428 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "ArchExtNmi", &pGicDev->fNmi, false); 429 AssertLogRelRCReturn(rc, rc); 430 if ( !pGicDev->fNmi 431 || pGicDev->uArchRev >= 3) 430 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "Nmi", &pGicDev->fNmi, false); 431 AssertLogRelRCReturn(rc, rc); 432 433 /** @devcfgm{gic, ExtSpi, bool, false} 434 * Configures whether extended SPIs are supported (GICD_TYPER.ESPI). */ 435 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "ExtSpi", &pGicDev->fExtSpi, false); 436 AssertLogRelRCReturn(rc, rc); 437 438 /** @devcfgm{gic, MaxSpi, uint16_t, 1} 439 * Configures GICD_TYPER.ItLinesNumber. 440 * 441 * For the INTID range [32,1023], configures the maximum SPI supported. Valid values 442 * are [1,31] which equates to interrupt IDs [63,1023]. A value of 0 implies SPIs 443 * are supported. We don't allow configuring this value as it's expected that 444 * most guests would assume support for SPIs. */ 445 AssertCompile(GIC_DIST_REG_TYPER_NUM_ITLINES == 31); 446 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "MaxSpi", &pGicDev->uMaxSpi, 1 /* 63 INTIDs */); 447 AssertLogRelRCReturn(rc, rc); 448 if (pGicDev->uMaxSpi - 1 < 31) 432 449 { /* likely */ } 433 450 else 434 451 return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS, 435 N_("Configuration error: \"ArchExtNmi\" requires architecture revision v3 or newer")); 436 437 /** @devcfgm{gic, ItLinesNumber, uint16_t, 1} 438 * Configures GICD_TYPER.ItLinesNumber, bits [4:0]. 452 N_("Configuration error: \"MaxSpi\" must be in the range [1,%u]"), 453 GIC_DIST_REG_TYPER_NUM_ITLINES); 454 455 /** @devcfgm{gic, MaxExtSpi, uint16_t, 31} 456 * Configures GICD_TYPER.ESPI_range. 439 457 * 440 * For the INTID range 32-1023, configures the maximum SPI supported. Valid values 441 * are [1, 31] which equates to interrupt IDs [63, 1023]. A value of 0 indicates no 442 * SPIs are supported. We do not allow configuring this value as it's expected most 443 * guests would assume support for SPIs. */ 444 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "ItLinesNumber", &pGicDev->uItLinesNumber, 1 /* 63 interrupt IDs */); 445 AssertLogRelRCReturn(rc, rc); 446 if ( pGicDev->uItLinesNumber 447 && !(pGicDev->uItLinesNumber & ~GIC_DIST_REG_TYPER_NUM_ITLINES)) 458 * For the extended SPI range [4096,5119], configures the maximum extended SPI 459 * supported. Valid values are [0,31] which equates to extended SPI INTIDs 460 * [4096,5119]. This is ignored (set to 0) when extended SPIs are disabled. */ 461 AssertCompile(GIC_DIST_REG_TYPER_ESPI_RANGE >> GIC_DIST_REG_TYPER_ESPI_RANGE_BIT == 31); 462 rc = pHlp->pfnCFGMQueryU16Def(pCfg, "MaxExtSpi", &pGicDev->uMaxExtSpi, 31); 463 AssertLogRelRCReturn(rc, rc); 464 if (pGicDev->uMaxExtSpi <= 31) 448 465 { /* likely */ } 449 466 else 450 467 return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS, 451 N_("Configuration error: \"ItLinesNumber\" must be in the range [1,%u]"), 452 GIC_DIST_REG_TYPER_NUM_ITLINES); 468 N_("Configuration error: \"MaxExtSpi\" must be in the range [0,31]")); 469 470 /** @devcfgm{gic, MaxExtPpi, uint16_t, 0} 471 * Configures GICR_TYPER.PPInum. 472 * 473 * For the extended PPI INTIDs [31,1056,1119], configures the maximum extended 474 * PPI supported. Valid values are [0,1,2] which equates [31,1087,1119]. A value of 475 * 0 implies extended PPIs are not supported. */ 476 rc = pHlp->pfnCFGMQueryU8Def(pCfg, "PpiNum", &pGicDev->fPpiNum, 0); 477 AssertLogRelRCReturn(rc, rc); 478 if (pGicDev->fPpiNum <= GIC_REDIST_REG_TYPER_PPI_NUM_MAX_1119) 479 { /* likely */ } 480 else 481 return PDMDevHlpVMSetError(pDevIns, VERR_INVALID_PARAMETER, RT_SRC_POS, 482 N_("Configuration error: \"PpiNum\" must be in the range [0,2]")); 453 483 454 484 /* -
trunk/src/VBox/VMM/include/GICInternal.h
r107957 r107984 105 105 /** @name Configurables. 106 106 * @{ */ 107 /** The maximum SPI supported (GICD_TYPER.ItsLinesNumber). */108 uint16_t uItLinesNumber;109 107 /** The GIC architecture (GICD_PIDR2.ArchRev and GICR_PIDR2.ArchRev). */ 110 108 uint8_t uArchRev; 109 /** Extended PPIs supported (GICR_TYPER.PpiNum). */ 110 uint8_t fPpiNum; 111 /** Whether extended SPIs are supported (GICD_TYPER.ESPI). */ 112 bool fExtSpi; 111 113 /** Whether NMIs are supported (GICD_TYPER.NMI). */ 112 114 bool fNmi; 115 /** The maximum SPI supported (GICD_TYPER.ItsLinesNumber). */ 116 uint16_t uMaxSpi; 117 /** Maximum extended SPI supported (GICR_TYPER.ESPI_range). */ 118 uint16_t uMaxExtSpi; 113 119 /** @} */ 114 120 } GICDEV;
Note:
See TracChangeset
for help on using the changeset viewer.