iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Vasant Hegde <vasant.hegde@amd.com>
Cc: iommu@lists.linux.dev, robin.murphy@arm.com,
	suravee.suthikulpanit@amd.com
Subject: Re: [PATCH 2/5] iommu/amd: Protect domain update with domain_lock
Date: Mon, 26 Sep 2022 13:22:50 +0200	[thread overview]
Message-ID: <YzGLimZhwwt6qIVB@8bytes.org> (raw)
In-Reply-To: <20220912063248.7909-3-vasant.hegde@amd.com>

Hi Vasant,

On Mon, Sep 12, 2022 at 06:32:45AM +0000, Vasant Hegde wrote:
> In protection_domain_free() path it calls amd_iommu_domain_update() to
> update IOMMU.
>   protection_domain_free -> free_io_pgtable_ops ->
>     v1_free_pgtable -> amd_iommu_domain_update
> 
> Make sure its protected using domain->lock.

A concurrent access to the domain at this point would be a bug in
itself, and the locking wouldn't help here either because the domain
including the lock is freed right after release.

Do you see and concurrent accesses to the domain at this point?

Regards,

	Joerg


  reply	other threads:[~2022-09-26 11:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  6:32 [PATCH 0/5] amd/iommu: Cleanup and fixes Vasant Hegde
2022-09-12  6:32 ` [PATCH 1/5] iommu/amd: Free domain id in error path Vasant Hegde
2022-09-12  6:32 ` [PATCH 2/5] iommu/amd: Protect domain update with domain_lock Vasant Hegde
2022-09-26 11:22   ` Joerg Roedel [this message]
2022-09-28  5:39     ` Vasant Hegde
2022-09-12  6:32 ` [PATCH 3/5] iommu/amd: Free domain ID after domain_flush_pages Vasant Hegde
2022-09-12  6:32 ` [PATCH 4/5] iommu/amd: Remove outdated comment Vasant Hegde
2022-09-12  6:32 ` [PATCH 5/5] iommu/amd: Fix sparse warning Vasant Hegde
2022-09-26 11:29 ` [PATCH 0/5] amd/iommu: Cleanup and fixes Joerg Roedel

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=YzGLimZhwwt6qIVB@8bytes.org \
    --to=joro@8bytes.org \
    --cc=iommu@lists.linux.dev \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    /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;
as well as URLs for NNTP newsgroup(s).