From: Sepherosa Ziehau Date: Wed, 7 Dec 2011 13:07:19 +0000 (+0800) Subject: x86_64/ioapic: Always allow user to specify GSI's target CPU X-Git-Tag: v3.0.0~460 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/b8dfb6b1be7001e8dc00e5bc9e6efb85a5e0f4ab x86_64/ioapic: Always allow user to specify GSI's target CPU Even if interrupt automatic load balance is disable we still should obey the explicit GSI target CPU configuration. --- diff --git a/sys/platform/pc64/apic/ioapic_abi.c b/sys/platform/pc64/apic/ioapic_abi.c index b18c8b4..d7f180f 100644 --- a/sys/platform/pc64/apic/ioapic_abi.c +++ b/sys/platform/pc64/apic/ioapic_abi.c @@ -990,9 +990,6 @@ ioapic_abi_gsi_cpuid(int irq, int gsi) KKASSERT(gsi >= 0); - if (!ioapic_abi_gsi_balance) - return 0; - if (irq == 0 || gsi == 0) { if (bootverbose) { kprintf("IOAPIC: irq %d, gsi %d -> cpu0 (0)\n", @@ -1013,6 +1010,14 @@ ioapic_abi_gsi_cpuid(int irq, int gsi) kgetenv_int(envpath, &cpuid); if (cpuid < 0) { + if (!ioapic_abi_gsi_balance) { + if (bootverbose) { + kprintf("IOAPIC: irq %d, gsi %d -> cpu0 " + "(fixed)\n", irq, gsi); + } + return 0; + } + cpuid = gsi % ncpus; if (bootverbose) { kprintf("IOAPIC: irq %d, gsi %d -> cpu%d (auto)\n",