diff --git a/sys/amd64/amd64/io_apic.c b/sys/amd64/amd64/io_apic.c index 016bd618478..32d25e29671 100644 --- a/sys/amd64/amd64/io_apic.c +++ b/sys/amd64/amd64/io_apic.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -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 9ae15e9f5e4..44f8e1a1c50 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);