From: "Arnd Bergmann" <arnd@arndb.de>
To: "Ryan Roberts" <ryan.roberts@arm.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Jean-Philippe Brucker" <jpb@kernel.org>,
"Oded Gabbay" <ogabbay@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org
Subject: Re: [RFC PATCH v1 8/8] misc/arm-cla: Add userspace interface
Date: Fri, 17 Jul 2026 22:11:26 +0200 [thread overview]
Message-ID: <ec998612-c527-4294-837b-5aa375b81cc1@app.fastmail.com> (raw)
In-Reply-To: <2a69d96e-d37e-4e3d-8eaa-3ea31caf3893@arm.com>
On Fri, Jul 17, 2026, at 18:21, Ryan Roberts wrote:
> On 17/07/2026 16:31, Arnd Bergmann wrote:
>>
>> Without concrete implementation examples, I find it hard to imagine
>> how granular the CLA and accelerator blocks are. What I'm interested
>> in is separating things into special character devices when they
>> refer to units that you want to manage separately in userspace.
>>
>> If you have e.g. one accelerator for tensor operations and one for
>> handling gzip, I would very much want to see those have a separate
>> chardev nodes so a local administrator can give permissions to each
>> one separately, and have device names that are sensible to the
>> functionality underneath.
>
> Unfortunately this doesn't map well to the HW: the MMIO is for the
> CLA interface (each CPU has 1 CLA).
I'm sure you mentioned it in the documentation, but I missed that
there are never multiple CLA instances.
If the CLA is defined only in terms of its MMIO/DMA interface
and listening to TLB broadcast operations, is having a single
instance actually required by the design, or just an implementation
choice?
> Once you have access to that interface, you can
> communicate with all of the accelerators that are connected to the CLA. We could
> potentially use the availability masking control to only expose a single
> accelerator for a given context (which would be chosen based on which file you
> opened), but it wouldn't be possible for (e.g.) 2 different processes to access
> the different accelerators concurrently - they would have to be subject to the
> time slice model.
Right, that sounds a bit awkward. It sounds like this would also get
simpler with a model that ensures the current CLA ttbr0 matches the
CPU ttbr0 and the iotlb_mm setting, since you would never have concurrent
uses of a single CLA from multipel tasks. On the other hand, that
model would make it harder to use multiple accelerators from a
single task, if they have to go through multiple file descriptors
but could be accessed on a single mapping.
>> If you have separate accelerators for AES encryption and decryption,
>> or a large set of identical accelerators that can run concurrently,
>> those would of course get managed as a single device file.
>>
>> Most importantly, I don't think a global /dev/cla device node
>> is a sensible interface from a management perspective as that
>> would give unprivileged userspace direct control to something
>> that is essentially arbitrary (or buggy) vendor firmware
>> with DMA permissions.
>
> OK I see your point.
>
> While the interface supports up to 8 connected accelerators, we anticpate there
> only being a single compute accelerator in practice. We decided to keep the
> driver interface generic given the CLA spec, but perhaps it would be more
> straightforward to limit the driver implementation to only permitting a single
> accelerator?
Probably, yes. From a kernel perspective, I think we're a bit better
off with an abstraction like
- One CLA MMIO range per /type/ of accelerator on a given CPU
- One firmware node per CLA, possibly spanning multiple CPUs
if the accelerators behind them are shared.
- One character device per firmware node, named according to the
type of CLA
- Possibly multiple CLA nodes on a given CPU if multiple
unrelated accelerators are present
- optionally multiple related accelerators on the eight ports of
a CLA, if that makes sense for that device type
Not sure how far that is off from what you currently have in
the hardware design.
Arnd
next prev parent reply other threads:[~2026-07-17 20:11 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 10:47 [RFC PATCH v1 0/8] Arm Core Local Accelerator Driver Ryan Roberts
2026-07-17 10:47 ` [RFC PATCH v1 1/8] misc/arm-cla: Add driver skeleton and documentation Ryan Roberts
2026-07-17 13:49 ` Arnd Bergmann
2026-07-17 15:44 ` Ryan Roberts
2026-07-17 16:10 ` Arnd Bergmann
2026-07-17 10:47 ` [RFC PATCH v1 2/8] misc/arm-cla: Add launch operation helpers Ryan Roberts
2026-07-17 12:16 ` Arnd Bergmann
2026-07-17 10:47 ` [RFC PATCH v1 3/8] misc/arm-cla: Probe firmware-described devices Ryan Roberts
2026-07-17 12:25 ` Arnd Bergmann
2026-07-17 12:36 ` Ryan Roberts
2026-07-17 10:47 ` [RFC PATCH v1 4/8] misc/arm-cla: Initialize devices on CPU bringup Ryan Roberts
2026-07-17 10:47 ` [RFC PATCH v1 5/8] misc/arm-cla: Accelerator context save and restore Ryan Roberts
2026-07-17 10:47 ` [RFC PATCH v1 6/8] misc/arm-cla: Set up memory translation context Ryan Roberts
2026-07-17 10:47 ` [RFC PATCH v1 7/8] misc/arm-cla: Manage domain contexts Ryan Roberts
2026-07-17 10:47 ` [RFC PATCH v1 8/8] misc/arm-cla: Add userspace interface Ryan Roberts
2026-07-17 12:54 ` Arnd Bergmann
2026-07-17 14:35 ` Ryan Roberts
2026-07-17 15:31 ` Arnd Bergmann
2026-07-17 16:21 ` Ryan Roberts
2026-07-17 20:11 ` Arnd Bergmann [this message]
2026-07-17 11:33 ` [RFC PATCH v1 0/8] Arm Core Local Accelerator Driver Will Deacon
2026-07-17 12:09 ` Marc Zyngier
2026-07-17 12:33 ` Ryan Roberts
2026-07-17 12:30 ` Ryan Roberts
2026-07-17 13:32 ` Jason Gunthorpe
2026-07-17 13:42 ` Ryan Roberts
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=ec998612-c527-4294-837b-5aa375b81cc1@app.fastmail.com \
--to=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=jpb@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=ogabbay@kernel.org \
--cc=ryan.roberts@arm.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