android_kernel_xiaomi_sm8350/arch
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
..
alpha spelling fixes: arch/alpha/ 2007-10-20 01:04:37 +02:00
arm typo fixes 2007-10-20 01:34:40 +02:00
avr32 typo fixes 2007-10-20 01:34:40 +02:00
blackfin Blackfin arch: dma add some API and cleanup bf54x DMA definition 2007-10-22 00:02:14 +08:00
cris typo fixes 2007-10-20 01:34:40 +02:00
frv spelling fixes: arch/frv/ 2007-10-20 01:09:42 +02:00
h8300 spelling fixes: arch/h8300/ 2007-10-20 01:10:46 +02:00
i386 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-10-19 20:36:17 -07:00
ia64 typo fixes 2007-10-20 01:34:40 +02:00
m32r spelling fixes: arch/m32r/ 2007-10-20 01:14:39 +02:00
m68k spelling fixes: arch/m68k/ 2007-10-20 01:20:32 +02:00
m68knommu Fix misspellings of "system", "controller", "interrupt" and "necessary". 2007-10-19 23:10:43 +02:00
mips typo fixes 2007-10-20 01:34:40 +02:00
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
powerpc typo fixes 2007-10-20 01:34:40 +02:00
ppc kbuild: restore arch/{ppc/xtensa}/boot cflags 2007-10-20 20:35:23 +02:00
s390 Combine instrumentation menus in kernel/Kconfig.instrumentation 2007-10-19 11:53:54 -07:00
sh Combine instrumentation menus in kernel/Kconfig.instrumentation 2007-10-19 11:53:54 -07:00
sh64 Fix misspellings of "system", "controller", "interrupt" and "necessary". 2007-10-19 23:10:43 +02:00
sparc Combine instrumentation menus in kernel/Kconfig.instrumentation 2007-10-19 11:53:54 -07:00
sparc64 Combine instrumentation menus in kernel/Kconfig.instrumentation 2007-10-19 11:53:54 -07:00
um typo fixes 2007-10-20 01:34:40 +02:00
v850 spelling fixes: arch/v850/ 2007-10-20 01:24:05 +02:00
x86 i386: paravirt boot sequence 2007-10-22 08:13:17 -07:00
x86_64 Intel IOMMU: DMAR detection and parsing logic 2007-10-22 08:13:18 -07:00
xtensa kbuild: restore arch/{ppc/xtensa}/boot cflags 2007-10-20 20:35:23 +02:00