summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorFenghua Yu <fenghua.yu@intel.com>2009-08-04 15:10:59 -0700
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-08-05 09:15:48 +0100
commit33041ec049d39a6e0463c7edc7b6f631d24559e3 (patch)
tree319c613d743f4beae0b00603266f261d6f1dbbae /drivers/pci
parentf532959b77e5e567c84c914cb7c7b07d2582448b (diff)
downloadblackbird-obmc-linux-33041ec049d39a6e0463c7edc7b6f631d24559e3.tar.gz
blackbird-obmc-linux-33041ec049d39a6e0463c7edc7b6f631d24559e3.zip
intel-iommu: Mask physical address to correct page size in intel_map_single()
The physical address passed to domain_pfn_mapping() should be rounded down to the start of the MM page, not the VT-d page. This issue causes kernel panic on PAGE_SIZE>VTD_PAGE_SIZE platforms e.g. ia64 platforms. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/intel-iommu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 11b317a78b49..af7ff9b5aed8 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2551,6 +2551,7 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
int prot = 0;
int ret;
struct intel_iommu *iommu;
+ unsigned long paddr_pfn = paddr >> PAGE_SHIFT;
BUG_ON(dir == DMA_NONE);
@@ -2585,7 +2586,7 @@ static dma_addr_t __intel_map_single(struct device *hwdev, phys_addr_t paddr,
* is not a big problem
*/
ret = domain_pfn_mapping(domain, mm_to_dma_pfn(iova->pfn_lo),
- paddr >> VTD_PAGE_SHIFT, size, prot);
+ mm_to_dma_pfn(paddr_pfn), size, prot);
if (ret)
goto error;
OpenPOWER on IntegriCloud