Re: [PATCH 0/2] riscv: Add support for vector misaligned load/store

From: David Laight

Date: Tue Nov 17 2026 - 08:12:36 EST


On Mon, 16 Nov 2026 23:38:36 -0800
Nylon Chen <nylon.chen@xxxxxxxxxx> wrote:

> This series adds emulation support for misaligned RISC-V vector
> load/store instructions, which may currently fault/trap without being
> handled on hardware that does not provide misaligned vector memory
> access support.
>
> Patch 1 implements the trap handler, with emulators for vector
> load/store covering unit-stride, strided, indexed (ordered and
> unordered), segment, whole-register, and fault-only-first forms, for
> both user and kernel mode traps.

I'd have thought that the cost of emulation would so high that you
really don't want to be doing it at all.
I guess you can't stop userspace (they'll just wonder why their optimised
vector functions perform so badly), but I cant see any reason for fixing
up faults in kernel space.

David

>
> Patch 2 adds a kselftest exercising these code paths across the
> various vector instruction forms and element widths.