]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
iommu/vt-d: Duplicate iommu_resv_region objects per device list
authorEric Auger <eric.auger@redhat.com>
Mon, 3 Jun 2019 06:53:31 +0000 (08:53 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit25db6a0ba177834f7682188e434c8601001042c4
tree8470c5d25bd240a8311e9997a9fad3c5af26c939
parent7d28216351edcab392d571483bf22758e7c1fa79
iommu/vt-d: Duplicate iommu_resv_region objects per device list

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 5f64ce5411b467f1cfea6c63e2494c22b773582b ]

intel_iommu_get_resv_regions() aims to return the list of
reserved regions accessible by a given @device. However several
devices can access the same reserved memory region and when
building the list it is not safe to use a single iommu_resv_region
object, whose container is the RMRR. This iommu_resv_region must
be duplicated per device reserved region list.

Let's remove the struct iommu_resv_region from the RMRR unit
and allocate the iommu_resv_region directly in
intel_iommu_get_resv_regions(). We hold the dmar_global_lock instead
of the rcu-lock to allow sleeping.

Fixes: 0659b8dc45a6 ("iommu/vt-d: Implement reserved region get/put callbacks")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/iommu/intel-iommu.c