• Paolo Bonzini's avatar
    apic: fix incorrect handling of ExtINT interrupts wrt processor priority · 5224c88d
    Paolo Bonzini authored
    This fixes another failure with ExtINT, demonstrated by QNX.  The failure
    mode is as follows:
    - IPI sent to cpu 0 (bit set in APIC irr)
    - IPI accepted by cpu 0 (bit cleared in irr, set in isr)
    - IPI sent to cpu 0 (bit set in both irr and isr)
    - PIC interrupt sent to cpu 0
    
    The PIC interrupt causes CPU_INTERRUPT_HARD to be set, but
    apic_irq_pending observes that the highest pending APIC interrupt priority
    (the IPI) is the same as the processor priority (since the IPI is still
    being handled), so apic_get_interrupt returns a spurious interrupt rather
    than the pending PIC interrupt. The result is an endless sequence of
    spurious interrupts, since nothing will clear CPU_INTERRUPT_HARD.
    
    Instead, ExtINT interrupts should have ignored the processor priority.
    Calling apic_check_pic early in apic_get_interrupt ensures that
    apic_deliver_pic_intr is called instead of delivering the spurious
    interrupt.  apic_deliver_pic_intr then clears CPU_INTERRUPT_HARD if needed.
    Reported-by: 's avatarRichard Bilson <rbilson@qnx.com>
    Tested-by: 's avatarRichard Bilson <rbilson@qnx.com>
    Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
    5224c88d
Name
Last commit
Last update
..
9pfs Loading commit data...
acpi Loading commit data...
alpha Loading commit data...
arm Loading commit data...
audio Loading commit data...
block Loading commit data...
bt Loading commit data...
char Loading commit data...
core Loading commit data...
cpu Loading commit data...
cris Loading commit data...
display Loading commit data...
dma Loading commit data...
gpio Loading commit data...
i2c Loading commit data...
i386 Loading commit data...
ide Loading commit data...
input Loading commit data...
intc Loading commit data...
ipack Loading commit data...
isa Loading commit data...
lm32 Loading commit data...
m68k Loading commit data...
mem Loading commit data...
microblaze Loading commit data...
mips Loading commit data...
misc Loading commit data...
moxie Loading commit data...
net Loading commit data...
nvram Loading commit data...
openrisc Loading commit data...
pci Loading commit data...
pci-bridge Loading commit data...
pci-host Loading commit data...
pcmcia Loading commit data...
ppc Loading commit data...
s390x Loading commit data...
scsi Loading commit data...
sd Loading commit data...
sh4 Loading commit data...
sparc Loading commit data...
sparc64 Loading commit data...
ssi Loading commit data...
timer Loading commit data...
tpm Loading commit data...
tricore Loading commit data...
unicore32 Loading commit data...
usb Loading commit data...
virtio Loading commit data...
watchdog Loading commit data...
xen Loading commit data...
xenpv Loading commit data...
xtensa Loading commit data...
Makefile.objs Loading commit data...