From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
To: aiyengar1990@gmail.com, "Joerg Roedel (AMD)" <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 2/3] iommu/vsi: Unlink the IOMMU from its old domain under that domain's lock
Date: Mon, 16 Nov 2026 09:08:08 +0100 [thread overview]
Message-ID: <c8ef7666-41fc-4979-86be-aa60eb8c5554@collabora.com> (raw)
In-Reply-To: <20261114-iommu-vsi-fixes-v1-2-1fc7728dfd35@gmail.com>
Le 14/11/2026 à 01:14, Arun Iyengar via B4 Relay a écrit :
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> Attaching a paging domain moves iommu->node to the new domain's list
> holding only the new domain's lock. A concurrent map or unmap on the old
> domain walks the old list in vsi_iommu_flush_tlb() and can follow the
> moved node into the new list.
>
> Unlink the IOMMU under the old domain's lock first.
>
> Fixes: 917ace84b770 ("iommu: Add verisilicon IOMMU driver")
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Closes: https://lore.kernel.org/all/sashiko-outbox-206639@kernel.org/
> Cc: stable@vger.kernel.org
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
> drivers/iommu/vsi-iommu.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/vsi-iommu.c b/drivers/iommu/vsi-iommu.c
> index 5156e8a2e7fc..8a0f253f2017 100644
> --- a/drivers/iommu/vsi-iommu.c
> +++ b/drivers/iommu/vsi-iommu.c
> @@ -575,12 +575,13 @@ static int vsi_iommu_attach_device(struct iommu_domain *domain,
> if (ret < 0)
> return ret;
>
> + vsi_iommu_list_del(iommu);
> +
> spin_lock_irqsave(&vsi_domain->lock, flags);
> spin_lock(&iommu->lock);
>
> vsi_iommu_enable(iommu, domain);
>
> - list_del_init(&iommu->node);
> list_add_tail(&iommu->node, &vsi_domain->iommus);
>
> iommu->domain = domain;
>
next prev parent reply other threads:[~2026-11-16 8:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 0:14 [PATCH 0/3] iommu/vsi: Fix the domain locking and a probe leak Arun Iyengar via B4 Relay
2026-11-14 0:14 ` [PATCH 1/3] iommu/vsi: Don't use the identity domain as a paging domain Arun Iyengar via B4 Relay
2026-11-16 8:07 ` Benjamin Gaignard
2026-11-14 0:14 ` [PATCH 2/3] iommu/vsi: Unlink the IOMMU from its old domain under that domain's lock Arun Iyengar via B4 Relay
2026-11-16 8:08 ` Benjamin Gaignard [this message]
2026-11-14 0:14 ` [PATCH 3/3] iommu/vsi: Unprepare the clocks when getting the IRQ fails Arun Iyengar via B4 Relay
2026-11-16 8:08 ` Benjamin Gaignard
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=c8ef7666-41fc-4979-86be-aa60eb8c5554@collabora.com \
--to=benjamin.gaignard@collabora.com \
--cc=aiyengar1990@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=stable@vger.kernel.org \
--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
all inboxes | Powered by JetHome®