[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 33/38] hw/intc/arm_gicv3_its: Fix return codes in process_mapc()
From: |
Peter Maydell |
Subject: |
[PULL 33/38] hw/intc/arm_gicv3_its: Fix return codes in process_mapc() |
Date: |
Thu, 20 Jan 2022 12:36:25 +0000 |
Fix process_mapc() to consistently return CMD_STALL for memory
errors and CMD_CONTINUE for parameter errors, as we claim in the
comments that we do.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220111171048.3545974-10-peter.maydell@linaro.org
---
hw/intc/arm_gicv3_its.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c
index 010779a9fdc..80ef4dbcadf 100644
--- a/hw/intc/arm_gicv3_its.c
+++ b/hw/intc/arm_gicv3_its.c
@@ -491,7 +491,6 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, uint32_t
offset)
uint64_t rdbase;
bool valid;
MemTxResult res = MEMTX_OK;
- ItsCmdResult result = CMD_STALL;
uint64_t value;
offset += NUM_BYTES_IN_DW;
@@ -501,7 +500,7 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, uint32_t
offset)
MEMTXATTRS_UNSPECIFIED, &res);
if (res != MEMTX_OK) {
- return result;
+ return CMD_STALL;
}
icid = value & ICID_MASK;
@@ -520,11 +519,10 @@ static ItsCmdResult process_mapc(GICv3ITSState *s,
uint32_t offset)
* we ignore this command and move onto the next
* command in the queue
*/
- } else {
- result = update_cte(s, icid, valid, rdbase) ? CMD_CONTINUE : CMD_STALL;
+ return CMD_CONTINUE;
}
- return result;
+ return update_cte(s, icid, valid, rdbase) ? CMD_CONTINUE : CMD_STALL;
}
static bool update_dte(GICv3ITSState *s, uint32_t devid, bool valid,
--
2.25.1
- [PULL 21/38] hw/arm/virt: Drop superfluous checks against highmem, (continued)
- [PULL 21/38] hw/arm/virt: Drop superfluous checks against highmem, Peter Maydell, 2022/01/20
- [PULL 24/38] hw/arm/aspeed: Add the i3c device to the AST2600 SoC, Peter Maydell, 2022/01/20
- [PULL 36/38] hw/intc/arm_gicv3_its: Check indexes before use, not after, Peter Maydell, 2022/01/20
- [PULL 28/38] hw/intc/arm_gicv3_its: Don't use data if reading command failed, Peter Maydell, 2022/01/20
- [PULL 30/38] hw/intc/arm_gicv3_its: Fix return codes in process_its_cmd(), Peter Maydell, 2022/01/20
- [PULL 19/38] hw/arm/virt: Use the PA range to compute the memory map, Peter Maydell, 2022/01/20
- [PULL 27/38] hw/intc/arm_gicv3_its: Fix handling of process_its_cmd() return value, Peter Maydell, 2022/01/20
- [PULL 25/38] hw/intc/arm_gicv3_its: Fix event ID bounds checks, Peter Maydell, 2022/01/20
- [PULL 26/38] hw/intc/arm_gicv3_its: Convert int ID check to num_intids convention, Peter Maydell, 2022/01/20
- [PULL 32/38] hw/intc/arm_gicv3_its: Fix return codes in process_mapti(), Peter Maydell, 2022/01/20
- [PULL 33/38] hw/intc/arm_gicv3_its: Fix return codes in process_mapc(),
Peter Maydell <=
- [PULL 37/38] hw/intc/arm_gicv3_its: Range-check ICID before indexing into collection table, Peter Maydell, 2022/01/20
- [PULL 38/38] hw/intc/arm_gicv3: Check for !MEMTX_OK instead of MEMTX_ERROR, Peter Maydell, 2022/01/20