summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | | AMD IOMMU: add necessary header defines for stats countingJoerg Roedel2009-01-031-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: add defines to make iommu stats collection configurable Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | | | | AMD IOMMU: add Kconfig entry for statistic collection codeJoerg Roedel2009-01-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: adds new Kconfig entry Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | | | | AMD IOMMU: use dev_name in iommu_enable functionJoerg Roedel2009-01-031-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: cleanup 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 amd_iommu_isolate to boolJoerg Roedel2009-01-032-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: cleanup Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | | | | AMD IOMMU: convert iommu->need_sync to boolJoerg Roedel2009-01-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-032-14/+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-032-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | | | | AMD IOMMU: rename set_device_domain functionJoerg Roedel2009-01-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: rename set_device_domain() to attach_device() Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | | | | AMD IOMMU: add device reference counting for protection domainsJoerg Roedel2009-01-032-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: know how many devices are assigned to a domain Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | | | | AMD IOMMU: add checks for dma_ops domain to dma_ops functionsJoerg Roedel2009-01-031-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: detect when a driver uses a device assigned otherwise Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | | | | AMD IOMMU: add protection domain flagsJoerg Roedel2009-01-032-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | | | | AMD IOMMU: add iommu_flush_domain functionJoerg Roedel2009-01-031-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: add a function to flush a domain id on every IOMMU Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | | | | AMD IOMMU: don't remove protection domain from iommu_pd_listJoerg Roedel2009-01-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | | | | AMD IOMMU: move invalidation command building to a separate functionJoerg Roedel2009-01-031-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: refactoring of iommu_queue_inv_iommu_pages Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | | | | AMD IOMMU: refactor completion wait handling into separate functionsJoerg Roedel2009-01-031-23/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | | | | AMD IOMMU: add domain id free functionJoerg Roedel2009-01-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: add code to release a domain id Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| | * | | | | AMD IOMMU: make dma_ops_free_pagetable genericJoerg Roedel2009-01-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | | | | AMD IOMMU: rename iommu_map to iommu_map_pageJoerg Roedel2009-01-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | kvm/iommu: fix compile warningJoerg Roedel2009-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a compile warning about a variable thats maybe used uninitialized in the function. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | | | | | intel-iommu: fix bit shift at DOMAIN_FLAG_P2P_MULTIPLE_DEVICESMike Day2009-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mike Day <ncmike@ncultra.org> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | | | | | VT-d: remove now unused intel_iommu_found functionJoerg Roedel2009-01-032-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | | | | | VT-d: register functions for the IOMMU APIJoerg Roedel2009-01-031-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | | | | | VT-d: adapt domain iova_to_phys function for IOMMU APIJoerg Roedel2009-01-032-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | | | | | VT-d: adapt domain map and unmap functions for IOMMU APIJoerg Roedel2009-01-032-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | | | | | VT-d: adapt device attach and detach functions for IOMMU APIJoerg Roedel2009-01-032-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | | | | | VT-d: adapt domain init and destroy functions for IOMMU APIJoerg Roedel2009-01-032-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | | | | | KVM: change KVM to use IOMMU APIJoerg Roedel2009-01-039-34/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
| * | | | | | select IOMMU_API when DMAR and/or AMD_IOMMU is selectedJoerg Roedel2009-01-033-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | add frontend implementation for the IOMMU APIJoerg Roedel2009-01-031-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | introcude linux/iommu.h for an iommu apiJoerg Roedel2009-01-031-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | KVM: rename vtd.c to iommu.cJoerg Roedel2009-01-033-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | Deassign device in kvm_free_assgined_deviceWeidong Han2009-01-033-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | KVM: support device deassignmentWeidong Han2009-01-033-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | KVM: use the new intel iommu APIsWeidong Han2009-01-033-49/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | Check agaw is sufficient for mapped memoryWeidong Han2009-01-031-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | Change intel iommu APIs of virtual machine domainWeidong Han2009-01-032-79/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | | Change domain_context_mapping_one for virtual machine domainWeidong Han2009-01-031-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>