]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/intc/arm_gicv3_its: Correct handling of MAPI
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 7 Jan 2022 17:07:59 +0000 (17:07 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 7 Jan 2022 17:07:59 +0000 (17:07 +0000)
commitb87fab1c8e8977e8ea1233bafdbfa37090eefabf
treed0391de612f7864b90d126160e9f139d01fd40fc
parent764d6ba10cce25d20ef9f3e11a83a9783dadf65f
hw/intc/arm_gicv3_its: Correct handling of MAPI

The MAPI command takes arguments DeviceID, EventID, ICID, and is
defined to be equivalent to MAPTI DeviceID, EventID, EventID, ICID.
(That is, where MAPTI takes an explicit pINTID, MAPI uses the EventID
as the pINTID.)

We didn't quite get this right.  In particular the error checks for
MAPI include "EventID does not specify a valid LPI identifier", which
is the same as MAPTI's error check for the pINTID field.  QEMU's code
skips the pINTID error check entirely in the MAPI case.

We can fix this bug and in the process simplify the code by switching
to the obvious implementation of setting pIntid = eventid early
if ignore_pInt is true.

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