]> rtime.felk.cvut.cz Git - jailhouse.git/commit
x86: Prevent getting stuck while trying to clear the APIC
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 24 Jul 2014 17:16:59 +0000 (19:16 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 3 Aug 2014 17:31:36 +0000 (19:31 +0200)
commit539bed2ffbaa7613644e591ad8fa03c5d66bbcd1
tree756da7125d627ea59c9ea16018609b5d5431a6a4
parent768fb1fd5e6dce603696abad6bd04b89adb1c2af
x86: Prevent getting stuck while trying to clear the APIC

If some interrupt source (typically a level-triggered IOAPIC pin)
continuously sends messages to the APIC we are trying to clear from
pending bits in ISR and IRR, we will get stuck in the hypervisor in an
interrupt storm.

Avoid this by limiting the number of handled interrupts to the number of
vectors we have. When reaching this limit, simply raise TPR to break out
of the loop. It's cleared again on exit from apic_clear, and the code
booting the CPU can handle the then pending interrupt itself. That's
almost like real hardware would behave (low-prio IRR bits may remain set
due to a stuck high-prio interrupt). However, only buggy SMP cells will
once be able to trigger this, IOAPIC pins of exitings cells will soon be
masked to prevent this scenario.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/x86/apic.c
hypervisor/arch/x86/control.c
hypervisor/arch/x86/include/asm/apic.h
hypervisor/arch/x86/include/asm/percpu.h