[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b51a7f7bfc0419b8941cf7ee0601b70@huawei.com>
Date: Wed, 5 Mar 2025 09:01:40 +0000
From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@...wei.com>
To: Nicolin Chen <nicolinc@...dia.com>, "will@...nel.org" <will@...nel.org>,
"robin.murphy@....com" <robin.murphy@....com>, "jgg@...dia.com"
<jgg@...dia.com>
CC: "joro@...tes.org" <joro@...tes.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "iommu@...ts.linux.dev"
<iommu@...ts.linux.dev>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v1 4/4] iommu/arm-smmu-v3-iommufd: Allow a shared
s2_parent to allocate vSMMU
> -----Original Message-----
> From: Nicolin Chen <nicolinc@...dia.com>
> Sent: Wednesday, March 5, 2025 5:04 AM
> To: will@...nel.org; robin.murphy@....com; jgg@...dia.com
> Cc: joro@...tes.org; linux-arm-kernel@...ts.infradead.org;
> iommu@...ts.linux.dev; linux-kernel@...r.kernel.org; Shameerali Kolothum
> Thodi <shameerali.kolothum.thodi@...wei.com>
> Subject: [PATCH v1 4/4] iommu/arm-smmu-v3-iommufd: Allow a shared
> s2_parent to allocate vSMMU
>
> Now, vmids are stored in vSMMU objects. So all vSMMUs assigned to the
> same
> VM can share a s2_parent domain. This means a vIOMMU allocation per
> device
> behind one SMMU can be given with a s2_parent domain that's allocated
> per
> another device behind another SMMU, i.e. s2_parent->smmu != master-
> >smmu.
>
> Remove the validation line to allow this use case.
>
> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
> b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
> index 2c5a9d0abed5..9bfa5fa5bafa 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
> @@ -378,9 +378,6 @@ struct iommufd_viommu *arm_vsmmu_alloc(struct
> device *dev,
> if (!(smmu->features & ARM_SMMU_FEAT_NESTING))
> return ERR_PTR(-EOPNOTSUPP);
>
> - if (s2_parent->smmu != master->smmu)
> - return ERR_PTR(-EINVAL);
> -
Not sure we can just relax this like this. What if the two physical SMMUs are different in
functionality/features? Do we need some kind of sanity check here?
Thanks,
Shameer
Powered by blists - more mailing lists