Re: [PATCH v6 07/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC
From: Jason Gunthorpe
Date: Thu Oct 31 2024 - 09:15:12 EST
On Wed, Oct 30, 2024 at 02:34:33PM -0700, Nicolin Chen wrote:
> +static struct iommufd_hwpt_nested *
> +iommufd_viommu_alloc_hwpt_nested(struct iommufd_viommu *viommu, u32 flags,
> + const struct iommu_user_data *user_data)
> +{
> + struct iommufd_hwpt_nested *hwpt_nested;
> + struct iommufd_hw_pagetable *hwpt;
> + int rc;
> +
> + if ((flags & ~IOMMU_HWPT_FAULT_ID_VALID) || !user_data->len)
> + return ERR_PTR(-EOPNOTSUPP);
Now that flags exists we are expecting the driver to validate it, so
this check on flags should be dropped?
Or we go back to hiding FAULT_ID_VALID from the driver (and keep the flags)?
Jason