intc/arm_gic: Implement virtualization extensions in gic_acknowledge_irq
commit439badd66d6f1bf82211f86131c7ce75d951756a
authorLuc Michel <luc.michel@greensocs.com>
Tue, 14 Aug 2018 16:17:20 +0000 (14 17:17 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 14 Aug 2018 16:17:20 +0000 (14 17:17 +0100)
treeae80a86e2dd17f260e645199df9a0bc28a1d7099
parenta1d7b8d896f98139dff177508895e55caf483f95
intc/arm_gic: Implement virtualization extensions in gic_acknowledge_irq

Implement virtualization extensions in the gic_acknowledge_irq()
function. This function changes the state of the highest priority IRQ
from pending to active.

When the current CPU is a vCPU, modifying the state of an IRQ modifies
the corresponding LR entry. However if we clear the pending flag before
setting the active one, we lose track of the LR entry as it becomes
invalid. The next call to gic_get_lr_entry() will fail.

To overcome this issue, we call gic_activate_irq() before
gic_clear_pending(). This does not change the general behaviour of
gic_acknowledge_irq.

We also move the SGI case in gic_clear_pending_sgi() to enhance
code readability as the virtualization extensions support adds a if-else
level.

Signed-off-by: Luc Michel <luc.michel@greensocs.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20180727095421.386-12-luc.michel@greensocs.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc/arm_gic.c