]> Pileus Git - ~andy/linux/log
~andy/linux
15 years agoAMD IOMMU: add stats counter for completion wait events
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>
15 years agoAMD IOMMU: add init code for statistic collection
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>
15 years agoAMD IOMMU: add necessary header defines for stats counting
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>
15 years agoAMD IOMMU: add Kconfig entry for statistic collection code
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>
15 years agoAMD IOMMU: use dev_name in iommu_enable function
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>
15 years agoAMD IOMMU: use calc_devid in prealloc_protection_domains
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>
15 years agoAMD IOMMU: convert amd_iommu_isolate to bool
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>
15 years agoAMD IOMMU: convert iommu->need_sync to bool
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>
15 years agoAMD IOMMU: use dev_name instead of self-build print_devid
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>
15 years agoAMD IOMMU: allocate a new protection for hotplugged devices
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>
15 years agoAMD IOMMU: add a domain flag for default domains
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>
15 years agoAMD IOMMU: register functions for the IOMMU API
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>
15 years agoAMD IOMMU: add domain address lookup function for IOMMU API
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>
15 years agoAMD IOMMU: add domain unmap function for IOMMU API
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>
15 years agoAMD IOMMU: add domain map function for IOMMU API
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>
15 years agoAMD IOMMU: add device attach function for IOMMU API
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>
15 years agoAMD IOMMU: add device detach function for IOMMU API
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>
15 years agoAMD IOMMU: add domain destroy function for IOMMU API
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>
15 years agoAMD IOMMU: add domain init function for IOMMU API
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>
15 years agoAMD IOMMU: add domain cleanup helper function
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>
15 years agoAMD IOMMU: add device notifier callback
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>
15 years agoAMD IOMMU: add device detach helper functions
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>
15 years agoAMD IOMMU: rename set_device_domain function
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>
15 years agoAMD IOMMU: add device reference counting for protection domains
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>
15 years agoAMD IOMMU: add checks for dma_ops domain to dma_ops functions
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>
15 years agoAMD IOMMU: add protection domain flags
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>
15 years agoAMD IOMMU: add iommu_flush_domain function
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>
15 years agoAMD IOMMU: don't remove protection domain from iommu_pd_list
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>
15 years agoAMD IOMMU: move invalidation command building to a separate function
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>
15 years agoAMD IOMMU: refactor completion wait handling into separate functions
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>
15 years agoAMD IOMMU: add domain id free function
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>
15 years agoAMD IOMMU: make dma_ops_free_pagetable generic
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>
15 years agoAMD IOMMU: rename iommu_map to iommu_map_page
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>
15 years agointel-iommu: fix bit shift at DOMAIN_FLAG_P2P_MULTIPLE_DEVICES
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>
15 years agoVT-d: remove now unused intel_iommu_found function
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>
15 years agoVT-d: register functions for the IOMMU API
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>
15 years agoVT-d: adapt domain iova_to_phys function for IOMMU API
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>
15 years agoVT-d: adapt domain map and unmap functions for IOMMU API
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>
15 years agoVT-d: adapt device attach and detach functions for IOMMU API
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>
15 years agoVT-d: adapt domain init and destroy functions for IOMMU API
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>
15 years agoKVM: change KVM to use IOMMU API
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>
15 years agoselect IOMMU_API when DMAR and/or AMD_IOMMU is selected
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>
15 years agoadd frontend implementation for the IOMMU API
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>
15 years agointrocude linux/iommu.h for an iommu api
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>
15 years agoKVM: rename vtd.c to iommu.c
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>
15 years agoDeassign device in kvm_free_assgined_device
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>
15 years agoKVM: support device deassignment
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>
15 years agoKVM: use the new intel iommu APIs
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>
15 years agoCheck agaw is sufficient for mapped memory
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>
15 years agoChange intel iommu APIs of virtual machine domain
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>
15 years agoChange domain_context_mapping_one for virtual machine domain
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>
15 years agoAllocation and free functions of virtual machine domain
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>
15 years agoAdd domain_flush_cache
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>
15 years agoAdd/remove domain device info for virtual machine domain
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>
15 years agoAdd domain flag DOMAIN_FLAG_VIRTUAL_MACHINE
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>
15 years agoiommu coherency
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>
15 years agocalculate agaw for each iommu
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>
15 years agoiommu bitmap instead of iommu pointer in dmar_domain
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>
15 years agoGet iommu from g_iommus for deferred flush
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>
15 years agoAdd global iommu list
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>
15 years agochange P2P domain flags
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>
15 years agoInitialize domain flags to 0
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>
15 years agoV4L/DVB (10173): Missing v4l2_prio_close in radio_release
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>
15 years agoV4L/DVB (10172): add DVB_DEVICE_TYPE= to uevent
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>
15 years agoV4L/DVB (10171): Use usb_set_intfdata
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>
15 years agoVT-d: fix segment number being ignored when searching DRHD
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>
15 years agointel-iommu: trivially inline DMA PTE macros
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>
15 years agointel-iommu: trivially inline context entry macros
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>
15 years agointel-iommu: move iommu_prepare_gfx_mapping() out of dma_remapping.h
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>
15 years agointel-iommu: kill off duplicate def of dmar_disabled
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>
15 years agointel-iommu: move struct device_domain_info out of dma_remapping.h
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>
15 years agointel-iommu: move struct dmar_domain def out dma_remapping.h
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>
15 years agointel-iommu: move DMA PTE defs out of dma_remapping.h
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>
15 years agointel-iommu: move context entry defs out from dma_remapping.h
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>
15 years agointel-iommu: move root entry defs from dma_remapping.h
Mark McLoughlin [Thu, 20 Nov 2008 15:49:44 +0000 (15:49 +0000)]
intel-iommu: move root entry defs from dma_remapping.h

We keep the struct root_entry forward declaration for the
pointer in struct intel_iommu.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agointel-iommu: move DMA_32/64BIT_PFN into intel-iommu.c
Mark McLoughlin [Thu, 20 Nov 2008 15:49:43 +0000 (15:49 +0000)]
intel-iommu: move DMA_32/64BIT_PFN into intel-iommu.c

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agointel-iommu: make init_dmars() static
Mark McLoughlin [Thu, 20 Nov 2008 14:21:13 +0000 (14:21 +0000)]
intel-iommu: make init_dmars() static

init_dmars() is not used outside of drivers/pci/intel-iommu.c

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agointel-iommu: remove some unused struct intel_iommu fields
Mark McLoughlin [Thu, 20 Nov 2008 14:04:20 +0000 (14:04 +0000)]
intel-iommu: remove some unused struct intel_iommu fields

The seg, saved_msg and sysdev fields appear to be unused since
before the code was first merged.

linux/msi.h is not needed in linux/intel-iommu.h anymore since
there is no longer a reference to struct msi_msg. The MSI code
in drivers/pci/intel-iommu.c still has linux/msi.h included
via linux/dmar.h.

linux/sysdev.h isn't needed because there is no reference to
struct sys_device.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
15 years agoxtensa: define __fls
Rusty Russell [Sat, 3 Jan 2009 05:51:08 +0000 (16:21 +1030)]
xtensa: define __fls

Like fls, but can't be handed 0 and returns the bit number.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agomn10300: define __fls
Rusty Russell [Sat, 3 Jan 2009 05:49:03 +0000 (16:19 +1030)]
mn10300: define __fls

Like fls, but can't be handed 0 and returns the bit number.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agom32r: define __fls
Rusty Russell [Sat, 3 Jan 2009 05:46:54 +0000 (16:16 +1030)]
m32r: define __fls

Like fls, but can't be handed 0 and returns the bit number.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agoh8300: define __fls
Rusty Russell [Sat, 3 Jan 2009 05:46:04 +0000 (16:16 +1030)]
h8300: define __fls

Like fls, but can't be handed 0 and returns the bit number.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agofrv: define __fls
Rusty Russell [Sat, 3 Jan 2009 05:44:05 +0000 (16:14 +1030)]
frv: define __fls

Like fls, but can't be handed 0 and returns the bit number.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agocris: define __fls
Rusty Russell [Sat, 3 Jan 2009 05:07:14 +0000 (15:37 +1030)]
cris: define __fls

Like fls, but can't be handed 0 and returns the bit number.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
15 years agoMerge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
Linus Torvalds [Fri, 2 Jan 2009 23:57:47 +0000 (15:57 -0800)]
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6

* 'linux-next' of git://git.infradead.org/ubifs-2.6: (33 commits)
  UBIFS: add more useful debugging prints
  UBIFS: print debugging messages properly
  UBIFS: fix numerous spelling mistakes
  UBIFS: allow mounting when short of space
  UBIFS: fix writing uncompressed files
  UBIFS: fix checkpatch.pl warnings
  UBIFS: fix sparse warnings
  UBIFS: simplify make_free_space
  UBIFS: do not lie about used blocks
  UBIFS: restore budg_uncommitted_idx
  UBIFS: always commit on unmount
  UBIFS: use ubi_sync
  UBIFS: always commit in sync_fs
  UBIFS: fix file-system synchronization
  UBIFS: fix constants initialization
  UBIFS: avoid unnecessary calculations
  UBIFS: re-calculate min_idx_size after the commit
  UBIFS: use nicer 64-bit math
  UBIFS: fix available blocks count
  UBIFS: various comment improvements and fixes
  ...

15 years agoMerge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6
Linus Torvalds [Fri, 2 Jan 2009 23:57:26 +0000 (15:57 -0800)]
Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6

* 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6:
  UBI: fix checkpatch.pl warnings
  UBI: simplify PEB protection code
  UBI: prepare for protection tree improvements
  UBI: return -ENOMEM upon failing vmalloc
  UBI: document UBI ioctls
  UBI: handle write errors in WL worker
  UBI: fix error path
  UBI: some code re-structuring
  UBI: fix deadlock
  UBI: fix warnings when debugging is enabled

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next
Linus Torvalds [Fri, 2 Jan 2009 23:56:54 +0000 (15:56 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next:
  kbuild: ignore a few files in headers_check
  kbuild: add checks for include of linux/types in userspace headers
  kbuild: drop debugging leftover in tags.sh
  kbuild: document environment variables
  kbuild: make *config usage docs
  kbuild: disable sparse warning "returning void-valued expression"
  kbuild: in headers_install autoconvert asm/inline/volatile to __xxx__
  kbuild: check for leaked CONFIG_ symbols to userspace
  headers_check.pl: disallow extern's
  kconfig: improve error messages for bad source statements
  kconfig: struct property commented
  kconfig: add comments to symbol flags
  kconfig: explain symbol value defaults
  m68k: fix recursive dependency in Kconfig

15 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 2 Jan 2009 23:33:12 +0000 (15:33 -0800)]
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (27 commits)
  x86: mpparse.c fix style problems
  x86: nmi.c fix style problems
  x86: ldt.c fix style problems
  x86: cpuid.c fix style problems
  x86, UV: remove erroneous BAU initialization
  x86: fix incorrect __read_mostly on _boot_cpu_pda
  x86: convert permanent_kmaps_init() from macro to inline
  x86: early_printk - use sizeof instead of hardcoded number
  x86: xsave.c: restore_user_xstate should be static
  x86: uv_bau.h: fix dubious bitfield
  x86: apic.c: xapic_icr_read and x2apic_icr_read should be static
  x86: bios_uv.c: uv_systab should be static
  x86: genx2apic_phys.c: x2apic_send_IPI_self and init_x2apic_ldr should be static
  x86: amd_iommu.c: prealloc_protection_domains should be static
  x86: amd_iommu_init.c: iommu_enable and iommu_enable_event_logging should be static
  x86, pci: move arch/x86/pci/pci.h to arch/x86/include/asm/pci_x86.h
  x86_64: pci-gart_64.c iommu_fullflush should be static
  x86: efi.c declare add_efi_memmap before they get used
  x86: io_apic.c io_apic_sync should be static
  x86: apic.c declare pic_mode before they get used
  ...

15 years agoMerge branches 'x86/cleanups', 'x86/fpu' and 'x86/urgent' into x86/core
Ingo Molnar [Fri, 2 Jan 2009 21:41:52 +0000 (22:41 +0100)]
Merge branches 'x86/cleanups', 'x86/fpu' and 'x86/urgent' into x86/core

15 years agoMerge branch 'linus' into x86/cleanups
Ingo Molnar [Fri, 2 Jan 2009 21:41:36 +0000 (22:41 +0100)]
Merge branch 'linus' into x86/cleanups

Conflicts:
arch/x86/kernel/reboot.c

15 years agoDisallow gcc versions 3.{0,1}
Ingo Molnar [Fri, 2 Jan 2009 17:53:14 +0000 (18:53 +0100)]
Disallow gcc versions 3.{0,1}

GCC 3.0 and 3.1 are too old to build a working kernel.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
[ This check got dropped as obsolete when I simplified the gcc header
  inclusion mess in f153b82121b0366fe0e5f9553545cce237335175, but Willy
  Tarreau reports actually having those old versions still..  -Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 2 Jan 2009 19:44:09 +0000 (11:44 -0800)]
Merge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (66 commits)
  x86: export vector_used_by_percpu_irq
  x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()
  sched: nominate preferred wakeup cpu, fix
  x86: fix lguest used_vectors breakage, -v2
  x86: fix warning in arch/x86/kernel/io_apic.c
  sched: fix warning in kernel/sched.c
  sched: move test_sd_parent() to an SMP section of sched.h
  sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0
  sched: activate active load balancing in new idle cpus
  sched: bias task wakeups to preferred semi-idle packages
  sched: nominate preferred wakeup cpu
  sched: favour lower logical cpu number for sched_mc balance
  sched: framework for sched_mc/smt_power_savings=N
  sched: convert BALANCE_FOR_xx_POWER to inline functions
  x86: use possible_cpus=NUM to extend the possible cpus allowed
  x86: fix cpu_mask_to_apicid_and to include cpu_online_mask
  x86: update io_apic.c to the new cpumask code
  x86: Introduce topology_core_cpumask()/topology_thread_cpumask()
  x86: xen: use smp_call_function_many()
  x86: use work_on_cpu in x86/kernel/cpu/mcheck/mce_amd_64.c
  ...

Fixed up trivial conflict in kernel/time/tick-sched.c manually

15 years agokbuild: ignore a few files in headers_check
Sam Ravnborg [Wed, 31 Dec 2008 08:32:30 +0000 (09:32 +0100)]
kbuild: ignore a few files in headers_check

The new check for asm/types.h and linux/types.h had
a few false positives.

o We cannot let linux/types.h include linux/types.h
o The int-ll64.h and int-ll64.h define the types
  and are included by linux/types.h

Handle this by hardcoding the filenames in the headers_check script.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: add checks for include of linux/types in userspace headers
Sam Ravnborg [Tue, 30 Dec 2008 10:34:58 +0000 (11:34 +0100)]
kbuild: add checks for include of linux/types in userspace headers

If we see __[us](8|16|32|64) then we must include <linux/types.h>
If wee see include of <asm/types.h> then we recommend <linux/types.h>

Original script from Mike but modified by me.

Cc: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: drop debugging leftover in tags.sh
Sam Ravnborg [Tue, 30 Dec 2008 09:20:08 +0000 (10:20 +0100)]
kbuild: drop debugging leftover in tags.sh

Noticed by Jike.

Reported-by: "Jike Song" <albcamus@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: document environment variables
Sam Ravnborg [Mon, 29 Dec 2008 12:45:52 +0000 (13:45 +0100)]
kbuild: document environment variables

Add kbuild.txt to Documentation/kbuild
More stuff can be added later - at least we have
som of the varous environment variables documented now.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: make *config usage docs
Randy Dunlap [Fri, 29 Feb 2008 22:21:53 +0000 (14:21 -0800)]
kbuild: make *config usage docs

Create a kconfig user assistance guide, with a few tips and hints
about using menuconfig, xconfig, and gconfig.

Mostly contains user interface, environment variables, and search topics,
along with mini.config/custom.config usage.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: disable sparse warning "returning void-valued expression"
Hannes Eder [Sat, 27 Dec 2008 21:38:44 +0000 (22:38 +0100)]
kbuild: disable sparse warning "returning void-valued expression"

The sparse warning -Wreturn-void ("returning void-valued expression")
is off by default, but it is enabled with -Wall, so add
-Wno-return-void to CHECKFLAGS to disable it.

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: in headers_install autoconvert asm/inline/volatile to __xxx__
Mike Frysinger [Sat, 27 Dec 2008 08:23:15 +0000 (03:23 -0500)]
kbuild: in headers_install autoconvert asm/inline/volatile to __xxx__

Headers in userspace should be using the __xxx__ form of the asm, inline,
and volatile keywords.  Since people like to revert these things without
realizing what's going on, have the headers install step autoconvert these
keywords.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
15 years agokbuild: check for leaked CONFIG_ symbols to userspace
Sam Ravnborg [Sat, 27 Dec 2008 18:52:20 +0000 (19:52 +0100)]
kbuild: check for leaked CONFIG_ symbols to userspace

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>