i386/ioapic: Always allow user to specify GSI's target CPU
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 13 Dec 2011 13:34:45 +0000 (21:34 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 13 Dec 2011 13:34:45 +0000 (21:34 +0800)
This merges b8dfb6b1be7001e8dc00e5bc9e6efb85a5e0f4ab

sys/platform/pc32/apic/ioapic_abi.c

index 55cff36..77110ae 100644 (file)
@@ -991,9 +991,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",
@@ -1014,6 +1011,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",