apic: Resolve potential endless loop around apic_update_irq
commit3db3659bf60094657e1465cc809acb09551816ee
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 9 Jul 2012 14:42:30 +0000 (9 16:42 +0200)
committerAvi Kivity <avi@redhat.com>
Tue, 10 Jul 2012 08:31:04 +0000 (10 11:31 +0300)
treefd73a6f5194f5d7e322c1a15a3f571fcc86144b0
parenta75b3e0f641a68b7cdd4bbe4ed1b60f963bf2b62
apic: Resolve potential endless loop around apic_update_irq

Commit d96e173769 refactored the reinjection of pending PIC interrupts.
However, it missed the potential loop of apic_update_irq ->
apic_deliver_pic_intr -> apic_local_deliver -> apic_set_irq ->
apic_update_irq that /could/ occur if LINT0 is injected as APIC_DM_FIXED
and that vector is currently blocked via TPR.

Resolve this by reinjecting only where it matters: inside
apic_get_interrupt. This function may clear a vector while a
PIC-originated reason still exists.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
hw/apic.c