Linus Torvalds [Sat, 3 Jan 2009 20:03:52 +0000 (12:03 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/joro/linux-2.6-iommu
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu: (89 commits)
AMD IOMMU: remove now unnecessary #ifdefs
AMD IOMMU: prealloc_protection_domains should be static
kvm/iommu: fix compile warning
AMD IOMMU: add statistics about total number of map requests
AMD IOMMU: add statistics about allocated io memory
AMD IOMMU: add stats counter for domain tlb flushes
AMD IOMMU: add stats counter for single iommu domain tlb flushes
AMD IOMMU: add stats counter for cross-page request
AMD IOMMU: add stats counter for free_coherent requests
AMD IOMMU: add stats counter for alloc_coherent requests
AMD IOMMU: add stats counter for unmap_sg requests
AMD IOMMU: add stats counter for map_sg requests
AMD IOMMU: add stats counter for unmap_single requests
AMD IOMMU: add stats counter for map_single requests
AMD IOMMU: add stats counter for completion wait events
AMD IOMMU: add init code for statistic collection
AMD IOMMU: add necessary header defines for stats counting
AMD IOMMU: add Kconfig entry for statistic collection code
AMD IOMMU: use dev_name in iommu_enable function
AMD IOMMU: use calc_devid in prealloc_protection_domains
...
Linus Torvalds [Sat, 3 Jan 2009 20:02:18 +0000 (12:02 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (34 commits)
V4L/DVB (10173): Missing v4l2_prio_close in radio_release
V4L/DVB (10172): add DVB_DEVICE_TYPE= to uevent
V4L/DVB (10171): Use usb_set_intfdata
V4L/DVB (10170): tuner-simple: prevent possible OOPS caused by divide by zero error
V4L/DVB (10168): sms1xxx: fix inverted gpio for lna control on tiger r2
V4L/DVB (10167): sms1xxx: add support for inverted gpio
V4L/DVB (10166): dvb frontend: stop using non-C99 compliant comments
V4L/DVB (10165): Add FE_CAN_2G_MODULATION flag to frontends that support DVB-S2
V4L/DVB (10164): Add missing S2 caps flag to S2API
V4L/DVB (10163): em28xx: allocate adev together with struct em28xx dev
V4L/DVB (10162): tuner-simple: Fix tuner type set message
V4L/DVB (10161): saa7134: fix autodetection for AVer TV GO 007 FM Plus
V4L/DVB (10160): em28xx: update chip id for em2710
V4L/DVB (10157): Add USB ID for the Sil4701 radio from DealExtreme
V4L/DVB (10156): saa7134: Add support for Avermedia AVer TV GO 007 FM Plus
V4L/DVB (10155): Add TEA5764 radio driver
V4L/DVB (10154): saa7134: fix a merge conflict on Behold H6 board
V4L/DVB (10153): Add the Beholder H6 card to DVB-T part of sources.
V4L/DVB (10152): Change configuration of the Beholder H6 card
V4L/DVB (10151): Fix I2C bridge error in zl10353
...
Yinghai Lu [Sat, 3 Jan 2009 08:06:34 +0000 (00:06 -0800)]
sparseirq: move set/get_timer_rand_state back to .c
those two functions only used in that C file
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sat, 3 Jan 2009 20:00:07 +0000 (12:00 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/drzeus/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
mmc: warn about voltage mismatches
mmc_spi: Add support for OpenFirmware bindings
pxamci: fix dma_unmap_sg length
mmc_block: ensure all sectors that do not have errors are read
drivers/mmc: Move a dereference below a NULL test
sdhci: handle built-in sdhci with modular leds class
mmc: balanc pci_iomap with pci_iounmap
mmc_block: print better error messages
mmc: Add mmc_vddrange_to_ocrmask() helper function
ricoh_mmc: Handle newer models of Ricoh controllers
mmc: Add 8-bit bus width support
sdhci: activate led support also when module
mmc: trivial annotation of 'blocks'
pci: use pci_ioremap_bar() in drivers/mmc
sdricoh_cs: Add support for Bay Controller devices
mmc: at91_mci: reorder timer setup and mmc_add_host() call
Linus Torvalds [Sat, 3 Jan 2009 19:59:13 +0000 (11:59 -0800)]
Merge git://git./linux/kernel/git/wim/linux-2.6-watchdog
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
[WATCHDOG] Add support for the WM8350 watchdog
[WATCHDOG] Add SMSC SCH311x Watchdog Timer.
[WATCHDOG] ib700wdt - add timeout parameter
Linus Torvalds [Sat, 3 Jan 2009 19:56:24 +0000 (11:56 -0800)]
Merge branch 'cputime' of git://git390.osdl.marist.edu/linux-2.6
* 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
[PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID
[PATCH] improve idle cputime accounting
[PATCH] improve precision of idle time detection.
[PATCH] improve precision of process accounting.
[PATCH] idle cputime accounting
[PATCH] fix scaled & unscaled cputime accounting
Linus Torvalds [Sat, 3 Jan 2009 19:46:17 +0000 (11:46 -0800)]
Make %p print '(null)' for NULL pointers
Before, when we only ever printed out the pointer value itself, a NULL
pointer would never cause issues and might as well be printed out as
just its numeric value.
However, with the extended %p formats, especially %pR, we might validly
want to print out resources for debugging. And sometimes they don't
even exist, and the resource pointer is just NULL. Print it out as
such, rather than oopsing.
This is a more generic version of a patch done by Trent Piepho (catching
all %p cases rather than just %pR, and using "(null)" instead of
"[NULL]" to match glibc).
Requested-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Sat, 3 Jan 2009 07:16:33 +0000 (07:16 +0000)]
get rid of special-casing the /sbin/loader on alpha
... just make it a binfmt handler like #! one.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Sat, 3 Jan 2009 07:16:23 +0000 (07:16 +0000)]
sanitize ifdefs in binfmt_aout
They are actually alpha vs. i386/arm/m68k i.e. ecoff vs. aout.
In the only place where we actually tried to handle arm and i386/m68k in
different ways (START_DATA() in coredump handling), the arm variant
works for all of them (i386 and m68k have u.start_code set to 0).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Sat, 3 Jan 2009 07:16:13 +0000 (07:16 +0000)]
remove the rudiment of a.out for sparc
it's been used only in sunos compat
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Hugh Blemings [Sat, 3 Jan 2009 05:48:44 +0000 (16:48 +1100)]
Updated contact info for CREDITS file
This updates some personal info in the CREDITS file.
I'm no longer actively involved in Keyspan driver work so shouldn't
really be listed as a Maintainer here.
I do however field the occasional question on them and as I'm dropping
the misc.nu domain, want to ensure people can find me should they need
to.
Signed-off-by: Hugh Blemings <hugh@blemings.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joerg Roedel [Sat, 3 Jan 2009 13:16:35 +0000 (14:16 +0100)]
AMD IOMMU: remove now unnecessary #ifdefs
The #ifdef's are no longer necessary when the iommu-api and the amd
iommu updates are merged together.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Sat, 3 Jan 2009 15:43:44 +0000 (16:43 +0100)]
Merge branches 'iommu/api' and 'iommu/amd' into for-linus
Jaswinder Singh Rajput [Mon, 29 Dec 2008 16:15:22 +0000 (21:45 +0530)]
AMD IOMMU: prealloc_protection_domains should be static
Impact: cleanup, reduce kernel size a bit, avoid sparse warning
Fixes sparse warning:
arch/x86/kernel/amd_iommu.c:1299:6: warning: symbol 'prealloc_protection_domains' was not declared. Should it be static?
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Sat, 3 Jan 2009 15:37:53 +0000 (16:37 +0100)]
kvm/iommu: fix compile warning
This fixes a compile warning about a variable thats maybe used
uninitialized in the function.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 15:13:04 +0000 (16:13 +0100)]
AMD IOMMU: add statistics about total number of map requests
Impact: see total number of map requests in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:57:30 +0000 (15:57 +0100)]
AMD IOMMU: add statistics about allocated io memory
Impact: see amount of allocated io memory in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:48:28 +0000 (15:48 +0100)]
AMD IOMMU: add stats counter for domain tlb flushes
Impact: see number of domain tlb flushes in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:46:29 +0000 (15:46 +0100)]
AMD IOMMU: add stats counter for single iommu domain tlb flushes
Impact: see number of single iommu domain tlb flushes in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:42:39 +0000 (15:42 +0100)]
AMD IOMMU: add stats counter for cross-page request
Impact: see number of requests for more than one page in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:16:38 +0000 (15:16 +0100)]
AMD IOMMU: add stats counter for free_coherent requests
Impact: see number of free_coherent requests in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:14:21 +0000 (15:14 +0100)]
AMD IOMMU: add stats counter for alloc_coherent requests
Impact: see number of alloc_coherent requests in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:12:14 +0000 (15:12 +0100)]
AMD IOMMU: add stats counter for unmap_sg requests
Impact: see number of unmap_sg requests in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:09:48 +0000 (15:09 +0100)]
AMD IOMMU: add stats counter for map_sg requests
Impact: see number of map_sg requests in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:07:12 +0000 (15:07 +0100)]
AMD IOMMU: add stats counter for unmap_single requests
Impact: see number of unmap_single requests in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 14:05:16 +0000 (15:05 +0100)]
AMD IOMMU: add stats counter for map_single requests
Impact: see number of map_single requests in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 13:59:58 +0000 (14:59 +0100)]
AMD IOMMU: add stats counter for completion wait events
Impact: see number of completion wait events in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 12:50:21 +0000 (13:50 +0100)]
AMD IOMMU: add init code for statistic collection
Impact: create a new debugfs directory
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 11:33:06 +0000 (12:33 +0100)]
AMD IOMMU: add necessary header defines for stats counting
Impact: add defines to make iommu stats collection configurable
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Thu, 11 Dec 2008 18:00:12 +0000 (19:00 +0100)]
AMD IOMMU: add Kconfig entry for statistic collection code
Impact: adds new Kconfig entry
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 10 Dec 2008 19:04:18 +0000 (20:04 +0100)]
AMD IOMMU: use dev_name in iommu_enable function
Impact: cleanup
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 10 Dec 2008 19:01:45 +0000 (20:01 +0100)]
AMD IOMMU: use calc_devid in prealloc_protection_domains
Impact: cleanup
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Fri, 12 Dec 2008 12:53:54 +0000 (13:53 +0100)]
AMD IOMMU: convert amd_iommu_isolate to bool
Impact: cleanup
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 10 Dec 2008 18:58:00 +0000 (19:58 +0100)]
AMD IOMMU: convert iommu->need_sync to bool
Impact: use bool instead of int for iommu->need_sync
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 10 Dec 2008 18:43:07 +0000 (19:43 +0100)]
AMD IOMMU: use dev_name instead of self-build print_devid
Impact: use generic dev_name instead of own function
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 10 Dec 2008 18:33:26 +0000 (19:33 +0100)]
AMD IOMMU: allocate a new protection for hotplugged devices
Impact: also hotplug devices benefit from device isolation
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 10 Dec 2008 17:48:59 +0000 (18:48 +0100)]
AMD IOMMU: add a domain flag for default domains
Impact: adds a new protection domain flag
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 3 Dec 2008 16:00:17 +0000 (17:00 +0100)]
AMD IOMMU: register functions for the IOMMU API
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 19:05:50 +0000 (20:05 +0100)]
AMD IOMMU: add domain address lookup function for IOMMU API
Impact: add a generic function to lockup addresses in protection domains
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 18:59:10 +0000 (19:59 +0100)]
AMD IOMMU: add domain unmap function for IOMMU API
Impact: add a generic function to unmap pages into protection domains
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 18:48:43 +0000 (19:48 +0100)]
AMD IOMMU: add domain map function for IOMMU API
Impact: add a generic function to map pages into protection domains
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 18:34:11 +0000 (19:34 +0100)]
AMD IOMMU: add device attach function for IOMMU API
Impact: add a generic function to attach devices to protection domains
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Mon, 8 Dec 2008 11:07:44 +0000 (12:07 +0100)]
AMD IOMMU: add device detach function for IOMMU API
Impact: add a generic function to detach devices from protection domains
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 17:34:12 +0000 (18:34 +0100)]
AMD IOMMU: add domain destroy function for IOMMU API
Impact: add a generic function for releasing protection domains
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 17:13:27 +0000 (18:13 +0100)]
AMD IOMMU: add domain init function for IOMMU API
Impact: add a generic function for allocation protection domains
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Mon, 8 Dec 2008 11:05:55 +0000 (12:05 +0100)]
AMD IOMMU: add domain cleanup helper function
Impact: add a function to remove all devices from a domain
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 10 Dec 2008 17:27:25 +0000 (18:27 +0100)]
AMD IOMMU: add device notifier callback
Impact: inform IOMMU about state change of a device in the driver core
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Mon, 8 Dec 2008 11:02:41 +0000 (12:02 +0100)]
AMD IOMMU: add device detach helper functions
Impact: add helper functions to detach a device from a domain
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 10 Dec 2008 13:39:51 +0000 (14:39 +0100)]
AMD IOMMU: rename set_device_domain function
Impact: rename set_device_domain() to attach_device()
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 16:56:36 +0000 (17:56 +0100)]
AMD IOMMU: add device reference counting for protection domains
Impact: know how many devices are assigned to a domain
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 16:49:42 +0000 (17:49 +0100)]
AMD IOMMU: add checks for dma_ops domain to dma_ops functions
Impact: detect when a driver uses a device assigned otherwise
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 16:46:25 +0000 (17:46 +0100)]
AMD IOMMU: add protection domain flags
Imapct: add a new struct member to 'struct protection_domain'
When using protection domains for dma_ops and KVM its better to know for
which subsystem it was allocated. Add a flags member to struct
protection domain for that purpose.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 20:01:12 +0000 (21:01 +0100)]
AMD IOMMU: add iommu_flush_domain function
Impact: add a function to flush a domain id on every IOMMU
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 10 Dec 2008 19:05:52 +0000 (20:05 +0100)]
AMD IOMMU: don't remove protection domain from iommu_pd_list
Impact: save unneeded logic to add and remove domains to the list
The removal of a protection domain from the iommu_pd_list is not
necessary. Another benefit is that we save complexity because we don't
have to readd it later when the device no longer uses the domain.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 19:54:37 +0000 (20:54 +0100)]
AMD IOMMU: move invalidation command building to a separate function
Impact: refactoring of iommu_queue_inv_iommu_pages
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 19:34:41 +0000 (20:34 +0100)]
AMD IOMMU: refactor completion wait handling into separate functions
Impact: split one function into three
The separate functions are required synchronize commands across all
hardware IOMMUs in the system.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 17:28:53 +0000 (18:28 +0100)]
AMD IOMMU: add domain id free function
Impact: add code to release a domain id
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 17:20:21 +0000 (18:20 +0100)]
AMD IOMMU: make dma_ops_free_pagetable generic
Impact: change code to free pagetables from protection domains
The dma_ops_free_pagetable function can only free pagetables from
dma_ops domains. Change that to free pagetables of pure protection
domains.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Tue, 2 Dec 2008 16:27:52 +0000 (17:27 +0100)]
AMD IOMMU: rename iommu_map to iommu_map_page
Impact: function rename
The iommu_map function maps only one page. Make this clear in the
function name.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Mike Day [Fri, 12 Dec 2008 16:16:30 +0000 (17:16 +0100)]
intel-iommu: fix bit shift at DOMAIN_FLAG_P2P_MULTIPLE_DEVICES
Signed-off-by: Mike Day <ncmike@ncultra.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 3 Dec 2008 14:26:42 +0000 (15:26 +0100)]
VT-d: remove now unused intel_iommu_found function
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 3 Dec 2008 14:14:02 +0000 (15:14 +0100)]
VT-d: register functions for the IOMMU API
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 3 Dec 2008 14:06:57 +0000 (15:06 +0100)]
VT-d: adapt domain iova_to_phys function for IOMMU API
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 3 Dec 2008 14:04:09 +0000 (15:04 +0100)]
VT-d: adapt domain map and unmap functions for IOMMU API
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 3 Dec 2008 13:58:24 +0000 (14:58 +0100)]
VT-d: adapt device attach and detach functions for IOMMU API
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 3 Dec 2008 13:52:32 +0000 (14:52 +0100)]
VT-d: adapt domain init and destroy functions for IOMMU API
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 3 Dec 2008 13:43:34 +0000 (14:43 +0100)]
KVM: change KVM to use IOMMU API
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 26 Nov 2008 16:25:13 +0000 (17:25 +0100)]
select IOMMU_API when DMAR and/or AMD_IOMMU is selected
These two IOMMUs can implement the current version of this API. So
select the API if one or both of these IOMMU drivers is selected.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 26 Nov 2008 16:21:24 +0000 (17:21 +0100)]
add frontend implementation for the IOMMU API
This API can be used by KVM for accessing different types of IOMMUs to
do device passthrough to guests. Beside that this API can also be used
by device drivers to map non-linear host memory into dma-linear
addresses to prevent sgather-gather DMA. UIO may be another user for
this API.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Joerg Roedel [Wed, 26 Nov 2008 16:02:33 +0000 (17:02 +0100)]
introcude linux/iommu.h for an iommu api
This patch introduces the API to abstract the exported VT-d functions
for KVM into a generic API. This way the AMD IOMMU implementation can
plug into this API later.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel [Wed, 26 Nov 2008 14:51:19 +0000 (15:51 +0100)]
KVM: rename vtd.c to iommu.c
Impact: file renamed
The code in the vtd.c file can be reused for other IOMMUs as well. So
rename it to make it clear that it handle more than VT-d.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 15:29:53 +0000 (23:29 +0800)]
Deassign device in kvm_free_assgined_device
In kvm_iommu_unmap_memslots(), assigned_dev_head is already empty.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Tue, 2 Dec 2008 13:24:23 +0000 (21:24 +0800)]
KVM: support device deassignment
Support device deassignment, it can be used in device hotplug.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Tue, 2 Dec 2008 13:03:39 +0000 (21:03 +0800)]
KVM: use the new intel iommu APIs
intel iommu APIs are updated, use the new APIs.
In addition, change kvm_iommu_map_guest() to just create the domain, let kvm_iommu_assign_device() assign device.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 15:10:23 +0000 (23:10 +0800)]
Check agaw is sufficient for mapped memory
When domain is related to multiple iommus, need to check if the minimum agaw is sufficient for the mapped memory
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 15:09:29 +0000 (23:09 +0800)]
Change intel iommu APIs of virtual machine domain
These APIs are used by KVM to use VT-d
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 15:08:15 +0000 (23:08 +0800)]
Change domain_context_mapping_one for virtual machine domain
vm_domid won't be set in context, find available domain id for a device from its iommu.
For a virtual machine domain, a default agaw will be set, and skip top levels of page tables for iommu which has less agaw than default.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 15:03:27 +0000 (23:03 +0800)]
Allocation and free functions of virtual machine domain
virtual machine domain is different from native DMA-API domain, implement separate allocation and free functions for virtual machine domain.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 15:00:00 +0000 (23:00 +0800)]
Add domain_flush_cache
Because virtual machine domain may have multiple devices from different iommus, it cannot use __iommu_flush_cache.
In some common low level functions, use domain_flush_cache instead of __iommu_flush_cache. On the other hand, in some functions, iommu can is specified or domain cannot be got, still use __iommu_flush_cache
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 14:51:37 +0000 (22:51 +0800)]
Add/remove domain device info for virtual machine domain
Add iommu reference count in domain, and add a lock to protect iommu setting including iommu_bmp, iommu_count and iommu_coherency.
virtual machine domain may have multiple devices from different iommus, so it needs to do more things when add/remove domain device info. Thus implement separate these functions for virtual machine domain.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 08:35:39 +0000 (16:35 +0800)]
Add domain flag DOMAIN_FLAG_VIRTUAL_MACHINE
Add this flag for VT-d used in virtual machine, like KVM.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 07:49:06 +0000 (15:49 +0800)]
iommu coherency
In dmar_domain, more than one iommus may be included in iommu_bmp. Due to "Coherency" capability may be different across iommus, set this variable to indicate iommu access is coherent or not. Only when all related iommus in a dmar_domain are all coherent, iommu access of this domain is coherent.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 07:34:06 +0000 (15:34 +0800)]
calculate agaw for each iommu
"SAGAW" capability may be different across iommus. Use a default agaw, but if default agaw is not supported in some iommus, choose a less supported agaw.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 07:29:22 +0000 (15:29 +0800)]
iommu bitmap instead of iommu pointer in dmar_domain
In order to support assigning multiple devices from different iommus to a domain, iommu bitmap is used to keep all iommus the domain are related to.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 03:24:12 +0000 (11:24 +0800)]
Get iommu from g_iommus for deferred flush
deferred_flush[] uses the iommu seq_id to index, so its iommu is fixed and can get it from g_iommus.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 03:06:32 +0000 (11:06 +0800)]
Add global iommu list
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Mon, 8 Dec 2008 01:17:15 +0000 (09:17 +0800)]
change P2P domain flags
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Weidong Han [Sun, 7 Dec 2008 13:13:41 +0000 (21:13 +0800)]
Initialize domain flags to 0
It's random number after the domain is allocated by kmem_cache_alloc
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Udo Steinberg [Fri, 2 Jan 2009 20:34:28 +0000 (17:34 -0300)]
V4L/DVB (10173): Missing v4l2_prio_close in radio_release
The radio_release function of the BTTV driver is missing a call to
v4l2_prio_close. As a result, after the radio device has been opened at
least once (e.g., by HAL during bootup), v4l2_priority will never drop below
V4L2_PRIORITY_INTERACTIVE again. With the following patch against 2.6.28,
applications that run with V4L2_PRIORITY_BACKGROUND are able to open devices
again. Previous Linux versions are affected as well.
Signed-off-by: Udo Steinberg <udo@hypervisor.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Kay Sievers [Thu, 1 Jan 2009 02:35:24 +0000 (23:35 -0300)]
V4L/DVB (10172): add DVB_DEVICE_TYPE= to uevent
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Julia Lawall [Thu, 1 Jan 2009 20:14:58 +0000 (17:14 -0300)]
V4L/DVB (10171): Use usb_set_intfdata
This code had calls to both usb_set_intfdata and dev_set_drvdata, doing the
same thing.
The semantic patch that lead to finding this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@header@
@@
@same depends on header@
position p;
@@
usb_set_intfdata@p(...) { ... }
@depends on header@
position _p!=same.p;
identifier _f;
struct usb_interface *intf;
expression data;
@@
_f@_p(...) { <+...
- dev_set_drvdata(&intf->dev, data);
+ usb_set_intfdata(intf, data);
...+> }
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Yu Zhao [Mon, 22 Dec 2008 08:54:58 +0000 (16:54 +0800)]
VT-d: fix segment number being ignored when searching DRHD
On platforms with multiple PCI segments, any of the segments can have a DRHD
with INCLUDE_PCI_ALL flag. So need to check the DRHD's segment number against
the PCI device's when searching its DRHD.
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Mark McLoughlin [Fri, 21 Nov 2008 16:56:53 +0000 (16:56 +0000)]
intel-iommu: trivially inline DMA PTE macros
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Mark McLoughlin [Fri, 21 Nov 2008 16:54:46 +0000 (16:54 +0000)]
intel-iommu: trivially inline context entry macros
Some macros were unused, so I just dropped them:
context_fault_disable
context_translation_type
context_address_root
context_address_width
context_domain_id
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Mark McLoughlin [Thu, 20 Nov 2008 15:49:50 +0000 (15:49 +0000)]
intel-iommu: move iommu_prepare_gfx_mapping() out of dma_remapping.h
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Mark McLoughlin [Thu, 20 Nov 2008 15:49:49 +0000 (15:49 +0000)]
intel-iommu: kill off duplicate def of dmar_disabled
This is only used in dmar.c and intel-iommu.h, so dma_remapping.h
seems like the appropriate place for it.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Mark McLoughlin [Thu, 20 Nov 2008 15:49:48 +0000 (15:49 +0000)]
intel-iommu: move struct device_domain_info out of dma_remapping.h
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Mark McLoughlin [Thu, 20 Nov 2008 15:49:47 +0000 (15:49 +0000)]
intel-iommu: move struct dmar_domain def out dma_remapping.h
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Mark McLoughlin [Thu, 20 Nov 2008 15:49:46 +0000 (15:49 +0000)]
intel-iommu: move DMA PTE defs out of dma_remapping.h
DMA_PTE_READ/WRITE are needed by kvm.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Mark McLoughlin [Thu, 20 Nov 2008 15:49:45 +0000 (15:49 +0000)]
intel-iommu: move context entry defs out from dma_remapping.h
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>