[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 25/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapd()
From: |
Peter Maydell |
Subject: |
[PATCH 25/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapd() |
Date: |
Sat, 11 Dec 2021 19:11:34 +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>
---
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 7615e9aa279..3bcc4c3db85 100644
--- a/hw/intc/arm_gicv3_its.c
+++ b/hw/intc/arm_gicv3_its.c
@@ -595,7 +595,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);
@@ -604,7 +603,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);
@@ -614,7 +613,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;
@@ -631,11 +630,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 02/26] hw/intc/arm_gicv3_its: Correct off-by-one bounds check on rdbase, (continued)
- [PATCH 02/26] hw/intc/arm_gicv3_its: Correct off-by-one bounds check on rdbase, Peter Maydell, 2021/12/11
- [PATCH 04/26] hw/intc/arm_gicv3_its: Remove maxids union from TableDesc, Peter Maydell, 2021/12/11
- [PATCH 03/26] hw/intc/arm_gicv3_its: Remove redundant ITS_CTLR_ENABLED define, Peter Maydell, 2021/12/11
- [PATCH 25/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapd(),
Peter Maydell <=
- [PATCH 06/26] hw/intc/arm_gicv3_its: Reduce code duplication in extract_table_params(), Peter Maydell, 2021/12/11
- [PATCH 15/26] hw/intc/arm_gicv3_its: Rename max_l2_entries to num_l2_entries, Peter Maydell, 2021/12/11