summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-03-14 03:44:42 +0000
committerjhb <jhb@FreeBSD.org>2008-03-14 03:44:42 +0000
commit8293fe75e4b3bd42c01e5eea1ac0676aaa9e32ff (patch)
tree0539e1bf56f5c42c288a9ba19d0f35d00d2fb908 /sys/amd64
parentb599192a00b016b82d8487d33f78870c79a1b831 (diff)
downloadFreeBSD-src-8293fe75e4b3bd42c01e5eea1ac0676aaa9e32ff.zip
FreeBSD-src-8293fe75e4b3bd42c01e5eea1ac0676aaa9e32ff.tar.gz
Fix a silly bogon which prevented all the CPUs that are tagged as interrupt
receivers from being given interrupts if any CPUs in the system were not tagged as interrupt receivers that I introduced when switching the x86 interrupt code to track CPUs via FreeBSD CPU IDs rather than local APIC IDs. In practice this only affects systems with Hyperthreading (though disabling HTT in the BIOS would workaround the issue) as that is the only case currently where one can have CPUs that aren't tagged as interrupt receivers. On a Dell SC1425 test box with 2 x Xeon w/ HTT (so 4 logical CPUs of which 2 were interrupt receivers) the result was that all device interrupts were sent to CPU 0. MFC after: 1 week Pointy hat to: jhb
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/intr_machdep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/amd64/amd64/intr_machdep.c b/sys/amd64/amd64/intr_machdep.c
index 9e151ff..7efc7ac 100644
--- a/sys/amd64/amd64/intr_machdep.c
+++ b/sys/amd64/amd64/intr_machdep.c
@@ -48,6 +48,7 @@
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/smp.h>
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/sx.h>
@@ -536,7 +537,7 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
/* The BSP is always a valid target. */
static cpumask_t intr_cpus = (1 << 0);
-static int current_cpu, num_cpus = 1;
+static int current_cpu;
static void
intr_assign_next_cpu(struct intsrc *isrc)
@@ -552,7 +553,7 @@ intr_assign_next_cpu(struct intsrc *isrc)
pic->pic_assign_cpu(isrc, apic_id);
do {
current_cpu++;
- if (current_cpu >= num_cpus)
+ if (current_cpu > mp_maxid)
current_cpu = 0;
} while (!(intr_cpus & (1 << current_cpu)));
}
@@ -572,7 +573,6 @@ intr_add_cpu(u_int cpu)
cpu_apic_ids[cpu]);
intr_cpus |= (1 << cpu);
- num_cpus++;
}
/*
@@ -586,7 +586,7 @@ intr_shuffle_irqs(void *arg __unused)
int i;
/* Don't bother on UP. */
- if (num_cpus <= 1)
+ if (mp_ncpus == 1)
return;
/* Round-robin assign a CPU to each enabled source. */
OpenPOWER on IntegriCloud