aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/intel-iommu.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-06-28 11:00:42 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-06-29 08:39:05 -0400
commit1a4a45516d7a57de0691352d899d7008f2e090d1 (patch)
tree022ff1b91357207801dc000caab27004324b3c8b /drivers/pci/intel-iommu.c
parent03d6a2461ab1704c171ce21081c5022378ef7a91 (diff)
intel-iommu: Remove last use of PHYSICAL_PAGE_MASK, for reserving PCI BARs
This is fairly broken anyway -- it doesn't take hotplug into account. We should probably be checking page_is_ram() instead. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/intel-iommu.c')
-rw-r--r--drivers/pci/intel-iommu.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 6afe44cb6815..a55f5fb06b14 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -62,9 +62,6 @@
62#define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32)) 62#define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32))
63#define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64)) 63#define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64))
64 64
65#ifndef PHYSICAL_PAGE_MASK
66#define PHYSICAL_PAGE_MASK PAGE_MASK
67#endif
68 65
69/* VT-d pages must always be _smaller_ than MM pages. Otherwise things 66/* VT-d pages must always be _smaller_ than MM pages. Otherwise things
70 are never going to work. */ 67 are never going to work. */
@@ -1307,7 +1304,6 @@ static void dmar_init_reserved_ranges(void)
1307 struct pci_dev *pdev = NULL; 1304 struct pci_dev *pdev = NULL;
1308 struct iova *iova; 1305 struct iova *iova;
1309 int i; 1306 int i;
1310 u64 addr, size;
1311 1307
1312 init_iova_domain(&reserved_iova_list, DMA_32BIT_PFN); 1308 init_iova_domain(&reserved_iova_list, DMA_32BIT_PFN);
1313 1309
@@ -1330,12 +1326,9 @@ static void dmar_init_reserved_ranges(void)
1330 r = &pdev->resource[i]; 1326 r = &pdev->resource[i];
1331 if (!r->flags || !(r->flags & IORESOURCE_MEM)) 1327 if (!r->flags || !(r->flags & IORESOURCE_MEM))
1332 continue; 1328 continue;
1333 addr = r->start; 1329 iova = reserve_iova(&reserved_iova_list,
1334 addr &= PHYSICAL_PAGE_MASK; 1330 IOVA_PFN(r->start),
1335 size = r->end - addr; 1331 IOVA_PFN(r->end));
1336 size = PAGE_ALIGN(size);
1337 iova = reserve_iova(&reserved_iova_list, IOVA_PFN(addr),
1338 IOVA_PFN(size + addr) - 1);
1339 if (!iova) 1332 if (!iova)
1340 printk(KERN_ERR "Reserve iova failed\n"); 1333 printk(KERN_ERR "Reserve iova failed\n");
1341 } 1334 }