diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 19:39:42 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 19:39:42 -0400 |
| commit | 6d16d6d9bb6f93e6f8506cfb3e91795d6443d54f (patch) | |
| tree | 92a1c9e4b645fa6d1fffedaeb56141b66f847320 /drivers/base | |
| parent | 431bf99d26157d56689e5de65bd27ce9f077fc3f (diff) | |
| parent | b395fb36d59e17b9335805c10fa30fc51c8a94c6 (diff) | |
Merge branch 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
iommu/core: Fix build with INTR_REMAP=y && CONFIG_DMAR=n
iommu/amd: Don't use MSI address range for DMA addresses
iommu/amd: Move missing parts to drivers/iommu
iommu: Move iommu Kconfig entries to submenu
x86/ia64: intel-iommu: move to drivers/iommu/
x86: amd_iommu: move to drivers/iommu/
msm: iommu: move to drivers/iommu/
drivers: iommu: move to a dedicated folder
x86/amd-iommu: Store device alias as dev_data pointer
x86/amd-iommu: Search for existind dev_data before allocting a new one
x86/amd-iommu: Allow dev_data->alias to be NULL
x86/amd-iommu: Use only dev_data in low-level domain attach/detach functions
x86/amd-iommu: Use only dev_data for dte and iotlb flushing routines
x86/amd-iommu: Store ATS state in dev_data
x86/amd-iommu: Store devid in dev_data
x86/amd-iommu: Introduce global dev_data_list
x86/amd-iommu: Remove redundant device_flush_dte() calls
iommu-api: Add missing header file
Fix up trivial conflicts (independent additions close to each other) in
drivers/Makefile and include/linux/pci.h
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/Makefile | 1 | ||||
| -rw-r--r-- | drivers/base/iommu.c | 124 |
2 files changed, 0 insertions, 125 deletions
diff --git a/drivers/base/Makefile b/drivers/base/Makefile index 4c5701c15f53..5ab0d07c4578 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile | |||
| @@ -13,7 +13,6 @@ obj-$(CONFIG_FW_LOADER) += firmware_class.o | |||
| 13 | obj-$(CONFIG_NUMA) += node.o | 13 | obj-$(CONFIG_NUMA) += node.o |
| 14 | obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o | 14 | obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o |
| 15 | obj-$(CONFIG_SMP) += topology.o | 15 | obj-$(CONFIG_SMP) += topology.o |
| 16 | obj-$(CONFIG_IOMMU_API) += iommu.o | ||
| 17 | ifeq ($(CONFIG_SYSFS),y) | 16 | ifeq ($(CONFIG_SYSFS),y) |
| 18 | obj-$(CONFIG_MODULES) += module.o | 17 | obj-$(CONFIG_MODULES) += module.o |
| 19 | endif | 18 | endif |
diff --git a/drivers/base/iommu.c b/drivers/base/iommu.c deleted file mode 100644 index 6e6b6a11b3ce..000000000000 --- a/drivers/base/iommu.c +++ /dev/null | |||
| @@ -1,124 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. | ||
| 3 | * Author: Joerg Roedel <joerg.roedel@amd.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 as published | ||
| 7 | * by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <linux/bug.h> | ||
| 20 | #include <linux/types.h> | ||
| 21 | #include <linux/module.h> | ||
| 22 | #include <linux/slab.h> | ||
| 23 | #include <linux/errno.h> | ||
| 24 | #include <linux/iommu.h> | ||
| 25 | |||
| 26 | static struct iommu_ops *iommu_ops; | ||
| 27 | |||
| 28 | void register_iommu(struct iommu_ops *ops) | ||
| 29 | { | ||
| 30 | if (iommu_ops) | ||
| 31 | BUG(); | ||
| 32 | |||
| 33 | iommu_ops = ops; | ||
| 34 | } | ||
| 35 | |||
| 36 | bool iommu_found(void) | ||
| 37 | { | ||
| 38 | return iommu_ops != NULL; | ||
| 39 | } | ||
| 40 | EXPORT_SYMBOL_GPL(iommu_found); | ||
| 41 | |||
| 42 | struct iommu_domain *iommu_domain_alloc(void) | ||
| 43 | { | ||
| 44 | struct iommu_domain *domain; | ||
| 45 | int ret; | ||
| 46 | |||
| 47 | domain = kmalloc(sizeof(*domain), GFP_KERNEL); | ||
| 48 | if (!domain) | ||
| 49 | return NULL; | ||
| 50 | |||
| 51 | ret = iommu_ops->domain_init(domain); | ||
| 52 | if (ret) | ||
| 53 | goto out_free; | ||
| 54 | |||
| 55 | return domain; | ||
| 56 | |||
| 57 | out_free: | ||
| 58 | kfree(domain); | ||
| 59 | |||
| 60 | return NULL; | ||
| 61 | } | ||
| 62 | EXPORT_SYMBOL_GPL(iommu_domain_alloc); | ||
| 63 | |||
| 64 | void iommu_domain_free(struct iommu_domain *domain) | ||
| 65 | { | ||
| 66 | iommu_ops->domain_destroy(domain); | ||
| 67 | kfree(domain); | ||
| 68 | } | ||
| 69 | EXPORT_SYMBOL_GPL(iommu_domain_free); | ||
| 70 | |||
| 71 | int iommu_attach_device(struct iommu_domain *domain, struct device *dev) | ||
| 72 | { | ||
| 73 | return iommu_ops->attach_dev(domain, dev); | ||
| 74 | } | ||
| 75 | EXPORT_SYMBOL_GPL(iommu_attach_device); | ||
| 76 | |||
| 77 | void iommu_detach_device(struct iommu_domain *domain, struct device *dev) | ||
| 78 | { | ||
| 79 | iommu_ops->detach_dev(domain, dev); | ||
| 80 | } | ||
| 81 | EXPORT_SYMBOL_GPL(iommu_detach_device); | ||
| 82 | |||
| 83 | phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | ||
| 84 | unsigned long iova) | ||
| 85 | { | ||
| 86 | return iommu_ops->iova_to_phys(domain, iova); | ||
| 87 | } | ||
| 88 | EXPORT_SYMBOL_GPL(iommu_iova_to_phys); | ||
| 89 | |||
| 90 | int iommu_domain_has_cap(struct iommu_domain *domain, | ||
| 91 | unsigned long cap) | ||
| 92 | { | ||
| 93 | return iommu_ops->domain_has_cap(domain, cap); | ||
| 94 | } | ||
| 95 | EXPORT_SYMBOL_GPL(iommu_domain_has_cap); | ||
| 96 | |||
| 97 | int iommu_map(struct iommu_domain *domain, unsigned long iova, | ||
| 98 | phys_addr_t paddr, int gfp_order, int prot) | ||
| 99 | { | ||
| 100 | unsigned long invalid_mask; | ||
| 101 | size_t size; | ||
| 102 | |||
| 103 | size = 0x1000UL << gfp_order; | ||
| 104 | invalid_mask = size - 1; | ||
| 105 | |||
| 106 | BUG_ON((iova | paddr) & invalid_mask); | ||
| 107 | |||
| 108 | return iommu_ops->map(domain, iova, paddr, gfp_order, prot); | ||
| 109 | } | ||
| 110 | EXPORT_SYMBOL_GPL(iommu_map); | ||
| 111 | |||
| 112 | int iommu_unmap(struct iommu_domain *domain, unsigned long iova, int gfp_order) | ||
| 113 | { | ||
| 114 | unsigned long invalid_mask; | ||
| 115 | size_t size; | ||
| 116 | |||
| 117 | size = 0x1000UL << gfp_order; | ||
| 118 | invalid_mask = size - 1; | ||
| 119 | |||
| 120 | BUG_ON(iova & invalid_mask); | ||
| 121 | |||
| 122 | return iommu_ops->unmap(domain, iova, gfp_order); | ||
| 123 | } | ||
| 124 | EXPORT_SYMBOL_GPL(iommu_unmap); | ||
