Re: [PATCH v2] riscv: Add sysctl to control discard of vstate during syscall

From: Drew Fustini
Date: Tue Aug 12 2025 - 01:55:51 EST


On Sun, Aug 10, 2025 at 05:52:54PM +0800, Vivian Wang wrote:
> > Discarding vector state on syscall entry can help identify userpace
> > programs that are mistakenly relying on vector state being preserved
> > across syscalls. This can be useful for debugging and test suites.
> > However, this behavior can negatively impact performance on some
> > RISC-V implementations.
> >
> > Say Y here if you want mandatory clobbering of vector state before
> > entering all syscalls. If you select N, then userspace can still
> > eanble it via the abi.riscv_v_vstate_discard sysctl knob.
>
> Typo: eanble -> enable
>
> Also, I think it kinda makes the false impression that the sysctl knob
> is only available with this set to N? I think this should be structured
> to say something like this being the default value, and also say that
> userspace can override this behavior system-wide via the sysctl knob.

Thanks, that is a good point that I should clarify that the user can
still override via the sysctl knob regardless of whether choosing Y or N
for this Kconfig option.

-Drew