x86_64/ioapic: Always allow user to specify GSI's target CPU
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 7 Dec 2011 13:07:19 +0000 (21:07 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 7 Dec 2011 13:20:37 +0000 (21:20 +0800)
Even if interrupt automatic load balance is disable we still should
obey the explicit GSI target CPU configuration.

sys/platform/pc64/apic/ioapic_abi.c

index b18c8b4..d7f180f 100644 (file)
@@ -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",