[lkml]   [2022]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: RISCV Vector unit disabled by default for new task (was Re: [PATCH v12 17/17] riscv: prctl to enable vector commands)
On 12/15/22 10:57, Vineet Gupta wrote:
>> The other thing of note for SVE is that, with the default function ABI all of the SVE
>> state is call-clobbered, which allows the kernel to drop instead of save state across
>> system calls.  (There is a separate vector function call ABI when SVE types are used.)
> For the RV psABI, it is similar - all V regs are caller-saved/call-clobbered [1] and
> syscalls are not required to preserve V regs [2]
> However last I checked ARM documentation the ABI doc seemed to suggest that some (parts)
> of the SVE regs are callee-saved [3]

As Pinski mentioned, just some low bits that overlap with scalar fp state; the high bits
and the predicate registers gets zeroed when re-enabling.

>> So while strcpy may enable SVE for the thread, the next syscall may disable it again.
> Next syscall could trash them, but will it disable SVE ?

Yes. See fp_user_discard() in arch/arm64/kernel/syscall.c.


 \ /
  Last update: 2022-12-15 20:57    [W:0.112 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site