[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090804221058.GA21448@linux-os.sc.intel.com>
Date: Tue, 4 Aug 2009 15:10:59 -0700
From: Fenghua Yu <fenghua.yu@...el.com>
To: David Woodhouse <dwmw2@...radead.org>,
Tony Luck <tony.luck@...el.com>
Cc: iommu@...ts.linux-foundation.org, linux-ia64@...r.kernel.org,
linux-kernel@...r.kernel.org, Fenghua Yu <fenghua.yu@...el.com>
Subject: [PATCH 3/4] Bug Fix drivers/pci/intel-iommu.c: convert paddr to correct DMA pfn
When calling domain_pfn_mapping(), paddr should be converted to DMA pfn
correctly instead just shift by VTD_PAGE_SHIFT.
This issue causes kernel panic on PAGE_SIZE>VTD_PAGE_SIZE platforms e.g. ia64
platforms.
Signed-off-by: Fenghua Yu <fenghua.yu@...el.com>
---
drivers/pci/intel-iommu.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index bec29ed..54ee63d 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2558,6 +2564,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);
@@ -2592,7 +2599,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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists