Skip to content
  • Jan Kiszka's avatar
    apic: Defer interrupt updates to VCPU thread · 5d62c43a
    Jan Kiszka authored
    
    
    KVM performs TPR raising asynchronously to QEMU, specifically outside
    QEMU's global lock. When an interrupt is injected into the APIC and TPR
    is checked to decide if this can be delivered, a stale TPR value may be
    used, causing spurious interrupts in the end.
    
    Fix this by deferring apic_update_irq to the context of the target VCPU.
    We introduce a new interrupt flag for this, CPU_INTERRUPT_POLL. When it
    is set, the VCPU calls apic_poll_irq before checking for further pending
    interrupts. To avoid special-casing KVM, we also implement this logic
    for TCG mode.
    
    Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    5d62c43a