dev-arm: Fix GICv3 IGRPMOD writes
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 29 Aug 2019 13:09:30 +0000 (14:09 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 6 Sep 2019 11:53:49 +0000 (11:53 +0000)
Writes to IGRPMOD were not right shifting the value, which resulted in
interrupts having a IGRPMOD value > 1, whereas the only allowed values
are 0 and 1.

Change-Id: Id491bd1b184d6e5abeeea25ea272eeb91792ccf7
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/+/20613
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/arm/gic_v3_distributor.cc

index bae90bf6ae949de08c7d88d678b2b83e131df662..f85474c9c97b505d584b51d3c7e271ae28881b8c 100644 (file)
@@ -794,7 +794,7 @@ 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++, int_id++) {
-                    irqGrpmod[int_id] = data & (0x1 << i);
+                    irqGrpmod[int_id] = bits(data, i);
                 }
 
                 return ;