linux/include
Keshavamurthy, Anil S 10e5247f40 Intel IOMMU: DMAR detection and parsing logic
This patch supports the upcomming Intel IOMMU hardware a.k.a.  Intel(R)
Virtualization Technology for Directed I/O Architecture and the hardware spec
for the same can be found here
http://www.intel.com/technology/virtualization/index.htm

FAQ! (questions from akpm, answers from ak)

> So...  what's all this code for?
>
> I assume that the intent here is to speed things up under Xen, etc?

Yes in some cases, but not this code.  That would be the Xen version of this
code that could potentially assign whole devices to guests.  I expect this to
be only useful in some special cases though because most hardware is not
virtualizable and you typically want an own instance for each guest.

Ok at some point KVM might implement this too; i likely would use this code
for this.

> Do we
> have any benchmark results to help us to decide whether a merge would be
> justified?

The main advantage for doing it in the normal kernel is not performance, but
more safety.  Broken devices won't be able to corrupt memory by doing random
DMA.

Unfortunately that doesn't work for graphics yet, for that need user space
interfaces for the X server are needed.

There are some potential performance benefits too:

- When you have a device that cannot address the complete address range an
  IOMMU can remap its memory instead of bounce buffering.  Remapping is likely
  cheaper than copying.

- The IOMMU can merge sg lists into a single virtual block.  This could
  potentially speed up SG IO when the device is slow walking SG lists.  [I
  long ago benchmarked 5% on some block benchmark with an old MPT Fusion; but
  it probably depends a lot on the HBA]

And you get better driver debugging because unexpected memory accesses from
the devices will cause a trappable event.

>
> Does it slow anything down?

It adds more overhead to each IO so yes.

This patch:

Add support for early detection and parsing of DMAR's (DMA Remapping) reported
to OS via ACPI tables.

DMA remapping(DMAR) devices support enables independent address translations
for Direct Memory Access(DMA) from Devices.  These DMA remapping devices are
reported via ACPI tables and includes pci device scope covered by these DMA
remapping device.

For detailed info on the specification of "Intel(R) Virtualization Technology
for Directed I/O Architecture" please see
http://www.intel.com/technology/virtualization/index.htm

Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Greg KH <greg@kroah.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-22 08:13:18 -07:00
..
acpi Intel IOMMU: DMAR detection and parsing logic 2007-10-22 08:13:18 -07:00
asm-alpha ide: add CONFIG_IDE_ARCH_OBSOLETE_INIT 2007-10-20 00:32:32 +02:00
asm-arm Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-10-19 20:36:17 -07:00
asm-arm26 softlockup: make asm/irq_regs.h available on every platform 2007-10-17 08:42:47 -07:00
asm-avr32 forbid asm/bitops.h direct inclusion 2007-10-19 11:53:41 -07:00
asm-blackfin Blackfin arch: dma add some API and cleanup bf54x DMA definition 2007-10-22 00:02:14 +08:00
asm-cris ide: add hwif->ack_intr hook 2007-10-20 00:32:32 +02:00
asm-frv forbid asm/bitops.h direct inclusion 2007-10-19 11:53:41 -07:00
asm-generic Linux Kernel Markers 2007-10-19 11:53:54 -07:00
asm-h8300 include/asm-*/system.h: remove unused set_rmb(), set_wmb() macros 2007-10-20 02:30:47 +02:00
asm-ia64 ide: add CONFIG_IDE_ARCH_OBSOLETE_INIT 2007-10-20 00:32:32 +02:00
asm-m32r ide: add CONFIG_IDE_ARCH_OBSOLETE_INIT 2007-10-20 00:32:32 +02:00
asm-m68k ide: add hwif->ack_intr hook 2007-10-20 00:32:32 +02:00
asm-m68knommu include/asm-*/system.h: remove unused set_rmb(), set_wmb() macros 2007-10-20 02:30:47 +02:00
asm-mips Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-10-19 20:36:17 -07:00
asm-parisc Merge branch 'master' of hera.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6 2007-10-20 20:19:15 -07:00
asm-powerpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-10-19 20:36:17 -07:00
asm-ppc remove asm/bitops.h includes 2007-10-19 11:53:41 -07:00
asm-s390 forbid asm/bitops.h direct inclusion 2007-10-19 11:53:41 -07:00
asm-sh Fix misspellings of "system", "controller", "interrupt" and "necessary". 2007-10-19 23:10:43 +02:00
asm-sh64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-10-19 20:36:17 -07:00
asm-sparc ide: add CONFIG_IDE_ARCH_OBSOLETE_INIT 2007-10-20 00:32:32 +02:00
asm-sparc64 ide: add CONFIG_IDE_ARCH_OBSOLETE_INIT 2007-10-20 00:32:32 +02:00
asm-um forbid asm/bitops.h direct inclusion 2007-10-19 11:53:41 -07:00
asm-v850 include/asm-*/system.h: remove unused set_rmb(), set_wmb() macros 2007-10-20 02:30:47 +02:00
asm-x86 update boot spec to 2.07 2007-10-22 08:13:17 -07:00
asm-xtensa forbid asm/bitops.h direct inclusion 2007-10-19 11:53:41 -07:00
crypto [CRYPTO] sha: Add header file for SHA definitions 2007-10-10 16:55:50 -07:00
keys KEYS: Make request_key() and co fundamentally asynchronous 2007-10-17 08:42:57 -07:00
linux Intel IOMMU: DMAR detection and parsing logic 2007-10-22 08:13:18 -07:00
math-emu
media v4l: copy_to_user() is not a good method name 2007-10-13 09:58:59 -07:00
mtd
net Spelling fix: explicitly 2007-10-19 23:22:55 +02:00
pcmcia pcmcia: use DMA_MASK_NONE for the default for all pcmcia devices 2007-10-16 09:42:50 -07:00
rdma
rxrpc
scsi do not export /usr/include/scsi in make headers_install 2007-10-17 08:42:52 -07:00
sound [ALSA] version 1.0.15 2007-10-16 16:57:46 +02:00
video define global BIT macro 2007-10-19 11:53:42 -07:00
xen xen: fix incorrect vcpu_register_vcpu_info hypercall argument 2007-10-16 11:51:31 -07:00
Kbuild do not export /usr/include/scsi in make headers_install 2007-10-17 08:42:52 -07:00