summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu.c
Commit message (Collapse)AuthorAgeFilesLines
...
| | | | * amd-iommu: move aperture_range allocation code to seperate functionJoerg Roedel2009-05-281-36/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch prepares the dynamic increasement of dma_ops domain apertures. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: change dma_dom->next_bit to dma_dom->next_addressJoerg Roedel2009-05-281-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the code a little bit by using the same unit for all address space related state in the dma_ops domain structure. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: make address allocator aware of multiple aperture rangesJoerg Roedel2009-05-281-37/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the AMD IOMMU address allocator to allow up to 32 aperture ranges per dma_ops domain. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: handle page table allocation failures in dma_ops codeJoerg Roedel2009-05-281-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code will be required when the aperture size increases dynamically in the extended address allocator. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: move page table allocation code to seperate functionJoerg Roedel2009-05-281-25/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes page table allocation usable for dma_ops code. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: introduce aperture_range structureJoerg Roedel2009-05-281-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preperation for extended address allocator. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * | amd-iommu: add function to flush tlb for all devicesJoerg Roedel2009-05-281-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is required for suspend/resume support with AMD IOMMU enabled. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * | amd-iommu: add function to flush tlb for all domainsJoerg Roedel2009-05-281-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is required for suspend/resume support with AMD IOMMU enabled. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | * | amd-iommu: introduce for_each_iommu* macrosJoerg Roedel2009-05-281-4/+4
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the for_each_iommu and for_each_iommu_safe macros to simplify the developers life when having to iterate over all AMD IOMMUs in the system. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | amd-iommu: move protection domain printk to dump codeJoerg Roedel2009-05-281-4/+6
| | |/ | | | | | | | | | | | | | | | | | | This information is only helpful for debugging. Don't print it anymore unless explicitly requested. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | | amd_iommu: fix lock imbalanceJiri Slaby2009-06-031-1/+3
|/ / | | | | | | | | | | | | | | | | | | | | In alloc_coherent there is an omitted unlock on the path where mapping fails. Add the unlock. [ Impact: fix lock imbalance in alloc_coherent ] Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | amd iommu: properly detach from protection domain on ->removeChris Wright2009-05-281-1/+5
|/ | | | | | | | | | | | | Some drivers may use the dma api during ->remove which will cause a protection domain to get reattached to a device. Delay the detach until after the driver is completely unbound. [ joro: added a little merge helper ] [ Impact: fix too early device<->domain removal ] Signed-off-by: Chris Wright <chrisw@redhat.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* Merge git://git.infradead.org/iommu-2.6Linus Torvalds2009-04-031-0/+7
|\ | | | | | | | | | | | | | | | | | | | | | | * git://git.infradead.org/iommu-2.6: intel-iommu: Fix address wrap on 32-bit kernel. intel-iommu: Enable DMAR on 32-bit kernel. intel-iommu: fix PCI device detach from virtual machine intel-iommu: VT-d page table to support snooping control bit iommu: Add domain_has_cap iommu_ops intel-iommu: Snooping control support Fixed trivial conflicts in arch/x86/Kconfig and drivers/pci/intel-iommu.c
| * iommu: Add domain_has_cap iommu_opsSheng Yang2009-03-241-0/+7
| | | | | | | | | | | | | | | | | | This iommu_op can tell if domain have a specific capability, like snooping control for Intel IOMMU, which can be used by other components of kernel to adjust the behaviour. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | Merge branch 'iommu/fixes-2.6.29' of ↵Ingo Molnar2009-03-051-2/+0
|\ \ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into core/iommu
| * | AMD IOMMU: remove unnecessary ifdefFUJITA Tomonori2009-03-051-2/+0
| |/ | | | | | | | | | | | | | | We try to avoid this type of ifdef and we can safely remove this ifdef. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | x86, ia64: convert to use generic dma_map_ops structFUJITA Tomonori2009-01-061-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This converts X86 and IA64 to use include/linux/dma-mapping.h. It's a bit large but pretty boring. The major change for X86 is converting 'int dir' to 'enum dma_data_direction dir' in DMA mapping operations. The major changes for IA64 is using map_page and unmap_page instead of map_single and unmap_single. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* | x86: remove map_single and unmap_single in struct dma_mapping_opsFUJITA Tomonori2009-01-061-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | This patch converts dma_map_single and dma_unmap_single to use map_page and unmap_page respectively and removes unnecessary map_single and unmap_single in struct dma_mapping_ops. This leaves intel-iommu's dma_map_single and dma_unmap_single since IA64 uses them. They will be removed after the unification. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* | x86, AMD IOMMU: add map_page and unmap_pageFUJITA Tomonori2009-01-061-4/+23
|/ | | | | | | | | | | This is a preparation of struct dma_mapping_ops unification. We use map_page and unmap_page instead of map_single and unmap_single. We will remove map_single and unmap_single hooks in the last patch in this patchset. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* AMD IOMMU: remove now unnecessary #ifdefsJoerg Roedel2009-01-031-11/+0
| | | | | | | 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>
* AMD IOMMU: prealloc_protection_domains should be staticJaswinder Singh Rajput2009-01-031-1/+1
| | | | | | | | | | 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>
* AMD IOMMU: add statistics about total number of map requestsJoerg Roedel2009-01-031-0/+4
| | | | | | Impact: see total number of map requests in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add statistics about allocated io memoryJoerg Roedel2009-01-031-0/+6
| | | | | | Impact: see amount of allocated io memory in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for domain tlb flushesJoerg Roedel2009-01-031-0/+4
| | | | | | Impact: see number of domain tlb flushes in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for single iommu domain tlb flushesJoerg Roedel2009-01-031-0/+4
| | | | | | Impact: see number of single iommu domain tlb flushes in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for cross-page requestJoerg Roedel2009-01-031-0/+5
| | | | | | Impact: see number of requests for more than one page in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for free_coherent requestsJoerg Roedel2009-01-031-0/+4
| | | | | | Impact: see number of free_coherent requests in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for alloc_coherent requestsJoerg Roedel2009-01-031-0/+4
| | | | | | Impact: see number of alloc_coherent requests in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for unmap_sg requestsJoerg Roedel2009-01-031-0/+4
| | | | | | Impact: see number of unmap_sg requests in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for map_sg requestsJoerg Roedel2009-01-031-0/+4
| | | | | | Impact: see number of map_sg requests in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for unmap_single requestsJoerg Roedel2009-01-031-0/+4
| | | | | | Impact: see number of unmap_single requests in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for map_single requestsJoerg Roedel2009-01-031-0/+4
| | | | | | Impact: see number of map_single requests in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add stats counter for completion wait eventsJoerg Roedel2009-01-031-0/+6
| | | | | | Impact: see number of completion wait events in debugfs Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add init code for statistic collectionJoerg Roedel2009-01-031-0/+37
| | | | | | Impact: create a new debugfs directory Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: use calc_devid in prealloc_protection_domainsJoerg Roedel2009-01-031-1/+1
| | | | | | Impact: cleanup Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: convert iommu->need_sync to boolJoerg Roedel2009-01-031-2/+2
| | | | | | Impact: use bool instead of int for iommu->need_sync Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: use dev_name instead of self-build print_devidJoerg Roedel2009-01-031-2/+1
| | | | | | Impact: use generic dev_name instead of own function Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: allocate a new protection for hotplugged devicesJoerg Roedel2009-01-031-0/+17
| | | | | | Impact: also hotplug devices benefit from device isolation Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add a domain flag for default domainsJoerg Roedel2009-01-031-0/+1
| | | | | | Impact: adds a new protection domain flag Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: register functions for the IOMMU APIJoerg Roedel2009-01-031-0/+18
| | | | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add domain address lookup function for IOMMU APIJoerg Roedel2009-01-031-0/+31
| | | | | | Impact: add a generic function to lockup addresses in protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add domain unmap function for IOMMU APIJoerg Roedel2009-01-031-0/+41
| | | | | | Impact: add a generic function to unmap pages into protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add domain map function for IOMMU APIJoerg Roedel2009-01-031-0/+29
| | | | | | Impact: add a generic function to map pages into protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add device attach function for IOMMU APIJoerg Roedel2009-01-031-0/+35
| | | | | | Impact: add a generic function to attach devices to protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add device detach function for IOMMU APIJoerg Roedel2009-01-031-0/+26
| | | | | | Impact: add a generic function to detach devices from protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add domain destroy function for IOMMU APIJoerg Roedel2009-01-031-0/+21
| | | | | | Impact: add a generic function for releasing protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add domain init function for IOMMU APIJoerg Roedel2009-01-031-0/+30
| | | | | | Impact: add a generic function for allocation protection domains Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add domain cleanup helper functionJoerg Roedel2009-01-031-0/+28
| | | | | | Impact: add a function to remove all devices from a domain Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add device notifier callbackJoerg Roedel2009-01-031-2/+60
| | | | | | Impact: inform IOMMU about state change of a device in the driver core Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* AMD IOMMU: add device detach helper functionsJoerg Roedel2009-01-031-0/+39
| | | | | | Impact: add helper functions to detach a device from a domain Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
OpenPOWER on IntegriCloud