Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ioapic: Don't allow interrupt source overrides to GSI 0 (ExtINT)

  • Loading branch information...
commit 7eb6fb7eede3c7887626da4ae87ebb8716dca8f2 1 parent b7fa882
Sepherosa Ziehau authored
View
8 sys/platform/pc32/apic/mpapic.c
@@ -1267,7 +1267,15 @@ ioapic_add(void *addr, int gsi_base, int npin)
void
ioapic_intsrc(int irq, int gsi)
{
+ KKASSERT(irq != gsi);
KKASSERT(irq < 16);
+
+ if (gsi == 0) {
+ /* Don't allow mixed mode */
+ kprintf("IOAPIC: warning intsrc irq %d -> gsi 0\n", irq);
+ return;
+ }
+
if (ioapic_conf.ioc_intsrc[irq] != -1 &&
ioapic_conf.ioc_intsrc[irq] != gsi) {
kprintf("IOAPIC: warning intsrc irq %d, gsi %d -> gsi %d\n",
View
8 sys/platform/pc64/apic/mpapic.c
@@ -1329,7 +1329,15 @@ ioapic_add(void *addr, int gsi_base, int npin)
void
ioapic_intsrc(int irq, int gsi)
{
+ KKASSERT(irq != gsi);
KKASSERT(irq < 16);
+
+ if (gsi == 0) {
+ /* Don't allow mixed mode */
+ kprintf("IOAPIC: warning intsrc irq %d -> gsi 0\n", irq);
+ return;
+ }
+
if (ioapic_conf.ioc_intsrc[irq] != -1 &&
ioapic_conf.ioc_intsrc[irq] != gsi) {
kprintf("IOAPIC: warning intsrc irq %d, gsi %d -> gsi %d\n",
Please sign in to comment.
Something went wrong with that request. Please try again.