hw/intc/arm_gicv3_its: Don't allow intid 1023 in MAPI/MAPTI
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 1 Feb 2022 19:32:06 +0000 (19:32 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 8 Feb 2022 10:56:29 +0000 (10:56 +0000)
When handling MAPI/MAPTI, we allow the supplied interrupt ID to be
either 1023 or something in the valid LPI range.  This is a mistake:
only a real valid LPI is allowed.  (The general behaviour of the ITS
is that most interrupt ID fields require a value in the LPI range;
the exception is that fields specifying a doorbell value, which are
all in GICv4 commands, allow also 1023 to mean "no doorbell".)
Remove the condition that incorrectly allows 1023 here.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220201193207.2771604-13-peter.maydell@linaro.org

hw/intc/arm_gicv3_its.c

index 069991f7f3697f2c55a666a939ebbc6c006d6e1d..8dade9440ac2c1daeeab003aa57f93e9282360d7 100644 (file)
@@ -406,8 +406,7 @@ static ItsCmdResult process_mapti(GICv3ITSState *s, const uint64_t *cmdpkt,
 
     if ((icid >= s->ct.num_entries)
             || !dte.valid || (eventid >= num_eventids) ||
-            (((pIntid < GICV3_LPI_INTID_START) || (pIntid >= num_intids)) &&
-             (pIntid != INTID_SPURIOUS))) {
+            (((pIntid < GICV3_LPI_INTID_START) || (pIntid >= num_intids)))) {
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: invalid command attributes "
                       "icid %d or eventid %d or pIntid %d or"