aboutsummaryrefslogtreecommitdiff
path: root/drivers/vhost
diff options
context:
space:
mode:
authorGravatar Pasha Tatashin <pasha.tatashin@soleen.com> 2023-12-26 18:28:27 +0000
committerGravatar Michael S. Tsirkin <mst@redhat.com> 2023-12-27 15:50:36 -0500
commitab78ffe1ff7d17102972348bb9b1a16ec2696a2b (patch)
tree2155a928c84fd9dffce874844da8a53d3cd57d61 /drivers/vhost
parentvdpa: Fix an error handling path in eni_vdpa_probe() (diff)
downloadlinux-ab78ffe1ff7d17102972348bb9b1a16ec2696a2b.tar.gz
linux-ab78ffe1ff7d17102972348bb9b1a16ec2696a2b.tar.bz2
linux-ab78ffe1ff7d17102972348bb9b1a16ec2696a2b.zip
vhost-vdpa: account iommu allocations
iommu allocations should be accounted in order to allow admins to monitor and limit the amount of iommu memory. Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20231226182827.294158-1-pasha.tatashin@soleen.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: David Rientjes <rientjes@google.com>
Diffstat (limited to 'drivers/vhost')
-rw-r--r--drivers/vhost/vdpa.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index da7ec77cdaff..a51c69c078d9 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -968,7 +968,8 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
r = ops->set_map(vdpa, asid, iotlb);
} else {
r = iommu_map(v->domain, iova, pa, size,
- perm_to_iommu_flags(perm), GFP_KERNEL);
+ perm_to_iommu_flags(perm),
+ GFP_KERNEL_ACCOUNT);
}
if (r) {
vhost_iotlb_del_range(iotlb, iova, iova + size - 1);