Skip to content

Commit bb833dd

Browse files
committed
core: do not acknowledge end of interrupt for special GIC interrupt IDs
According to the ARM documentation for GICV2/3/4, there is no need to write to the end of interrupt register for some special IDs. Apply this recommendation to avoid writing to IO memory in this time sensitive sequence. Also distinguish unhandled interrupts with an error log. Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
1 parent 38dd964 commit bb833dd

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

core/drivers/gic.c

+26-1
Original file line numberDiff line numberDiff line change
@@ -948,10 +948,35 @@ static void __maybe_unused gic_native_itr_handler(void)
948948
iar = gic_read_iar(gd);
949949
id = iar & GICC_IAR_IT_ID_MASK;
950950

951+
if (id >= 1020 && id <= 1023) {
952+
/*
953+
* Special INTIDs
954+
* 1020: Interrupt expected to be handled at SEL1 or SEL2.
955+
* PE (Processing Element) is either executing at EL3
956+
* in AArch64 state or in monitor mode in AArch32 state.
957+
* Reserved on GIC V1 and GIC V2.
958+
* 1021: Interrupt expected to be handled at NSEL1 or NSEL2
959+
* PE (Processing Element) is either executing at EL3
960+
* in AArch64 state or in monitor mode in AArch32 state.
961+
* Reserved on GIC V1 and GIC V2.
962+
* 1022: -(GICv3.3): Interrupt is an NMI
963+
* -(Legacy): Group 1 interrupt to be signaled to the
964+
* PE and acknowledged using alias registers. Reserved if
965+
* interrupt grouping is not supported.
966+
* 1023: No pending interrupt with sufficient priority
967+
* (spurious) or the highest priority pending interrupt is
968+
* not appropriate for the current security state or
969+
* interrupt group.
970+
*/
971+
DMSG("Special interrupt %"PRIu32, id);
972+
973+
return;
974+
}
975+
951976
if (id <= gd->max_it)
952977
interrupt_call_handlers(&gd->chip, id);
953978
else
954-
DMSG("ignoring interrupt %" PRIu32, id);
979+
EMSG("Unhandled interrupt %"PRIu32, id);
955980

956981
gic_write_eoir(gd, iar);
957982
}

0 commit comments

Comments
 (0)