Re: [PATCH v2] riscv: Add sysctl to control discard of vstate during syscall
From: Florian Weimer
Date: Tue Aug 12 2025 - 04:04:17 EST
* Drew Fustini:
>> I'm confused. Current glibc assumes that vector registers are preserved
>> across system calls because the assembler clobbers do not mention them.
>> Similar inline assembly probably has ended up in other projects, too.
>> It works by accident if glibc is compiled for a non-vector target, or if
>> it so happens that GCC never keeps vector registers alive across system
>> calls.
>
> I wasn't trying to make any ABI changes with this sysctl patch. The
> riscv kernel documentation states vector state is not preserved across
> syscalls. I am not trying to change that policy.
Oh, then glibc is just buggy in this area. I had no idea. If the
vector state is already clobbered, than the sysctl for experimentation
is fine.
Thanks,
Florian