[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 34/38] hw/intc/arm_gicv3_its: Fix return codes in process_mapd()
|
From: |
Peter Maydell |
|
Subject: |
[PULL 34/38] hw/intc/arm_gicv3_its: Fix return codes in process_mapd() |
|
Date: |
Thu, 20 Jan 2022 12:36:26 +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>
Message-id: 20220111171048.3545974-11-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 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
- [PULL 01/38] hw/arm/virt: KVM: Enable PAuth when supported by the host, (continued)
- [PULL 01/38] hw/arm/virt: KVM: Enable PAuth when supported by the host, Peter Maydell, 2022/01/20
- [PULL 09/38] hw/acpi/aml-build: Support cluster level in PPTT generation, Peter Maydell, 2022/01/20
- [PULL 17/38] hw/arm/virt: Add a control for the the highmem redistributors, Peter Maydell, 2022/01/20
- [PULL 08/38] tests/acpi/bios-tables-test: Allow changes to virt/PPTT file, Peter Maydell, 2022/01/20
- [PULL 02/38] hw: Move MARVELL_88W8618 Kconfig from audio/ to arm/, Peter Maydell, 2022/01/20
- [PULL 12/38] virtio-mem: Correct default THP size for ARM64, Peter Maydell, 2022/01/20
- [PULL 14/38] hw/intc/arm_gic: Implement read of GICC_IIDR, Peter Maydell, 2022/01/20
- [PULL 23/38] hw/misc/aspeed_i3c.c: Introduce a dummy AST2600 I3C model., Peter Maydell, 2022/01/20
- [PULL 35/38] hw/intc/arm_gicv3_its: Factor out "find address of table entry" code, Peter Maydell, 2022/01/20
- [PULL 18/38] hw/arm/virt: Honor highmem setting when computing the memory map, Peter Maydell, 2022/01/20
- [PULL 34/38] hw/intc/arm_gicv3_its: Fix return codes in process_mapd(),
Peter Maydell <=
- [PULL 31/38] hw/intc/arm_gicv3_its: Refactor process_its_cmd() to reduce nesting, Peter Maydell, 2022/01/20
- [PULL 20/38] hw/arm/virt: Disable highmem devices that don't fit in the PA range, Peter Maydell, 2022/01/20
- [PULL 22/38] hw/arm: kudo add lm75s behind bus 1 switch at 75, Peter Maydell, 2022/01/20
- [PULL 29/38] hw/intc/arm_gicv3_its: Use enum for return value of process_* functions, Peter Maydell, 2022/01/20
- [PULL 07/38] hw/acpi/aml-build: Improve scalability of PPTT generation, Peter Maydell, 2022/01/20
- [PULL 06/38] hw/arm/virt: Support cluster level in DT cpu-map, Peter Maydell, 2022/01/20
- [PULL 04/38] hw/net: Move MV88W8618 network device out of hw/arm/ directory, Peter Maydell, 2022/01/20
- [PULL 03/38] hw/arm/musicpal: Fix coding style of code related to MV88W8618 device, Peter Maydell, 2022/01/20
- [PULL 16/38] hw/arm/virt: Add a control for the the highmem PCIe MMIO, Peter Maydell, 2022/01/20
- [PULL 13/38] hw/arm/virt: Support for virtio-mem-pci, Peter Maydell, 2022/01/20