]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
After the per-CPU IDT changes, the IDT vector of an interrupt could change
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 6 Jul 2009 18:23:00 +0000 (18:23 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Mon, 6 Jul 2009 18:23:00 +0000 (18:23 +0000)
commit0d0a6650d72bca6302d5fd58462f4c79125a57b6
tree0c5709f0797fbc1c83a128c84f9462577347f99d
parentf7d7cd0c769741e79430719053fe9044254901a7
After the per-CPU IDT changes, the IDT vector of an interrupt could change
when the interrupt was moved from one CPU to another.  If the interrupt was
enabled, then the old IDT vector needs to be disabled and the new IDT vector
needs to be enabled.  This was mostly masked prior to the recent MSI changes
since in the older code almost all allocated IDT vectors were already enabled
and the enabled vectors on the BSP during boot covered enough of the IDT
range.  However, after the MSI changes, MSI interrupts that were allocated
but not enabled (e.g. DRM with MSI) during boot could result in an allocated
IDT vector that wasn't enabled.  The round-robin at the end of boot could
place another interrupt at the same IDT vector without enabling the IDT
vector causing trap 30 faults.

Fix this by explicitly disabling/enabling the old and new IDT vectors for
enabled interrupt sources when moving an interrupt between CPUs via the
pic_assign_cpu() method.  While here, fix a bug in my earlier changes so
that an I/O APIC interrupt pin is left unchanged if ioapic_assign_cpu()
fails to allocate a new IDT vector and returns ENOSPC.

Approved by: re (kensmith)
sys/amd64/amd64/io_apic.c
sys/amd64/amd64/msi.c
sys/i386/i386/io_apic.c
sys/i386/i386/msi.c