freebsd-dev/sys/conf
Konstantin Belousov 0a110d5b17 Use VT-d interrupt remapping block (IR) to perform FSB messages
translation.  In particular, despite IO-APICs only take 8bit apic id,
IR translation structures accept 32bit APIC Id, which allows x2APIC
mode to function properly.  Extend msi_cpu of struct msi_intrsrc and
io_cpu of ioapic_intsrc to full int from one byte.

KPI of IR is isolated into the x86/iommu/iommu_intrmap.h, to avoid
bringing all dmar headers into interrupt code. The non-PCI(e) devices
which generate message interrupts on FSB require special handling. The
HPET FSB interrupts are remapped, while DMAR interrupts are not.

For each msi and ioapic interrupt source, the iommu cookie is added,
which is in fact index of the IRE (interrupt remap entry) in the IR
table. Cookie is made at the source allocation time, and then used at
the map time to fill both IRE and device registers. The MSI
address/data registers and IO-APIC redirection registers are
programmed with the special values which are recognized by IR and used
to restore the IRE index, to find proper delivery mode and target.
Map all MSI interrupts in the block when msi_map() is called.

Since an interrupt source setup and dismantle code are done in the
non-sleepable context, flushing interrupt entries cache in the IR
hardware, which is done async and ideally waits for the interrupt,
requires busy-wait for queue to drain.  The dmar_qi_wait_for_seq() is
modified to take a boolean argument requesting busy-wait for the
written sequence number instead of waiting for interrupt.

Some interrupts are configured before IR is initialized, e.g. ACPI
SCI.  Add intr_reprogram() function to reprogram all already
configured interrupts, and call it immediately before an IR unit is
enabled.  There is still a small window after the IO-APIC redirection
entry is reprogrammed with cookie but before the unit is enabled, but
to fix this properly, IR must be started much earlier.

Add workarounds for 5500 and X58 northbridges, some revisions of which
have severe flaws in handling IR.  Use the same identification methods
as employed by Linux.

Review:	https://reviews.freebsd.org/D1892
Reviewed by:	neel
Discussed with:	jhb
Tested by:	glebius, pho (previous versions)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2015-03-19 13:57:47 +00:00
..
config.mk Populate new KERN_OPTS from all the opt_*.h files in 2015-02-18 15:25:19 +00:00
dtb.mk Prefer install over mkdir to create the directory. Add test to ensure 2015-02-09 16:29:44 +00:00
files Fix ixgbe(4) - add ix_txrx to compile in the kernel. 2015-03-18 05:03:07 +00:00
files.amd64 Use VT-d interrupt remapping block (IR) to perform FSB messages 2015-03-19 13:57:47 +00:00
files.arm Use the ARM unwinder with dtrace to extract the stack when asked. With this 2015-02-19 12:20:21 +00:00
files.i386 Use VT-d interrupt remapping block (IR) to perform FSB messages 2015-03-19 13:57:47 +00:00
files.mips Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c 2014-08-05 09:44:10 +00:00
files.pc98 Merge pc98's machdep.c into i386/i386/machdep.c. 2014-10-04 06:01:30 +00:00
files.powerpc Remove FreeBSD/wii. 2015-02-10 06:35:16 +00:00
files.sparc64 Add a simple unaccelerated vt(4) framebuffer driver for Sun framebuffers 2014-08-05 18:19:51 +00:00
kern.mk Merge ^/head r279313 through r279595. 2015-03-04 19:47:33 +00:00
kern.opts.mk Categorize certain kernel builds as being broken in certain places. 2015-03-12 03:57:19 +00:00
kern.post.mk Truncate the ctfmerge command line, like we do with SYSTEM_LD. 2014-08-12 23:48:37 +00:00
kern.pre.mk Globally enable -fms-extensions when building kernel with gcc, and remove 2015-02-17 19:27:14 +00:00
kmod_syms.awk
kmod.mk Allow the ARM unwinder to work through modules. This will be used to add 2015-02-19 12:06:57 +00:00
ldscript.amd64 The new binutils has correctly redefined MAXPAGESIZE on amd64 as 0x200000 2011-03-28 06:35:17 +00:00
ldscript.arm Remove STARTUP_PAGETABLE_ADDR from the ARM configs and replace it with 2014-01-28 09:12:04 +00:00
ldscript.i386
ldscript.mips
ldscript.mips.cfe Remove commented out _DYNAMIC sections. 2011-01-20 19:20:23 +00:00
ldscript.mips.mips64 Remove commented out _DYNAMIC sections. 2011-01-20 19:20:23 +00:00
ldscript.mips.octeon1 In fact, we don't need any of these __DYNAMIC. it is a.out leftover and commented out. 2011-01-20 19:24:50 +00:00
ldscript.powerpc Refactor PowerPC (especially AIM) init sequence to be less baroque. 2015-01-18 18:32:43 +00:00
ldscript.powerpc64 Refactor PowerPC (especially AIM) init sequence to be less baroque. 2015-01-18 18:32:43 +00:00
ldscript.sparc64 Merge binutils 2.17.50 to head. This brings a number of improvements to 2011-02-18 20:54:12 +00:00
Makefile.amd64 Clang's 3.5 integrated assembler now handles these files correctly (it 2015-01-05 12:28:22 +00:00
Makefile.arm Since for clang 3.5.0 ARM EHABI is now the default, the -mllvm 2014-11-26 23:28:16 +00:00
Makefile.i386 Clang's 3.5 integrated assembler now handles these files correctly (it 2015-01-05 12:28:22 +00:00
Makefile.mips Bump the version of config to the latest (3 year old, so upgrade 2014-02-04 18:24:25 +00:00
Makefile.pc98 Clang's 3.5 integrated assembler now handles these files correctly (it 2015-01-05 12:28:22 +00:00
Makefile.powerpc Make 32-bit PowerPC kernels, like 64-bit PowerPC kernels, position-independent 2015-03-07 20:14:46 +00:00
Makefile.sparc64 Bump the version of config to the latest (3 year old, so upgrade 2014-02-04 18:24:25 +00:00
makeLINT.mk Generate a LINT for powerpc and for powerpc64. 2013-04-11 22:18:20 +00:00
makeLINT.sed Match the files directive and all the ways to add or subtract options 2011-10-04 17:11:38 +00:00
newvers.sh Don't require ${SYSDIR}/../COPYRIGHT to exist. Fall back to the 2014-12-22 19:10:21 +00:00
NOTES Update to the Intel ixgbe driver: 2015-03-17 18:32:28 +00:00
options Reimplement support for userland core dump compression using a new interface 2015-03-09 03:50:53 +00:00
options.amd64 imagact_binmisc builds for all supported architectures, so enable it for all. 2014-05-22 05:04:40 +00:00
options.arm Add arm option ARM_NEW_PMAP, to allow us to begin adding the new pmap 2014-12-30 02:51:04 +00:00
options.i386 Garbage collect the asr driver. Hardware for it has not been produced in 2015-01-02 05:34:14 +00:00
options.mips Introduce opt_netfpga.h and allow setting NF10BMAC_64BIT from mips kernel 2014-06-26 17:20:45 +00:00
options.pc98 Reduce diffs against i386. 2014-10-04 05:03:39 +00:00
options.powerpc Remove FreeBSD/wii. 2015-02-10 06:35:16 +00:00
options.sparc64 - While Netra X1 generally show no ill effects when registering a power 2013-03-02 00:37:31 +00:00
systags.sh
WITHOUT_SOURCELESS Move WITHOUT_SOURCELESS_* files to sys/conf/ in order to avoid "universe" 2012-02-12 14:55:27 +00:00
WITHOUT_SOURCELESS_HOST Retire the nve(4) driver; nfe(4) has been the default driver for NVIDIA 2014-02-16 12:22:43 +00:00
WITHOUT_SOURCELESS_UCODE The sn driver doesn't actually include microcode at the current time, 2014-12-30 02:39:44 +00:00