[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250616100303.GA17132@willie-the-truck>
Date: Mon, 16 Jun 2025 11:03:04 +0100
From: Will Deacon <will@...nel.org>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: jgg@...dia.com, kevin.tian@...el.com, robin.murphy@....com,
joro@...tes.org, praan@...gle.com, yi.l.liu@...el.com,
peterz@...radead.org, jsnitsel@...hat.com,
linux-arm-kernel@...ts.infradead.org, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, patches@...ts.linux.dev,
baolu.lu@...ux.intel.com
Subject: Re: [PATCH v2 10/14] iommu/arm-smmu-v3: Replace arm_vsmmu_alloc with
arm_vsmmu_init
On Fri, Jun 13, 2025 at 11:35:22PM -0700, Nicolin Chen wrote:
> To ease the for-driver iommufd APIs, get_viommu_size and viommu_init ops
> are introduced.
>
> Sanitize the inputs and report the size of struct arm_vsmmu on success, in
> arm_smmu_get_viommu_size().
>
> Place the type sanity at the last, becase there will be soon an impl level
> get_viommu_size op, which will require the same sanity tests prior. It can
> simply insert a piece of code in front of the IOMMU_VIOMMU_TYPE_ARM_SMMUV3
> sanity.
>
> The core will ensure the viommu_type is set to the core vIOMMU object, and
> pass in the same dev pointer, so arm_vsmmu_init() won't need to repeat the
> same sanity tests but to simply init the arm_vsmmu struct.
>
> Remove the arm_vsmmu_alloc, completing the replacement.
>
> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 11 +++--
> .../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 46 ++++++++++---------
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 3 +-
> 3 files changed, 32 insertions(+), 28 deletions(-)
Acked-by: Will Deacon <will@...nel.org>
Will
Powered by blists - more mailing lists