diff options
author | peter <peter@FreeBSD.org> | 2005-10-26 22:32:30 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2005-10-26 22:32:30 +0000 |
commit | 4553fefa7249ebfd8c2aaa908d86ddd2bf200b94 (patch) | |
tree | 98ef979a07a71fdf61dde28c5eb4857737736b71 /sys/amd64 | |
parent | 5ac29c381d7101af937dab4068b1571b5be524eb (diff) | |
download | FreeBSD-src-4553fefa7249ebfd8c2aaa908d86ddd2bf200b94.zip FreeBSD-src-4553fefa7249ebfd8c2aaa908d86ddd2bf200b94.tar.gz |
MFi386: Various apic fixes and tweaks
* Don't recursively panic if we've already paniced and the local apic is
now stuck.
* Add hw.apic.* tunables/sysctls for extint controls
* Change "lapic%d timer" to "cpu%d timer" intname to match i386
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/io_apic.c | 14 | ||||
-rw-r--r-- | sys/amd64/amd64/local_apic.c | 12 |
2 files changed, 20 insertions, 6 deletions
diff --git a/sys/amd64/amd64/io_apic.c b/sys/amd64/amd64/io_apic.c index 016bd61..32d25e2 100644 --- a/sys/amd64/amd64/io_apic.c +++ b/sys/amd64/amd64/io_apic.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/lock.h> #include <sys/mutex.h> +#include <sys/sysctl.h> #include <vm/vm.h> #include <vm/pmap.h> @@ -130,6 +131,12 @@ struct pic ioapic_template = { ioapic_enable_source, ioapic_disable_source, static int bsp_id, current_cluster, logical_clusters, next_ioapic_base; static u_int next_id, program_logical_dest; +SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); +static int enable_extint; +SYSCTL_INT(_hw_apic, OID_AUTO, enable_extint, CTLFLAG_RDTUN, &enable_extint, 0, + "Enable the ExtINT pin in the first I/O APIC"); +TUNABLE_INT("hw.apic.enable_extint", &enable_extint); + static __inline void _ioapic_eoi_source(struct intsrc *isrc) { @@ -287,7 +294,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin) switch (intpin->io_vector) { case VECTOR_EXTINT: KASSERT(intpin->io_edgetrigger, - ("EXTINT not edge triggered")); + ("ExtINT not edge triggered")); low |= IOART_DELEXINT; break; case VECTOR_NMI: @@ -681,7 +688,10 @@ ioapic_set_extint(void *cookie, u_int pin) return (EINVAL); io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN; io->io_pins[pin].io_vector = VECTOR_EXTINT; - io->io_pins[pin].io_masked = 1; + if (enable_extint) + io->io_pins[pin].io_masked = 0; + else + io->io_pins[pin].io_masked = 1; io->io_pins[pin].io_edgetrigger = 1; io->io_pins[pin].io_activehi = 1; if (bootverbose) diff --git a/sys/amd64/amd64/local_apic.c b/sys/amd64/amd64/local_apic.c index 9ae15e9..44f8e1a 100644 --- a/sys/amd64/amd64/local_apic.c +++ b/sys/amd64/amd64/local_apic.c @@ -312,7 +312,7 @@ lapic_setup(void) /* Program timer LVT and setup handler. */ lapic->lvt_timer = lvt_mode(la, LVT_TIMER, lapic->lvt_timer); - snprintf(buf, sizeof(buf), "lapic%d: timer", lapic_id()); + snprintf(buf, sizeof(buf), "cpu%d: timer", PCPU_GET(cpuid)); intrcnt_add(buf, &la->la_timer_count); if (PCPU_GET(cpuid) != 0) { KASSERT(lapic_timer_period != 0, ("lapic%u: zero divisor", @@ -322,7 +322,7 @@ lapic_setup(void) lapic_timer_enable_intr(); } - /* XXX: Performance counter, error, and thermal LVTs */ + /* XXX: Error and thermal LVTs */ intr_restore(eflags); } @@ -927,8 +927,12 @@ lapic_ipi_vectored(u_int vector, int dest) } /* Wait for an earlier IPI to finish. */ - if (!lapic_ipi_wait(BEFORE_SPIN)) - panic("APIC: Previous IPI is stuck"); + if (!lapic_ipi_wait(BEFORE_SPIN)) { + if (panicstr != NULL) + return; + else + panic("APIC: Previous IPI is stuck"); + } lapic_ipi_raw(icrlo, destfield); |