aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu.c
Commit message (Collapse)AuthorAge
...
| * | x86/amd-iommu: Add a gneric version of amd_iommu_flush_all_devicesJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds a generic variant of amd_iommu_flush_all_devices function which flushes only the DTEs for a given protection domain. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | x86/amd-iommu: Use fetch_pte in amd_iommu_iova_to_physJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | Don't reimplement the page table walker in this function. Use the generic one. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | x86/amd-iommu: Use fetch_pte in iommu_unmap_pageJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | Instead of reimplementing existing logic use fetch_pte to walk the page table in iommu_unmap_page. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | x86/amd-iommu: Make fetch_pte aware of dynamic mapping levelsJoerg Roedel2009-09-03
| |/ | | | | | | | | | | | | This patch changes the fetch_pte function in the AMD IOMMU driver to support dynamic mapping levels. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* | Merge branch 'amd-iommu/passthrough' into amd-iommu/2.6.32Joerg Roedel2009-09-03
|\ \ | | | | | | | | | | | | | | | Conflicts: arch/x86/kernel/amd_iommu.c arch/x86/kernel/amd_iommu_init.c
| * | x86/amd-iommu: Don't detach device from pt domain on driver unbindJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | | | | This patch makes sure a device is not detached from the passthrough domain when the device driver is unloaded or does otherwise release the device. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | x86/amd-iommu: Make sure a device is assigned in passthrough modeJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the IOMMU driver runs in passthrough mode it has to make sure that every device not assigned to an IOMMU-API domain must be put into the passthrough domain instead of keeping it unassigned. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | x86/amd-iommu: Align locking between attach_device and detach_deviceJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | | | | This patch makes the locking behavior between the functions attach_device and __attach_device consistent with the locking behavior between detach_device and __detach_device. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | x86/amd-iommu: Fix device table write orderJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | The V bit of the device table entry has to be set after the rest of the entry is written to not confuse the hardware. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | x86/amd-iommu: Add passthrough mode initialization functionsJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | When iommu=pt is passed on kernel command line the devices should run untranslated. This requires the allocation of a special domain for that purpose. This patch implements the allocation and initialization path for iommu=pt. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | x86/amd-iommu: Add core functions for pd allocation/freeingJoerg Roedel2009-09-03
| |/ | | | | | | | | | | | | | | | | This patch factors some code of protection domain allocation into seperate functions. This way the logic can be used to allocate the passthrough domain later. As a side effect this patch fixes an unlikely domain id leakage bug. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| |
| \
*-. \ Merge branches 'gart/fixes', 'amd-iommu/fixes+cleanups' and ↵Joerg Roedel2009-09-03
|\ \ \ | |_|/ |/| | | | | 'amd-iommu/fault-handling' into amd-iommu/2.6.32
| | * x86/amd-iommu: Reset command buffer if wait loop failsJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | Instead of a panic on an comletion wait loop failure, try to recover from that event from resetting the command buffer. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * x86/amd-iommu: Panic if IOMMU command buffer reset failsJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | To prevent the driver from doing recursive command buffer resets, just panic when that recursion happens. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * x86/amd-iommu: Reset command buffer on ILLEGAL_COMMAND_ERRORJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | | | | On an ILLEGAL_COMMAND_ERROR the IOMMU stops executing further commands. This patch changes the code to handle this case better by resetting the command buffer in the IOMMU. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * x86/amd-iommu: Add function to flush all DTEs on one IOMMUJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | | | | This function flushes all DTE entries on one IOMMU for all devices behind this IOMMU. This is required for command buffer resetting later. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * x86/amd-iommu: Introduce function for iommu-local domain flushJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a function to flush all domain tlbs for on one given IOMMU. This is required later to reset the command buffer on one IOMMU. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * x86/amd-iommu: Dump illegal command on ILLEGAL_COMMAND_ERRORJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | | | | This patch adds code to dump the command which caused an ILLEGAL_COMMAND_ERROR raised by the IOMMU hardware. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * x86/amd-iommu: Dump fault entry on DTE errorJoerg Roedel2009-09-03
| |/ |/| | | | | | | | | | | | | This patch adds code to dump the content of the device table entry which caused an ILLEGAL_DEV_TABLE_ENTRY error from the IOMMU hardware. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * x86/amd-iommu: fix broken check in amd_iommu_flush_all_devicesJoerg Roedel2009-09-03
| | | | | | | | | | | | | | | | | | The amd_iommu_pd_table is indexed by protection domain number and not by device id. So this check is broken and must be removed. Cc: stable@kernel.org Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * x86/amd-iommu: replace "AMD IOMMU" by "AMD-Vi"Joerg Roedel2009-09-03
| | | | | | | | | | | | | | This patch replaces the "AMD IOMMU" printk strings with the official name for the hardware: "AMD-Vi". Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * x86/amd-iommu: Remove some merge helper codeJoerg Roedel2009-09-03
|/ | | | | | | This patch removes some left-overs which where put into the code to simplify merging code which also depends on changes in other trees. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* x86: Mark device_nb as static and fix NULL noiseJaswinder Singh Rajput2009-07-01
| | | | | | | | | | | | | | | | | | | | | | | This sparse warning: arch/x86/kernel/amd_iommu.c:1195:23: warning: symbol 'device_nb' was not declared. Should it be static? triggers because device_nb is global but is only used in a single .c file. change device_nb to static to fix that - this also addresses the sparse warning. This sparse warning: arch/x86/kernel/amd_iommu.c:1766:10: warning: Using plain integer as NULL pointer triggers because plain integer 0 is used in place of a NULL pointer. change 0 to NULL to fix that - this also address the sparse warning. Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Cc: Joerg Roedel <joerg.roedel@amd.com> LKML-Reference: <1246458194.6940.20.camel@hpdv5.satnam> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* amd-iommu: flush domain tlb when attaching a new deviceChris Wright2009-06-15
| | | | | | | | | | | | When kexec'ing to a new kernel (for example, when crashing and launching a kdump session), the AMD IOMMU may have cached translations. The kexec'd kernel, during initialization, will invalidate the IOMMU device table entries, but not the domain translations. These stale entries can cause a device's DMA to fail, makes it rough to write a dump to disk when the disk controller can't DMA ;-) Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* amd-iommu: remove unnecessary "AMD IOMMU: " prefixJoerg Roedel2009-06-09
| | | | | | | That prefix is already included in the DUMP_printk macro. So there is no need to repeat it in the format string. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* amd-iommu: detach device explicitly before attaching it to a new domainJoerg Roedel2009-06-09
| | | | | | | | | | | This fixes a bug with a device that could not be assigned to a KVM guest because it is still assigned to a dma_ops protection domain. [chrisw: simply remove WARN_ON(), will always fire since dev->driver will be pci-sub] Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* amd-iommu: remove BUS_NOTIFY_BOUND_DRIVER handlingJoerg Roedel2009-06-09
| | | | | | | | Handling this event causes device assignment in KVM to fail because the device gets re-attached as soon as the pci-stub registers as the driver for the device. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
* Merge commit 'tip/core/iommu' into amd-iommu/fixesJoerg Roedel2009-06-09
|\
| *---. Merge branches 'amd-iommu/fixes', 'amd-iommu/debug', ↵Joerg Roedel2009-05-28
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'amd-iommu/suspend-resume' and 'amd-iommu/extended-allocator' into amd-iommu/2.6.31 Conflicts: arch/x86/kernel/amd_iommu.c arch/x86/kernel/amd_iommu_init.c
| | | | * amd-iommu: don't free dma adresses below 512MB with CONFIG_IOMMU_STRESSJoerg Roedel2009-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will test the automatic aperture enlargement code. This is important because only very few devices will ever trigger this code path. So force it under CONFIG_IOMMU_STRESS. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: don't preallocate page tables with CONFIG_IOMMU_STRESSJoerg Roedel2009-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This forces testing of on-demand page table allocation code. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: disable round-robin allocator for CONFIG_IOMMU_STRESSJoerg Roedel2009-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disabling the round-robin allocator results in reusing the same dma-addresses again very fast. This is a good test if the iotlb flushing is working correctly. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: remove amd_iommu_size kernel parameterJoerg Roedel2009-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This parameter is not longer necessary when aperture increases dynamically. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: enlarge the aperture dynamicallyJoerg Roedel2009-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By dynamically increasing the aperture the extended allocator is now ready for use. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: handle exlusion ranges and unity mappings in alloc_new_rangeJoerg Roedel2009-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes sure no reserved addresses are allocated in an dma_ops domain when the aperture is increased dynamically. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | | | * amd-iommu: move aperture_range allocation code to seperate functionJoerg Roedel2009-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28
| | |/ | | | | | | | | | | | | | | | | | | 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-03
|/ / | | | | | | | | | | | | | | | | | | | | 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-28
|/ | | | | | | | | | | | | 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-03
|\ | | | | | | | | | | | | | | | | | | | | | | * 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-24
| | | | | | | | | | | | | | | | | | 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-05
|\ \ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into core/iommu