]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/intc/arm_gicv3_cpuif: handle LPIs in in the list registers
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 9 Jan 2024 14:43:44 +0000 (14:43 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 11 Jan 2024 17:59:38 +0000 (20:59 +0300)
commit6eb6bca73f54e7d88f7a705abf727fdcc9e51c9a
treee735dc7d226611cef7d5fc80645f73ec55f93eeb
parent97d3be7bca49708a797b0a961b2a4dd99030910f
hw/intc/arm_gicv3_cpuif: handle LPIs in in the list registers

The hypervisor can deliver (virtual) LPIs to a guest by setting up a
list register to have an intid which is an LPI.  The GIC has to treat
these a little differently to standard interrupt IDs, because LPIs
have no Active state, and so the guest will only EOI them, it will
not also deactivate them.  So icv_eoir_write() must do two things:

 * if the LPI ID is not in any list register, we drop the
   priority but do not increment the EOI count
 * if the LPI ID is in a list register, we immediately deactivate
   it, regardless of the split-drop-and-deactivate control

This can be seen in the VirtualWriteEOIR0() and VirtualWriteEOIR1()
pseudocode in the GICv3 architecture specification.

Without this fix, potentially a hypervisor guest might stall because
LPIs get stuck in a bogus Active+Pending state.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Miguel Luis <miguel.luis@oracle.com>
(cherry picked from commit 82a65e3188abebb509510b391726711606aca642)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/intc/arm_gicv3_cpuif.c