From: Jason Gunthorpe <jgg@ziepe.ca>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Joonwon Kang <joonwonkang@google.com>,
Alexander.Grest@microsoft.com, amhetre@nvidia.com,
baolu.lu@linux.intel.com, iommu@lists.linux.dev, joro@8bytes.org,
jpb@kernel.org, kees@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, nicolinc@nvidia.com,
praan@google.com, smostafa@google.com, will@kernel.org,
jacob.jun.pan@linux.intel.com,
easwar.hariharan@linux.microsoft.com, kevin.tian@intel.com
Subject: Re: [PATCH RFC] iommu: Enable per-device SSID space for SVA
Date: Mon, 11 May 2026 10:21:28 -0300 [thread overview]
Message-ID: <20260511132128.GM9285@ziepe.ca> (raw)
In-Reply-To: <30eefd04-1d0f-45d8-b55d-e3e8d41a57ef@arm.com>
On Mon, May 11, 2026 at 01:39:06PM +0100, Robin Murphy wrote:
> On 2026-05-09 6:10 pm, Jason Gunthorpe wrote:
> > On Thu, May 07, 2026 at 09:58:51AM +0000, Joonwon Kang wrote:
> >
> > > By "similar instruction" on ARM, I guess you mean ST64BV0, which fetches
> > > the bottom 32 bits data from ACCDATA_EL1. Please let me know if you meant
> > > others as it will matter. If ST64BV0 is supported on ARM, however, it
> > > would mean that ST64B and ST64BV are also supported already according to
> > > the ID_AA64ISAR1_EL1's LS64 field. The latter 2 instructions are just to
> > > atomically store whatever user wants to a memory location without
> > > referring to ACCDATA_EL1 and all the 3 instructions can be run at EL0. So,
> > > the userspace driver would have enough capability to designate arbitrary
> > > PASID as it wants via the latter 2 instructions when communicating with
> > > multiple devices.
> >
> > IDK exactly what ARM did. IIRC on Intel ENQCMD forms a special
> > non-posted write TLP and the device can tell the TLP came from ENQCMD
> > and so it trusts the encoded PASID. ARM has to have done the same
> > thing - allowing anyone to forge the PASID by using a different
> > instruction misses the point of the Intel design.
>
> Yes, ACCDATA_EL1 is a privileged register neither writeable nor readable by
> userspace[1], so it should be functionally equivalent from an SVA point of
> view.
There is a bit more going on though, I think that is what Joonwon is
mentioning by asking about ST64B and ST64BV. I *think* the answer is:
- ST64B uses a posted write
- ST64BV can be restricted so EL0 cannot execute it, it uses a
non-posted write (AI tells me via EnASR)
- ST64BV0 can be used by EL0, always uses a non-posted write, and always
uses ACCDATA_EL1
Which is similar to Intel. The device only processes the PASID from a
non-posted write, and the CPU prevents userspace from forming
non-posted writes except through ST64BV0
> > Honestly, I'm not sure why they even implemented it. SMMUv3 can't do
> > the translation scheme required to use ENQCMD from a VM anyhow, so it
> > is pretty useless.
>
> Not sure what you mean there - indeed you can't do the SIOV thing of
> assigning individual ADIs to _different_ VMs, but there's still no reason
> you couldn't give the whole accelerator device to one VM, and run the "full"
> kernel driver in that VM to hand out ADIs to processes, same as for
> non-virtualised ST64BV0/ENQCMD usage. It's entirely usable, just not so
> "scalable".
Well yes, technically, but I'm not sure this is attractive in
practice.
The value of ENQCMD on Intel was it can eliminate any HW side
per-context state for simple HW like DMA engines, including for
virtualization.
You pay for that value with some performance loss, but it can be
attractive because of the universal scalability.
However complex devices don't seem to want to use it, once you have to
have per-context state for any other reason the performance downsides
of ENQCMD make it unappealing.
So, IDK, maybe some embedded on-chip device will find a way to make
good use of it, but also I'm not aware of any adoption on x86..
Jason
next prev parent reply other threads:[~2026-05-11 13:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 8:53 [PATCH RFC] iommu: Enable per-device SSID space for SVA Joonwon Kang
2026-04-24 13:39 ` Jason Gunthorpe
2026-05-07 8:15 ` Tian, Kevin
2026-05-09 17:03 ` Jason Gunthorpe
2026-05-07 9:58 ` Joonwon Kang
2026-05-09 17:10 ` Jason Gunthorpe
2026-05-11 12:39 ` Robin Murphy
2026-05-11 13:21 ` Jason Gunthorpe [this message]
2026-05-12 9:57 ` Joonwon Kang
2026-05-12 12:40 ` Jason Gunthorpe
2026-05-12 13:53 ` Robin Murphy
2026-05-12 14:51 ` Joonwon Kang
2026-05-12 15:11 ` Jason Gunthorpe
2026-05-12 10:07 ` Joonwon Kang
2026-04-28 17:38 ` Easwar Hariharan
2026-04-28 17:44 ` Jason Gunthorpe
-- strict thread matches above, loose matches on Subject: below --
2026-04-24 8:50 Joonwon Kang
2026-04-24 8:57 ` Joonwon Kang
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=20260511132128.GM9285@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=Alexander.Grest@microsoft.com \
--cc=amhetre@nvidia.com \
--cc=baolu.lu@linux.intel.com \
--cc=easwar.hariharan@linux.microsoft.com \
--cc=iommu@lists.linux.dev \
--cc=jacob.jun.pan@linux.intel.com \
--cc=joonwonkang@google.com \
--cc=joro@8bytes.org \
--cc=jpb@kernel.org \
--cc=kees@kernel.org \
--cc=kevin.tian@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--cc=praan@google.com \
--cc=robin.murphy@arm.com \
--cc=smostafa@google.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