From b8dfb6b1be7001e8dc00e5bc9e6efb85a5e0f4ab Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 7 Dec 2011 21:07:19 +0800 Subject: [PATCH] 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. --- sys/platform/pc64/apic/ioapic_abi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/platform/pc64/apic/ioapic_abi.c b/sys/platform/pc64/apic/ioapic_abi.c index b18c8b452c..d7f180fd38 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", -- 2.41.0