riscv: plic: Add a couple of mising sifive_plic_update calls
commit55765822804f5a58594e0931e0fb8f80337b5425
authorJessica Clarke <jrtc27@jrtc27.com>
Thu, 18 Jun 2020 21:06:49 +0000 (18 22:06 +0100)
committerAlistair Francis <alistair.francis@wdc.com>
Thu, 2 Jul 2020 16:19:32 +0000 (2 09:19 -0700)
tree073b69f575b694e28b6694d485355abff623b2e8
parentaa4d30f6618dcaf033c4294ca219ef17a6bae69f
riscv: plic: Add a couple of mising sifive_plic_update calls

Claiming an interrupt and changing the source priority both potentially
affect whether an interrupt is pending, thus we must re-compute xEIP.
Note that we don't put the sifive_plic_update inside sifive_plic_claim
so that the logging of a claim (and the resulting IRQ) happens before
the state update, making the causal effect clear, and that we drop the
explicit call to sifive_plic_print_state when claiming since
sifive_plic_update already does that automatically at the end for us.

This can result in both spurious interrupt storms if you fail to
complete an IRQ before enabling interrupts (and no other actions occur
that result in a call to sifive_plic_update), but also more importantly
lost interrupts if a disabled interrupt is pending and then becomes
enabled.

Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20200618210649.22451-1-jrtc27@jrtc27.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/sifive_plic.c