Skip to content

Commit

Permalink
intel-iommu: Mask physical address to correct page size in intel_map_…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Fenghua Yu authored and David Woodhouse committed Aug 5, 2009
1 parent f532959 commit 33041ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 33041ec

Please sign in to comment.