dev-arm: Check for security attribute when writing to ICFGR registers
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Sat, 18 Jul 2020 13:25:26 +0000 (14:25 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 21 Jul 2020 08:55:03 +0000 (08:55 +0000)
This is matching the GICD_ICFGR read; a non secure access to a secure
interrupt should be treated as RAZ/WI

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

index 485ba7284dab442a45c3d4131c87c19982fdac52..f8605da27308ab8bbb3f6782923f3743aa192d87 100644 (file)
@@ -743,6 +743,11 @@ Gicv3Distributor::write(Addr addr, uint64_t data, size_t size,
 
         for (int i = 0, int_id = first_intid; i < 8 * size && int_id < itLines;
              i = i + 2, int_id++) {
+
+            if (nsAccessToSecInt(int_id, is_secure_access)) {
+                continue;
+            }
+
             irqConfig[int_id] = data & (0x2 << i) ?
                                 Gicv3::INT_EDGE_TRIGGERED :
                                 Gicv3::INT_LEVEL_SENSITIVE;