[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 20/26] hw/intc/arm_gicv3_its: Use enum for return value of pr
Re: [PATCH 20/26] hw/intc/arm_gicv3_its: Use enum for return value of process_* functions
Sun, 12 Dec 2021 13:06:45 -0800
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0
On 12/11/21 11:11 AM, Peter Maydell wrote:
When an ITS detects an error in a command, it has an
implementation-defined (CONSTRAINED UNPREDICTABLE) choice of whether
to ignore the command, proceeding to the next one in the queue, or to
stall the ITS command queue, processing nothing further. The
behaviour required when the read of the command packet from memory
fails is less clearly documented, but the same set of choices as for
command errors seem reasonable.
The intention of the QEMU implementation, as documented in the
comments, is that if we encounter a memory error reading the command
packet or one of the various data tables then we should stall, but
for command parameter errors we should ignore the queue and continue.
However, we don't actually do this. To get the desired behaviour,
the various process_* functions need to return true to cause
process_cmdq() to advance to the next command and keep processing,
and false to stall command processing. What they mostly do is return
false for any kind of error.
To make the code clearer, replace the 'bool' return from the process_
functions with an enum which may be either CMD_STALL or CMD_CONTINUE.
In this commit no behaviour changes; in subsequent commits we will
adjust the error-return paths for the process_ functions one by one.
Signed-off-by: Peter Maydell <email@example.com>
hw/intc/arm_gicv3_its.c | 59 ++++++++++++++++++++++++++---------------
1 file changed, 38 insertions(+), 21 deletions(-)
Reviewed-by: Richard Henderson <firstname.lastname@example.org>
- Re: [PATCH 09/26] hw/intc/arm_gicv3_its: Correct handling of MAPI, (continued)
- [PATCH 17/26] hw/intc/arm_gicv3_its: Convert int ID check to num_intids convention, Peter Maydell, 2021/12/11
- [PATCH 21/26] hw/intc/arm_gicv3_its: Fix return codes in process_its_cmd(), Peter Maydell, 2021/12/11
- [PATCH 08/26] hw/intc/arm_gicv3_its: Don't misuse GITS_TYPE_PHYSICAL define, Peter Maydell, 2021/12/11
- [PATCH 20/26] hw/intc/arm_gicv3_its: Use enum for return value of process_* functions, Peter Maydell, 2021/12/11
- [PATCH 26/26] hw/intc/arm_gicv3_its: Factor out "find address of table entry" code, Peter Maydell, 2021/12/11
- [PATCH 24/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapc(), Peter Maydell, 2021/12/11
- [PATCH 25/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapd(), Peter Maydell, 2021/12/11