mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@linux.dev>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Thierry Reding <thierry.reding@kernel.org>,
	Krishna Reddy <vdumpa@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jean-Philippe Brucker <jpb@kernel.org>,
	linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH RFC v7 7/7] iommu/arm-smmu-v3: Wire up shared-SID STE ordering and feature gating
Date: Sat, 7 Nov 2026 21:14:34 +0800	[thread overview]
Message-ID: <au8kOjsfkFhs1ye7@fedora> (raw)
In-Reply-To: <aujbMKormSlNQMOm@nvidia.com>

On Mon, Nov 02, 2026 at 10:49:20AM -0800, Nicolin Chen wrote:
>On Fri, Oct 30, 2026 at 08:09:39PM +0800, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>> 
>> With the per-domain CD table, every non-PASID sharer of a SID builds the
>> same normal-domain STE: same S1ContextPtr, S1DSS and S1CDMAX. Disable
>> stall and ATS for shared SIDs as well, so the remaining STE fields are
>> common too, and let any sharer program the STE. This also handles the
>> case where one device's driver attaches before the stream owner's driver:
>> the first attach now installs a valid STE instead of leaving the boot or
>> firmware STE in place.
>> 
>> A release or blocked attach must not abort a shared STE while other
>> sharers remain, otherwise it would break their ongoing DMA. Skip those
>> writes while the SID is shared; the last master (no longer shared) still
>> tears the STE down. This also means removing one device from a shared
>> group no longer leaves the survivors aborted.
>> 
>> Fault events on shared SIDs cannot be attributed to a specific master,
>> so arm_smmu_find_master() returns NULL when the stream's shared_masters
>> list is non-empty.
>> 
>> Disable SVA, PASID, vSMMU nesting, ATS and IOPF/stall for shared-SID
>> masters since all of them require an unambiguous SID-to-device mapping.
>> Reject sharing at insert_master() time if either master has stall enabled,
>> or if the existing master has PASID or ATS enabled.
>> 
>> Introduce arm_smmu_master_stall_enabled() to describe the policy actually
>> programmed into the hardware: a master stalls only if it asked for it and
>> its StreamID is not shared.
>
>Why do we need this? A stall_enabled master shouldn't share its
>SID in the first place.
>
>> Add arm_smmu_is_shared_sid() as an inline helper in arm-smmu-v3.h so that
>
>Use arm_smmu_master_shares_sid or arm_smmu_master_has_shared_sid.
>
>> arm-smmu-v3-sva.c and arm-smmu-v3-iommufd.c can use it without repeating
>> the list_empty() pattern.
>> 
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>
>Please check sashiko findings; all seems valid.
>
>https://sashiko.dev/#/patchset/20261030-smmu-shared-sid-ver7-2026-10-26-v7-0-961726ebd6ab%40Example.Com

Yeah. I checked them every time. Seems the patchset will be bloating again.

Thanks
Peng

>
>Nicolin
>

      reply	other threads:[~2026-11-07 13:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 12:09 [PATCH RFC v7 0/7] iommu/arm-smmu-v3: Support shared Stream IDs Peng Fan (OSS)
2026-10-30 12:09 ` [PATCH RFC v7 1/7] iommu/arm-smmu-v3: Allocate streams individually Peng Fan (OSS)
2026-10-30 12:09 ` [PATCH RFC v7 2/7] iommu/arm-smmu-v3: Delay stream allocation to inside the mutex Peng Fan (OSS)
2026-10-30 12:09 ` [PATCH RFC v7 3/7] iommu/arm-smmu-v3: Plumb the CD table into the CD helpers Peng Fan (OSS)
2026-10-30 20:54   ` Nicolin Chen
2026-10-30 12:09 ` [PATCH RFC v7 4/7] iommu/arm-smmu-v3: Use a per-domain CD table for non-PASID streams Peng Fan (OSS)
2026-10-31  1:07   ` Nicolin Chen
2026-11-07 13:08     ` Peng Fan
2026-10-30 12:09 ` [PATCH RFC v7 5/7] iommu/arm-smmu-v3: Support shared SIDs in insert/remove_master Peng Fan (OSS)
2026-10-30 12:09 ` [PATCH RFC v7 6/7] iommu/arm-smmu-v3: Group aliasing devices into the same IOMMU group Peng Fan (OSS)
2026-11-02 18:31   ` Nicolin Chen
2026-10-30 12:09 ` [PATCH RFC v7 7/7] iommu/arm-smmu-v3: Wire up shared-SID STE ordering and feature gating Peng Fan (OSS)
2026-11-02 18:49   ` Nicolin Chen
2026-11-07 13:14     ` Peng Fan [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=au8kOjsfkFhs1ye7@fedora \
    --to=peng.fan@linux.dev \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=jonathanh@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=jpb@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=robin.murphy@arm.com \
    --cc=thierry.reding@kernel.org \
    --cc=vdumpa@nvidia.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

all inboxes | Powered by JetHome®