From c366e19e623ecd2d7e7ee8abb6582f95ce8a2b80 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 5 Apr 2019 13:33:01 +0100 Subject: [PATCH] dev-arm: Check for maximum number of supported PE in GICv3 This is currently set to 256 Change-Id: If7bb2847c22f29bfa0cb4ebf4a7984ee43ab4e29 Signed-off-by: Giacomo Travaglini Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18390 Maintainer: Andreas Sandberg Tested-by: kokoro --- src/dev/arm/Gic.py | 4 ++++ src/dev/arm/gic_v3.cc | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/dev/arm/Gic.py b/src/dev/arm/Gic.py index 6f7c8d973..8bc155fff 100644 --- a/src/dev/arm/Gic.py +++ b/src/dev/arm/Gic.py @@ -178,3 +178,7 @@ class Gicv3(BaseGic): "HV maintenance interrupt." "ARM strongly recommends that maintenance interrupts " "are configured to use INTID 25 (PPI Interrupt).") + + cpu_max = Param.Unsigned(256, + "Maximum number of PE. This is affecting the maximum number of " + "redistributors") diff --git a/src/dev/arm/gic_v3.cc b/src/dev/arm/gic_v3.cc index a6bd3d8fd..cfc7df579 100644 --- a/src/dev/arm/gic_v3.cc +++ b/src/dev/arm/gic_v3.cc @@ -58,6 +58,11 @@ Gicv3::init() redistributors.resize(sys->numContexts(), nullptr); cpuInterfaces.resize(sys->numContexts(), nullptr); + panic_if(sys->numContexts() > params()->cpu_max, + "Exceeding maximum number of PEs supported by GICv3: " + "using %u while maximum is %u\n", sys->numContexts(), + params()->cpu_max); + for (int i = 0; i < sys->numContexts(); i++) { redistributors[i] = new Gicv3Redistributor(this, i); cpuInterfaces[i] = new Gicv3CPUInterface(this, i); -- 2.30.2