linux/arch/x86
Konrad Rzeszutek Wilk 0444ad93ea x86, iommu: Add IOMMU_INIT macros, .iommu_table section, and iommu_table_entry structure
This patch set adds a mechanism to "modularize" the IOMMUs we have
on X86. Currently the count of IOMMUs is up to six and they have a complex
relationship that requires careful execution order. 'pci_iommu_alloc'
does that today, but most folks are unhappy with how it does it.
This patch set addresses this and also paves a mechanism to jettison
unused IOMMUs during run-time. For details that sparked this, please
refer to: http://lkml.org/lkml/2010/8/2/282

The first solution that comes to mind is to convert wholesale
the IOMMU detection routines to be called during initcall
time frame. Unfortunately that misses the dependency relationship
that some of the IOMMUs have (for example: for AMD-Vi IOMMU to work,
GART detection MUST run first, and before all of that SWIOTLB MUST run).

The second solution would be to introduce a registration call wherein
the IOMMU would provide its detection/init routines and as well on what
MUST run before it. That would work, except that the 'pci_iommu_alloc'
which would run through this list, is called during mem_init. This means we
don't have any memory allocator, and it is so early that we haven't yet
started running through the initcall_t list.

This solution borrows concepts from the 2nd idea and from how
MODULE_INIT works. A macro is provided that each IOMMU uses to define
it's detect function and early_init (before the memory allocate is
active), and as well what other IOMMU MUST run before us.  Since most IOMMUs
depend on having SWIOTLB run first ("pci_swiotlb_detect") a convenience macro
to depends on that is also provided.

This macro is similar in design to MODULE_PARAM macro wherein
we setup a .iommu_table section in which we populate it with the values
that match a struct iommu_table_entry. During bootup we will sort
through the array so that the IOMMUs that MUST run before us are first
elements in the array. And then we just iterate through them calling the
detection routine and if appropiate, the init routines.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
LKML-Reference: <1282845485-8991-2-git-send-email-konrad.wilk@oracle.com>
CC: H. Peter Anvin <hpa@zytor.com>
CC: Fujita Tomonori <fujita.tomonori@lab.ntt.co.jp>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Ingo Molnar <mingo@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-08-26 15:12:53 -07:00
..
boot x86, setup: move isdigit.h to ctype.h, header files on top. 2010-08-02 21:07:20 -07:00
configs defconfig reduction 2010-08-14 22:26:53 +02:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2010-05-03 11:28:58 +08:00
ia32 Mark arguments to certain syscalls as being const 2010-08-13 16:53:13 -07:00
include/asm x86, iommu: Add IOMMU_INIT macros, .iommu_table section, and iommu_table_entry structure 2010-08-26 15:12:53 -07:00
kernel x86, iommu: Add IOMMU_INIT macros, .iommu_table section, and iommu_table_entry structure 2010-08-26 15:12:53 -07:00
kvm Merge branch 'kvm-updates/2.6.36' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2010-08-22 11:27:36 -07:00
lguest Merge branch 'ht-delete-2.6.35' into release 2010-05-28 16:20:35 -04:00
lib Merge branch 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-08-13 10:35:48 -07:00
math-emu x86, fpu: Unbreak FPU emulation 2010-05-10 13:37:16 -07:00
mm x86: don't send SIGBUS for kernel page faults 2010-08-13 09:49:20 -07:00
oprofile oprofile: add support for Intel processor model 30 2010-08-05 12:17:38 +02:00
pci x86/PCI: use for_each_pci_dev() 2010-07-30 09:47:33 -07:00
power update email address 2010-07-19 10:56:54 +02:00
tools
vdso Merge branches 'x86-cleanups-for-linus', 'x86-vmware-for-linus', 'x86-mtrr-for-linus', 'x86-apic-for-linus', 'x86-fpu-for-linus' and 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-08-06 16:22:59 -07:00
video
xen Merge branch 'stable/xen-swiotlb-0.8.6' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2010-08-12 09:09:41 -07:00
.gitignore
Kbuild
Kconfig Replace Configure with Enable in description of MAXSMP 2010-08-21 12:38:58 -07:00
Kconfig.cpu Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-05-18 08:58:16 -07:00
Kconfig.debug Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-05-18 08:40:21 -07:00
Makefile x86: Use .cfi_sections for assembly code 2010-05-13 22:15:18 -07:00
Makefile_32.cpu