[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/13] hw/intc/arm_gicv3_its: Fix return codes in process_mapd
From: |
Peter Maydell |
Subject: |
[PATCH v2 10/13] hw/intc/arm_gicv3_its: Fix return codes in process_mapd() |
Date: |
Tue, 11 Jan 2022 17:10:45 +0000 |
Fix process_mapd() 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>
---
hw/intc/arm_gicv3_its.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c
index 80ef4dbcadf..917201c148f 100644
--- a/hw/intc/arm_gicv3_its.c
+++ b/hw/intc/arm_gicv3_its.c
@@ -597,7 +597,6 @@ static ItsCmdResult process_mapd(GICv3ITSState *s, uint64_t
value,
uint64_t itt_addr;
bool valid;
MemTxResult res = MEMTX_OK;
- ItsCmdResult result = CMD_STALL;
devid = ((value & DEVID_MASK) >> DEVID_SHIFT);
@@ -606,7 +605,7 @@ static ItsCmdResult process_mapd(GICv3ITSState *s, uint64_t
value,
MEMTXATTRS_UNSPECIFIED, &res);
if (res != MEMTX_OK) {
- return result;
+ return CMD_STALL;
}
size = (value & SIZE_MASK);
@@ -616,7 +615,7 @@ static ItsCmdResult process_mapd(GICv3ITSState *s, uint64_t
value,
MEMTXATTRS_UNSPECIFIED, &res);
if (res != MEMTX_OK) {
- return result;
+ return CMD_STALL;
}
itt_addr = (value & ITTADDR_MASK) >> ITTADDR_SHIFT;
@@ -633,11 +632,10 @@ static ItsCmdResult process_mapd(GICv3ITSState *s,
uint64_t value,
* we ignore this command and move onto the next
* command in the queue
*/
- } else {
- result = update_dte(s, devid, valid, size, itt_addr) ? CMD_CONTINUE :
CMD_STALL;
+ return CMD_CONTINUE;
}
- return result;
+ return update_dte(s, devid, valid, size, itt_addr) ? CMD_CONTINUE :
CMD_STALL;
}
/*
--
2.25.1
- [PATCH v2 02/13] hw/intc/arm_gicv3_its: Convert int ID check to num_intids convention, (continued)
- [PATCH v2 02/13] hw/intc/arm_gicv3_its: Convert int ID check to num_intids convention, Peter Maydell, 2022/01/11
- [PATCH v2 01/13] hw/intc/arm_gicv3_its: Fix event ID bounds checks, Peter Maydell, 2022/01/11
- [PATCH v2 03/13] hw/intc/arm_gicv3_its: Fix handling of process_its_cmd() return value, Peter Maydell, 2022/01/11
- [PATCH v2 05/13] hw/intc/arm_gicv3_its: Use enum for return value of process_* functions, Peter Maydell, 2022/01/11
- [PATCH v2 07/13] hw/intc/arm_gicv3_its: Refactor process_its_cmd() to reduce nesting, Peter Maydell, 2022/01/11
- [PATCH v2 10/13] hw/intc/arm_gicv3_its: Fix return codes in process_mapd(),
Peter Maydell <=
- [PATCH v2 09/13] hw/intc/arm_gicv3_its: Fix return codes in process_mapc(), Peter Maydell, 2022/01/11
- [PATCH v2 11/13] hw/intc/arm_gicv3_its: Factor out "find address of table entry" code, Peter Maydell, 2022/01/11
- [PATCH v2 13/13] hw/intc/arm_gicv3_its: Range-check ICID before indexing into collection table, Peter Maydell, 2022/01/11
- [PATCH v2 12/13] hw/intc/arm_gicv3_its: Check indexes before use, not after, Peter Maydell, 2022/01/11
- Re: [PATCH v2 00/13] arm gicv3 ITS: Various bug fixes and refactorings, Alex Bennée, 2022/01/18