From 2df87bc1fd5ec12d2206c38338ff8fb26e8d4bcc Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Tue, 23 Apr 2019 17:38:54 +0100 Subject: [PATCH] dev-arm: Fix GICv3 LPI loop Loop was mistakenly increasing the upper bound of the iteration rather than the index variable itself. Change-Id: I0a5a7bc189bc0954a8a6d9581032c2ed902030da Signed-off-by: Giacomo Travaglini Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18590 Maintainer: Andreas Sandberg Tested-by: kokoro --- src/dev/arm/gic_v3_redistributor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dev/arm/gic_v3_redistributor.cc b/src/dev/arm/gic_v3_redistributor.cc index 348cd9627..3039e1e55 100644 --- a/src/dev/arm/gic_v3_redistributor.cc +++ b/src/dev/arm/gic_v3_redistributor.cc @@ -830,14 +830,14 @@ Gicv3Redistributor::update() } // Check LPIs - uint32_t largest_lpi_id = 1 << (lpiIDBits + 1); + const uint32_t largest_lpi_id = 1 << (lpiIDBits + 1); char lpi_pending_table[largest_lpi_id / 8]; ThreadContext * tc = gic->getSystem()->getThreadContext(cpuId); tc->getVirtProxy().readBlob(lpiPendingTablePtr, (uint8_t *) lpi_pending_table, sizeof(lpi_pending_table)); for (int lpi_id = SMALLEST_LPI_ID; lpi_id < largest_lpi_id; - largest_lpi_id++) { + lpi_id++) { uint32_t lpi_pending_entry_byte = lpi_id / 8; uint8_t lpi_pending_entry_bit_position = lpi_id % 8; bool lpi_is_pending = lpi_pending_table[lpi_pending_entry_byte] & -- 2.30.2