dev-arm: Check for maximum number of supported PE in GICv3
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 5 Apr 2019 12:33:01 +0000 (13:33 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 25 Apr 2019 12:48:41 +0000 (12:48 +0000)
This is currently set to 256

Change-Id: If7bb2847c22f29bfa0cb4ebf4a7984ee43ab4e29
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18390
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/arm/Gic.py
src/dev/arm/gic_v3.cc

index 6f7c8d97356cefdfed4cd7e9b9427013f4b57b47..8bc155fff2ae9aa0052e484e2a9ecd15a6c97c51 100644 (file)
@@ -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")
index a6bd3d8fd24e1c56637a9ffd9820d6b714741eec..cfc7df579055c00d895d5d350fd5db514bc1e30f 100644 (file)
@@ -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);