[PATCH] riscv: vector: Fix data pointer constraints in context save/restore

Paul Walmsley pjw at kernel.org
Fri Sep 18 17:48:19 PDT 2026


On Tue, 8 Sep 2026, Troy Mitchell wrote:

> The standard vector save/restore asm advances datap but declares it as
> input-only. An inlined caller reusing the original pointer may therefore
> use the advanced address instead.
> 
> Declare datap as read-write so the compiler can preserve the original
> pointer when needed.
> 
> Fixes: 03c3fcd9941a ("riscv: Introduce struct/helpers to save/restore per-task Vector state")
> Signed-off-by: Troy Mitchell <troy.mitchell at linux.dev>

Thanks, queued for v7.3-rc.


- Paul



More information about the linux-riscv mailing list