[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <94e36cb5-0f30-47fd-8f8d-b2babdb40aed@amd.com>
Date: Sat, 8 Nov 2025 22:54:54 +0530
From: Vasant Hegde <vasant.hegde@....com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@....com>, jgg@...dia.com,
nicolinc@...dia.com
Cc: linux-kernel@...r.kernel.org, robin.murphy@....com, will@...nel.org,
joro@...tes.org, kevin.tian@...el.com, jsnitsel@...hat.com,
iommu@...ts.linux.dev, santosh.shukla@....com, sairaj.arunkodilkar@....com,
jon.grimm@....com, prashanthpra@...gle.com, wvw@...gle.com,
wnliu@...gle.com, gptran@...gle.com, kpsingh@...gle.com,
joao.m.martins@...cle.com, alejandro.j.jimenez@...cle.com
Subject: Re: [PATCH v4 02/16] iommu/amd: Make amd_iommu_pdom_id_alloc()
non-static
On 10/21/2025 7:13 AM, Suravee Suthikulpanit wrote:
> This will be reused in a new iommufd.c file for nested translation.
s/iommufd.c/nested.c/ -OR- something like "it will be used in nested translation
support".
Ditto for next few patches.
>
> Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
> Reviewed-by: Nicolin Chen <nicolinc@...dia.com>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Reviewed-by: Vasant Hegde <vasant.hegde@....com>
-Vasant
> ---
> drivers/iommu/amd/amd_iommu.h | 1 +
> drivers/iommu/amd/iommu.c | 8 ++++----
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iommu/amd/amd_iommu.h b/drivers/iommu/amd/amd_iommu.h
> index 9b4b589a54b5..6ea549816a1f 100644
> --- a/drivers/iommu/amd/amd_iommu.h
> +++ b/drivers/iommu/amd/amd_iommu.h
> @@ -26,6 +26,7 @@ void amd_iommu_set_rlookup_table(struct amd_iommu *iommu, u16 devid);
> void iommu_feature_enable(struct amd_iommu *iommu, u8 bit);
> void *__init iommu_alloc_4k_pages(struct amd_iommu *iommu,
> gfp_t gfp, size_t size);
> +int amd_iommu_pdom_id_alloc(void);
>
> #ifdef CONFIG_AMD_IOMMU_DEBUGFS
> void amd_iommu_debugfs_setup(void);
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index a9b17d31a969..78b3e5485006 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -1818,7 +1818,7 @@ int amd_iommu_complete_ppr(struct device *dev, u32 pasid, int status, int tag)
> *
> ****************************************************************************/
>
> -static int pdom_id_alloc(void)
> +int amd_iommu_pdom_id_alloc(void)
> {
> return ida_alloc_range(&pdom_ids, 1, MAX_DOMAIN_ID - 1, GFP_ATOMIC);
> }
> @@ -1906,7 +1906,7 @@ static int setup_gcr3_table(struct gcr3_tbl_info *gcr3_info,
> return -EBUSY;
>
> /* Allocate per device domain ID */
> - domid = pdom_id_alloc();
> + domid = amd_iommu_pdom_id_alloc();
> if (domid <= 0)
> return -ENOSPC;
> gcr3_info->domid = domid;
> @@ -2489,7 +2489,7 @@ struct protection_domain *protection_domain_alloc(void)
> if (!domain)
> return NULL;
>
> - domid = pdom_id_alloc();
> + domid = amd_iommu_pdom_id_alloc();
> if (domid <= 0) {
> kfree(domain);
> return NULL;
> @@ -2681,7 +2681,7 @@ void amd_iommu_init_identity_domain(void)
> domain->ops = &identity_domain_ops;
> domain->owner = &amd_iommu_ops;
>
> - identity_domain.id = pdom_id_alloc();
> + identity_domain.id = amd_iommu_pdom_id_alloc();
>
> protection_domain_init(&identity_domain);
> }
Powered by blists - more mailing lists