summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-04-12 17:21:15 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2019-04-12 17:21:15 +0200
commit4876191cbe2a4702b0067d4156e1d8648ac36801 (patch)
tree0bbcb392495738947b71b6dbf31b673a1f0d090f /drivers
parentMerge tag 'clang-format-for-linus-v5.1-rc5' of git://github.com/ojeda/linux (diff)
parentiommu/amd: Set exclusion range correctly (diff)
downloadlinux-4876191cbe2a4702b0067d4156e1d8648ac36801.tar.xz
linux-4876191cbe2a4702b0067d4156e1d8648ac36801.zip
Merge tag 'iommu-fix-v5.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU fix from Joerg Roedel: "Fix an AMD IOMMU issue where the driver didn't correctly setup the exclusion range in the hardware registers, resulting in exclusion ranges being one page too big. This can cause data corruption of the address of that last page is used by DMA operations" * tag 'iommu-fix-v5.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/amd: Set exclusion range correctly
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iommu/amd_iommu_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 1b1378619fc9..ff40ba758cf3 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -359,7 +359,7 @@ static void iommu_write_l2(struct amd_iommu *iommu, u8 address, u32 val)
static void iommu_set_exclusion_range(struct amd_iommu *iommu)
{
u64 start = iommu->exclusion_start & PAGE_MASK;
- u64 limit = (start + iommu->exclusion_length) & PAGE_MASK;
+ u64 limit = (start + iommu->exclusion_length - 1) & PAGE_MASK;
u64 entry;
if (!iommu->exclusion_start)