diff options
author | kib <kib@FreeBSD.org> | 2015-02-26 11:02:40 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-02-26 11:02:40 +0000 |
commit | 46a27978f548e4c5d2a47dfdfeaa8060952efb86 (patch) | |
tree | 0a81c2c3338ae5b4cefd0bb715bdbe37ca6c28dd /sys/x86/include/apicvar.h | |
parent | 568d7afbb3a2c5c6316a1011486e10c712ec4532 (diff) | |
download | FreeBSD-src-46a27978f548e4c5d2a47dfdfeaa8060952efb86.zip FreeBSD-src-46a27978f548e4c5d2a47dfdfeaa8060952efb86.tar.gz |
Implements EOI suppression mode, where LAPIC on EOI command for
level-triggered interrupt does not broadcast the EOI message to all
APICs in the system. Instead, interrupt handler must follow LAPIC EOI
with IOAPIC EOI. For modern IOAPICs, the later is done by writing to
EOIR register. Otherwise, Intel provided Linux with a trick of
temporary switching the pin config to edge and then back to level.
Detect presence of EOIR register by reading IO-APIC version. The
summary table in the comments was taken from the Linux kernel. For
Intel, newer IO-APICs are only briefly documented as part of the
ICH/PCH datasheet. According to the BKDG and chipset documentation,
AMD LAPICs do not provide EOI suppression, althought IO-APICs do
declare version 0x21 and implement EOIR.
The trick to temporary switch pin to edge mode to clear IRR was tested
on modern chipset, by pretending that EOIR is not present, i.e. by
forcing io_haseoi to zero.
Tunable hw.lapic_eoi_suppression disables the optimization.
Reviewed by: neel
Tested by: pho
Review: https://reviews.freebsd.org/D1943
Sponsored by: The FreeBSD Foundation
MFC after: 2 months
Diffstat (limited to 'sys/x86/include/apicvar.h')
-rw-r--r-- | sys/x86/include/apicvar.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h index f7dfec8..22fe1f3 100644 --- a/sys/x86/include/apicvar.h +++ b/sys/x86/include/apicvar.h @@ -426,6 +426,7 @@ void lapic_handle_timer(struct trapframe *frame); void xen_intr_handle_upcall(struct trapframe *frame); extern int x2apic_mode; +extern int lapic_eoi_suppression; #ifdef _SYS_SYSCTL_H_ SYSCTL_DECL(_hw_apic); |