diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-28 14:06:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-28 14:06:11 -0400 |
commit | a679128d30d0303bbf5cac839c8f6f45793ea775 (patch) | |
tree | fff6dbdb31f14135dd5c3953a25f40cf1fd23e8a /drivers | |
parent | 8326e284f8deb75eee3d32b973464dd96e120843 (diff) | |
parent | 7e25a2422987a37729706b18583d177966919d2a (diff) |
Merge git://git.infradead.org/iommu-2.6
* git://git.infradead.org/iommu-2.6:
intel-iommu: fix Identity Mapping to be arch independent
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/intel-iommu.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index e53eacd75c8d..420afa887283 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/sysdev.h> | 39 | #include <linux/sysdev.h> |
40 | #include <asm/cacheflush.h> | 40 | #include <asm/cacheflush.h> |
41 | #include <asm/iommu.h> | 41 | #include <asm/iommu.h> |
42 | #include <asm/e820.h> | ||
43 | #include "pci.h" | 42 | #include "pci.h" |
44 | 43 | ||
45 | #define ROOT_SIZE VTD_PAGE_SIZE | 44 | #define ROOT_SIZE VTD_PAGE_SIZE |
@@ -1908,7 +1907,6 @@ static inline int iommu_prepare_rmrr_dev(struct dmar_rmrr_unit *rmrr, | |||
1908 | rmrr->end_address + 1); | 1907 | rmrr->end_address + 1); |
1909 | } | 1908 | } |
1910 | 1909 | ||
1911 | #ifdef CONFIG_DMAR_GFX_WA | ||
1912 | struct iommu_prepare_data { | 1910 | struct iommu_prepare_data { |
1913 | struct pci_dev *pdev; | 1911 | struct pci_dev *pdev; |
1914 | int ret; | 1912 | int ret; |
@@ -1943,6 +1941,7 @@ static int __init iommu_prepare_with_active_regions(struct pci_dev *pdev) | |||
1943 | return data.ret; | 1941 | return data.ret; |
1944 | } | 1942 | } |
1945 | 1943 | ||
1944 | #ifdef CONFIG_DMAR_GFX_WA | ||
1946 | static void __init iommu_prepare_gfx_mapping(void) | 1945 | static void __init iommu_prepare_gfx_mapping(void) |
1947 | { | 1946 | { |
1948 | struct pci_dev *pdev = NULL; | 1947 | struct pci_dev *pdev = NULL; |
@@ -2081,7 +2080,6 @@ static int domain_add_dev_info(struct dmar_domain *domain, | |||
2081 | 2080 | ||
2082 | static int iommu_prepare_static_identity_mapping(void) | 2081 | static int iommu_prepare_static_identity_mapping(void) |
2083 | { | 2082 | { |
2084 | int i; | ||
2085 | struct pci_dev *pdev = NULL; | 2083 | struct pci_dev *pdev = NULL; |
2086 | int ret; | 2084 | int ret; |
2087 | 2085 | ||
@@ -2091,17 +2089,10 @@ static int iommu_prepare_static_identity_mapping(void) | |||
2091 | 2089 | ||
2092 | printk(KERN_INFO "IOMMU: Setting identity map:\n"); | 2090 | printk(KERN_INFO "IOMMU: Setting identity map:\n"); |
2093 | for_each_pci_dev(pdev) { | 2091 | for_each_pci_dev(pdev) { |
2094 | for (i = 0; i < e820.nr_map; i++) { | 2092 | ret = iommu_prepare_with_active_regions(pdev); |
2095 | struct e820entry *ei = &e820.map[i]; | 2093 | if (ret) { |
2096 | 2094 | printk(KERN_INFO "1:1 mapping to one domain failed.\n"); | |
2097 | if (ei->type == E820_RAM) { | 2095 | return -EFAULT; |
2098 | ret = iommu_prepare_identity_map(pdev, | ||
2099 | ei->addr, ei->addr + ei->size); | ||
2100 | if (ret) { | ||
2101 | printk(KERN_INFO "1:1 mapping to one domain failed.\n"); | ||
2102 | return -EFAULT; | ||
2103 | } | ||
2104 | } | ||
2105 | } | 2096 | } |
2106 | ret = domain_add_dev_info(si_domain, pdev); | 2097 | ret = domain_add_dev_info(si_domain, pdev); |
2107 | if (ret) | 2098 | if (ret) |