From: Vasant Hegde <vasant.hegde@amd.com>
To: Jason Gunthorpe <jgg@nvidia.com>,
iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Will Deacon <will@kernel.org>
Cc: Joerg Roedel <jroedel@suse.de>, patches@lists.linux.dev
Subject: Re: [PATCH] iommu/amd: Test for PAGING domains before freeing a domain
Date: Wed, 11 Sep 2024 15:06:44 +0530 [thread overview]
Message-ID: <f1313605-694e-454f-8d08-e5baa6f52179@amd.com> (raw)
In-Reply-To: <0-v1-ad9884ee5f5b+da-amd_iopgtbl_fix_jgg@nvidia.com>
On 9/11/2024 1:30 AM, Jason Gunthorpe wrote:
> This domain free function can be called for IDENTITY and SVA domains too,
> and they don't have page tables. For now protect against this by checking
> the type. Eventually the different types should have their own free
> functions.
>
> Fixes: 485534bfccb2 ("iommu/amd: Remove conditions from domain free paths")
> Reported-by: Vasant Hegde <vasant.hegde@amd.com>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
-Vasant
> ---
> drivers/iommu/amd/iommu.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Joerg please pick or squash for this cycle, thanks
>
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index 2d0a681a205211..154f90e7b98e1d 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -2257,7 +2257,8 @@ static void cleanup_domain(struct protection_domain *domain)
> void protection_domain_free(struct protection_domain *domain)
> {
> WARN_ON(!list_empty(&domain->dev_list));
> - free_io_pgtable_ops(&domain->iop.pgtbl.ops);
> + if (domain->domain.type & __IOMMU_DOMAIN_PAGING)
> + free_io_pgtable_ops(&domain->iop.pgtbl.ops);
> domain_id_free(domain->id);
> kfree(domain);
> }
>
> base-commit: 22c91287502b4bfc2899a1006709eec8273cf052
prev parent reply other threads:[~2024-09-11 9:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 20:00 [PATCH] iommu/amd: Test for PAGING domains before freeing a domain Jason Gunthorpe
2024-09-11 9:36 ` Vasant Hegde [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f1313605-694e-454f-8d08-e5baa6f52179@amd.com \
--to=vasant.hegde@amd.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=jroedel@suse.de \
--cc=patches@lists.linux.dev \
--cc=suravee.suthikulpanit@amd.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox