freebsd-skq/sys/x86
kib 46a27978f5 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
2015-02-26 11:02:40 +00:00
..
acpica For now, disable x2APIC mode when Xen is detected, even if CPU 2015-02-25 16:44:07 +00:00
bios Add missing header needed by free(9). 2012-09-30 15:42:20 +00:00
cpufreq Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
include Implements EOI suppression mode, where LAPIC on EOI command for 2015-02-26 11:02:40 +00:00
iommu Revert r276949 and redo the fix for PCIe/PCI bridges, which do not 2015-02-21 22:38:32 +00:00
isa Include mca_machdep.h. 2015-01-18 03:43:47 +00:00
pci Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
x86 Implements EOI suppression mode, where LAPIC on EOI command for 2015-02-26 11:02:40 +00:00
xen xen/intr: improve handling of legacy IRQs 2015-02-16 16:37:59 +00:00