Commit 1a4a4551 authored by David Woodhouse's avatar David Woodhouse

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: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 03d6a246
...@@ -62,9 +62,6 @@ ...@@ -62,9 +62,6 @@
#define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32)) #define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32))
#define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64)) #define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64))
#ifndef PHYSICAL_PAGE_MASK
#define PHYSICAL_PAGE_MASK PAGE_MASK
#endif
/* VT-d pages must always be _smaller_ than MM pages. Otherwise things /* VT-d pages must always be _smaller_ than MM pages. Otherwise things
are never going to work. */ are never going to work. */
...@@ -1307,7 +1304,6 @@ static void dmar_init_reserved_ranges(void) ...@@ -1307,7 +1304,6 @@ static void dmar_init_reserved_ranges(void)
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
struct iova *iova; struct iova *iova;
int i; int i;
u64 addr, size;
init_iova_domain(&reserved_iova_list, DMA_32BIT_PFN); init_iova_domain(&reserved_iova_list, DMA_32BIT_PFN);
...@@ -1330,12 +1326,9 @@ static void dmar_init_reserved_ranges(void) ...@@ -1330,12 +1326,9 @@ static void dmar_init_reserved_ranges(void)
r = &pdev->resource[i]; r = &pdev->resource[i];
if (!r->flags || !(r->flags & IORESOURCE_MEM)) if (!r->flags || !(r->flags & IORESOURCE_MEM))
continue; continue;
addr = r->start; iova = reserve_iova(&reserved_iova_list,
addr &= PHYSICAL_PAGE_MASK; IOVA_PFN(r->start),
size = r->end - addr; IOVA_PFN(r->end));
size = PAGE_ALIGN(size);
iova = reserve_iova(&reserved_iova_list, IOVA_PFN(addr),
IOVA_PFN(size + addr) - 1);
if (!iova) if (!iova)
printk(KERN_ERR "Reserve iova failed\n"); printk(KERN_ERR "Reserve iova failed\n");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment