iommufd: Reserve all negative IDs in the iommufd xarray
authorYi Liu <yi.l.liu@intel.com>
Tue, 18 Jul 2023 10:55:35 +0000 (03:55 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 25 Jul 2023 16:17:48 +0000 (10:17 -0600)
commiteda175dfe2484c1e79afaee0f65eeebfb9f89a53
tree0f01680a30f08db970294d291138fd490911fb95
parent6e6c513fe1d8b53417aa84a56fac5bbda8b3a720
iommufd: Reserve all negative IDs in the iommufd xarray

With this reservation, IOMMUFD users can encode the negative IDs for
specific purposes. e.g. VFIO needs two reserved values to tell userspace
the ID returned is not valid but has other meaning.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Yanting Jiang <yanting.jiang@intel.com>
Tested-by: Terrence Xu <terrence.xu@intel.com>
Tested-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Link: https://lore.kernel.org/r/20230718105542.4138-4-yi.l.liu@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/iommu/iommufd/main.c