OSDN Git Service

intc/ibex_plic: Ensure we don't loose interrupts
authorAlistair Francis <alistair.francis@wdc.com>
Wed, 11 Nov 2020 23:13:24 +0000 (15:13 -0800)
committerAlistair Francis <alistair.francis@wdc.com>
Sat, 14 Nov 2020 05:43:48 +0000 (21:43 -0800)
commitdeef3d2568a7fbaa62d9bee07708cf3a4dc3ac53
tree77551af72cda7c437999ddfe2255447905e33501
parent3a129aea81f8875d510283ddef35bc614c524892
intc/ibex_plic: Ensure we don't loose interrupts

If an interrupt occurs between when we claim and complete an interrupt
we currently drop the interrupt in ibex_plic_irqs_set_pending(). This
somewhat matches hardware that also ignore the interrupt between the
claim and complete process.

In the case of hardware though the physical interrupt line will still
be asserted after we have completed the interrupt. This means we will
still act on the interrupt after the complete process. In QEMU we don't
and instead we drop the interrupt as it is never recorded.

This patch changed the behaviour of the Ibex PLIC so that we save all
interrupts that occur while we are between claiming and completing an
interrupt so that we can act on them after the completition process.

This fixes interrupts being dropped when running Tock on OpenTitain in
QEMU.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: e7bcf98c6925b1e6e7828e7c3f85293a09a65b12.1605136387.git.alistair.francis@wdc.com
hw/intc/ibex_plic.c
include/hw/intc/ibex_plic.h