dev-arm: optional instantiation of GICv3 ITS
authorAdrian Herrera <adrian.herrera@arm.com>
Wed, 9 Oct 2019 16:58:19 +0000 (17:58 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 5 Nov 2019 09:27:30 +0000 (09:27 +0000)
GICv3 ITS is an optional component of GICv3. The previous behaviour
was for a stub ITS to be created by default, which resulted in a crash
for use cases where a GICv3 with no ITS is required.
This patch removes the instantiation of the ITS by default and adds
checks for its presence both in initialization and device tree
generation code.

Change-Id: Id424924c8c1152d512aaa2837de4aa60329ec234
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22423
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/arm/Gic.py
src/dev/arm/gic_v3.cc

index eec6e95c2266ffe768a7057742014c2c2112a42d..20b7bca053811c6306bbcd25019b08e26b47ffb8 100644 (file)
@@ -203,7 +203,7 @@ class Gicv3(BaseGic):
     # Used for DTB autogeneration
     _state = FdtState(addr_cells=2, size_cells=2, interrupt_cells=3)
 
-    its = Param.Gicv3Its(Gicv3Its(), "GICv3 Interrupt Translation Service")
+    its = Param.Gicv3Its(NULL, "GICv3 Interrupt Translation Service")
 
     dist_addr = Param.Addr("Address for distributor")
     dist_pio_delay = Param.Latency('10ns', "Delay for PIO r/w to distributor")
@@ -263,7 +263,8 @@ class Gicv3(BaseGic):
 
         node.appendPhandle(self)
 
-        # Generate the ITS device tree
-        node.append(self.its.generateDeviceTree(self._state))
+        # Generate the ITS device tree if instantiated
+        if self.its != NULL:
+            node.append(self.its.generateDeviceTree(self._state))
 
         yield node
index eb38efe4de44fd3ac84a0837df36d5287f4880bc..ba0a8ee63f5f47327da320896afee8e1ee1869bb 100644 (file)
@@ -91,7 +91,9 @@ Gicv3::init()
         cpuInterfaces[i]->init();
     }
 
-    params()->its->setGIC(this);
+    Gicv3Its *its = params()->its;
+    if (its)
+        its->setGIC(this);
 
     BaseGic::init();
 }