From: Robin Murphy <robin.murphy@arm.com>
To: Peng Fan <peng.fan@nxp.com>,
"eric.auger@redhat.com" <eric.auger@redhat.com>,
"jean-philippe.brucker@arm.com" <jean-philippe.brucker@arm.com>,
"will@kernel.org" <will@kernel.org>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: arm-smmu-v3 sharing SID
Date: Thu, 18 May 2023 12:33:25 +0100 [thread overview]
Message-ID: <359b01bc-e87a-9a50-c971-681e89985491@arm.com> (raw)
In-Reply-To: <DU0PR04MB94172CB3F138AD39E9B6DEEF887F9@DU0PR04MB9417.eurprd04.prod.outlook.com>
On 2023-05-18 11:46, Peng Fan wrote:
> Hi all,
>
> Current arm-smmu-v3 driver does not support sharing SID,
> If there are two devices sharing one SID, the smmu-v3 driver
> will report "stream x already in tree".
>
> We have an SOC that using smmu-v3, only supports limited
> SIDs. From my understanding, the smmu-v3 hardware
> supports SID sharing, but linux driver not support that.
Ugh, we've always hoped that nobody would build such a thing, since
SMMUv3 allows for plenty of stream IDs for any reasonable system (Arm's
implementations support at least 24 bits), and aliasing at the StreamID
level does rather compromise the usefulness.
> I would like know is it ok to add support for sharing SID?
> Something like to use common rb_add/find, not
> smmu-v3 driver local rb tree add/find.
Not sure what you're thinking there - the StreamID tree is still private
to the SMMU instance either way, and the existing arm_smmu_find_master()
function is ideal for arm_smmu_device_group() to detect aliasing devices
and group them appropriately. Then you also need some way to skip
updating STEs that have already been touched for a previous device in
the group (basically generalising what arm_smmu_install_ste_for_dev()
currently does for duplicate StreamIDs owned by one device).
I'm fairly confident in reasoning about this for basic .attach_dev
purposes, since I did implement the equivalent for SMMUv2, but I'm not
sure I even want to think about what it would mean for SVA, PASIDs and
nesting...
Thanks,
Robin.
next prev parent reply other threads:[~2023-05-18 11:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-18 10:46 arm-smmu-v3 sharing SID Peng Fan
2023-05-18 11:33 ` Robin Murphy [this message]
2023-05-18 11:44 ` Peng Fan
2023-05-18 13:04 ` Jean-Philippe Brucker
2023-05-19 2:49 ` Baolu Lu
2023-05-18 12:36 ` Jason Gunthorpe
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=359b01bc-e87a-9a50-c971-681e89985491@arm.com \
--to=robin.murphy@arm.com \
--cc=eric.auger@redhat.com \
--cc=iommu@lists.linux.dev \
--cc=jean-philippe.brucker@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=peng.fan@nxp.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