** Description changed: [Impact] + iommu/amd: Reserve exclusion range in iova-domain If a device has an exclusion range specified in the IVRS table, this region needs to be reserved in the iova-domain of that device. This hasn't happened until now and can cause data corruption on data transfered with these devices. Treat exclusion ranges as reserved regions in the iommu-core to fix the problem. - This is a clean cherry pick from mainline of 8aafaaf2212192012f5bae305bb31cdf7681d777 - 3c677d206210f53a4be972211066c0f1cd47fe12 + iommu/amd: Set exclusion range correctly + + The exlcusion range limit register needs to contain the + base-address of the last page that is part of the range, as + bits 0-11 of this register are treated as 0xfff by the + hardware for comparisons. + + So correctly set the exclusion range in the hardware to the + last page which is _in_ the range. [Test Case] [Fixes] Cherry pick the following from Mainline fd3b3448cf5adc2a2f09b70eaad03c27fe79e7a6 iommu/amd: Reserve exclusion range in iova-domain 3c677d206210f53a4be972211066c0f1cd47fe12 iommu/amd: Set exclusion range correctly These can be picked from my branches here: Bionic - https://code.launchpad.net/~bladernr/ubuntu/+source/linux/+git/bionic - Cosmic: https://code.launchpad.net/~bladernr/ubuntu/+source/linux/+git/cosmic - Disco: - https://code.launchpad.net/~bladernr/ubuntu/+source/linux/+git/disco + https://code.launchpad.net/~bladernr/ubuntu/+source/linux/+git/bionic 1823037-amd_iommu-cherrypick + Cosmic: https://code.launchpad.net/~bladernr/ubuntu/+source/linux/+git/cosmic 1823037-amd_iommu-cherrypick + Disco: + https://code.launchpad.net/~bladernr/ubuntu/+source/linux/+git/disco 1823037-amd_iommu-cherrypick - I do not believe these are necessary for Eoan, 5.1 should already - include them but it's worth verifying that as I started work on this - prior to Eoan's cycle. + Note Disco only required f1cd47fe12 as the first patch was already + picked in LP: #1830934 + + Not necessary for Eoan, they're in 5.2-rc1. [Regression Risk] + Low, Only affects the amd_iommu driver: drivers/iommu/amd_iommu*
** Description changed: [Impact] - iommu/amd: Reserve exclusion range in iova-domain - If a device has an exclusion range specified in the IVRS table, this region needs to be reserved in the iova-domain of that device. This hasn't happened until now and can cause data corruption on data transfered with these devices. - - Treat exclusion ranges as reserved regions in the iommu-core to fix the - problem. - iommu/amd: Set exclusion range correctly - + + BugLink: https://bugs.launchpad.net/bugs/1823037 + The exlcusion range limit register needs to contain the base-address of the last page that is part of the range, as bits 0-11 of this register are treated as 0xfff by the hardware for comparisons. - + So correctly set the exclusion range in the hardware to the last page which is _in_ the range. + + Fixes: b2026aa2dce44 ('x86, AMD IOMMU: add functions for programming IOMMU MMIO space') + Signed-off-by: Joerg Roedel <jroe...@suse.de> + + (cherry picked from commit 3c677d206210f53a4be972211066c0f1cd47fe12) + Signed-off-by: Jeffrey Lane <jeffrey.l...@canonical.com> + + + iommu/amd: Reserve exclusion range in iova-domain + + BugLink: https://bugs.launchpad.net/bugs/1823037 + + If a device has an exclusion range specified in the IVRS + table, this region needs to be reserved in the iova-domain + of that device. This hasn't happened until now and can cause + data corruption on data transfered with these devices. + + Treat exclusion ranges as reserved regions in the iommu-core + to fix the problem. + + Fixes: be2a022c0dd0 ('x86, AMD IOMMU: add functions to parse IOMMU memory mapping requirements for devices') + Signed-off-by: Joerg Roedel <jroe...@suse.de> + Reviewed-by: Gary R Hook <gary.h...@amd.com> + + (cherry picked from commit 8aafaaf2212192012f5bae305bb31cdf7681d777) + Signed-off-by: Jeffrey Lane <jeffrey.l...@canonical.com> [Test Case] [Fixes] Cherry pick the following from Mainline fd3b3448cf5adc2a2f09b70eaad03c27fe79e7a6 iommu/amd: Reserve exclusion range in iova-domain 3c677d206210f53a4be972211066c0f1cd47fe12 iommu/amd: Set exclusion range correctly These can be picked from my branches here: Bionic https://code.launchpad.net/~bladernr/ubuntu/+source/linux/+git/bionic 1823037-amd_iommu-cherrypick Cosmic: https://code.launchpad.net/~bladernr/ubuntu/+source/linux/+git/cosmic 1823037-amd_iommu-cherrypick Disco: https://code.launchpad.net/~bladernr/ubuntu/+source/linux/+git/disco 1823037-amd_iommu-cherrypick Note Disco only required f1cd47fe12 as the first patch was already picked in LP: #1830934 Not necessary for Eoan, they're in 5.2-rc1. [Regression Risk] - Low, + Low, Only affects the amd_iommu driver: drivers/iommu/amd_iommu* -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1823037 Title: amd_iommu possible data corruption To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1823037/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs