Re: [RFC PATCH v2 06/15] misc/arm-cla: Accelerator context save and restore
From: Linus Walleij
Date: Sat Nov 21 2026 - 19:28:23 EST
Hi Ryan, Jean-Philippe,
thanks for your patch!
On Thu, Oct 15, 2026 at 4:27 PM Ryan Roberts <ryan.roberts@xxxxxxx> wrote:
> From: Jean-Philippe Brucker <jpb@xxxxxxxxxx>
>
> Add helpers to save and restore CLA context for later domain switching.
> The saved state includes DATA registers, LRESP, per-accelerator SRSTATE
> and any implementation-defined internal accelerator state exposed
> through the IAS register window.
>
> Use ENTERSR to stop each accelerator and collect SRSTATE, then read the
> advertised internal register state with REGREAD. Restore by entering SR
> mode from a reset, idle accelerator, writing the saved internal state
> with REGWRITE and completing the transition with EXITSR.
>
> Reject accelerators that require SAVE/RESTORE operations during setup,
> since that path needs a DMA buffer for state storage. Allocate
> per-device save areas for all CLAs in a domain, sized from the combined
> IASSIZE discovered at setup time.
>
> Signed-off-by: Jean-Philippe Brucker <jpb@xxxxxxxxxx>
This just describes mechanism and not use.
I see what the code is doing but not how it is used.
E.g. part of me think: if it is technically a part of the CPU,
why is the context not stored in pt_regs?
So I assume the context change at other points than when
the process on the current CPU is preempted or scheduled
in.
This context (ha!) is needed here so we can understand
the *purpose* of this context switch.
Maybe the use of contexts and context switching need to
be in the cover letter?
Yours,
Linus Walleij