Skip to content

Commit

Permalink
intel-iommu: Fix off-by-one in RMRR setup
Browse files Browse the repository at this point in the history
We were mapping an extra byte (and hence usually an extra page):
iommu_prepare_identity_map() expects to be given an 'end' argument which
is the last byte to be mapped; not the first byte *not* to be mapped.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 1, 2011
1 parent 8519dc4 commit 70e535d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2147,7 +2147,7 @@ static inline int iommu_prepare_rmrr_dev(struct dmar_rmrr_unit *rmrr,
if (pdev->dev.archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO)
return 0;
return iommu_prepare_identity_map(pdev, rmrr->base_address,
rmrr->end_address + 1);
rmrr->end_address);
}

#ifdef CONFIG_DMAR_FLOPPY_WA
Expand All @@ -2161,7 +2161,7 @@ static inline void iommu_prepare_isa(void)
return;

printk(KERN_INFO "IOMMU: Prepare 0-16MiB unity mapping for LPC\n");
ret = iommu_prepare_identity_map(pdev, 0, 16*1024*1024);
ret = iommu_prepare_identity_map(pdev, 0, 16*1024*1024 - 1);

if (ret)
printk(KERN_ERR "IOMMU: Failed to create 0-16MiB identity map; "
Expand Down

0 comments on commit 70e535d

Please sign in to comment.