Skip to content

Commit 70e535d

Browse files
David WoodhouseDavid Woodhouse
authored andcommitted
intel-iommu: Fix off-by-one in RMRR setup
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>
1 parent 8519dc4 commit 70e535d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/intel-iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,7 @@ static inline int iommu_prepare_rmrr_dev(struct dmar_rmrr_unit *rmrr,
21472147
if (pdev->dev.archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO)
21482148
return 0;
21492149
return iommu_prepare_identity_map(pdev, rmrr->base_address,
2150-
rmrr->end_address + 1);
2150+
rmrr->end_address);
21512151
}
21522152

21532153
#ifdef CONFIG_DMAR_FLOPPY_WA
@@ -2161,7 +2161,7 @@ static inline void iommu_prepare_isa(void)
21612161
return;
21622162

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

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

0 commit comments

Comments
 (0)