Changeset 107984 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Jan 30, 2025 6:43:18 AM (3 weeks ago)
- svn:sync-xref-src-repo-rev:
- 167247
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 /*
Note:
See TracChangeset
for help on using the changeset viewer.