lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lhuo6so7ur5.fsf@oldenburg.str.redhat.com>
Date: Sat, 09 Aug 2025 10:40:46 +0200
From: Florian Weimer <fweimer@...hat.com>
To: Drew Fustini <fustini@...nel.org>
Cc: Paul Walmsley <paul.walmsley@...ive.com>,  Palmer Dabbelt
 <palmer@...belt.com>,  Alexandre Ghiti <alex@...ti.fr>,  Samuel Holland
 <samuel.holland@...ive.com>,  Björn Töpel
 <bjorn@...osinc.com>,  Andy Chiu
 <andybnac@...il.com>,  Conor Dooley <conor.dooley@...rochip.com>,
  linux-riscv@...ts.infradead.org,  linux-kernel@...r.kernel.org,  Drew
 Fustini <dfustini@...storrent.com>
Subject: Re: [PATCH v2] riscv: Add sysctl to control discard of vstate
 during syscall

* Drew Fustini:

> From: Drew Fustini <dfustini@...storrent.com>
>
> Clobbering the vector registers can significantly increase system call
> latency for some implementations. To mitigate this performance impact, a
> sysctl knob is provided that controls whether the vector state is
> discarded in the syscall path:
>
> /proc/sys/abi/riscv_v_vstate_discard
>
> Valid values are:
>
> 0: Vector state is not always clobbered in all syscalls
> 1: Mandatory clobbering of vector state in all syscalls
>
> The initial state is controlled by CONFIG_RISCV_ISA_V_VSTATE_DISCARD.

Can this be put into the system call number instead, or make it specific
to some system calls in other ways?

I think C libraries can use this optimization for their system calls
(after adjusting the assembler clobbers) because the vector state is
caller-saved in the standard calling convention.  But there is backwards
compatibility impact for turning this on for the entire process.

Thanks,
Florian


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ