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: <DBHTIDY0HRM0.2B8L1WG7IBCXM@ventanamicro.com>
Date: Mon, 21 Jul 2025 16:54:25 +0200
From: Radim Krčmář <rkrcmar@...tanamicro.com>
To: "Drew Fustini" <fustini@...nel.org>, "Palmer Dabbelt"
 <palmer@...belt.com>, Björn Töpel
 <bjorn@...osinc.com>, "Alexandre Ghiti" <alex@...ti.fr>, "Paul Walmsley"
 <paul.walmsley@...ive.com>, "Samuel Holland" <samuel.holland@...ive.com>,
 "Drew Fustini" <dfustini@...storrent.com>, "Andy Chiu"
 <andybnac@...il.com>, "Conor Dooley" <conor.dooley@...rochip.com>,
 <linux-riscv@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
Cc: "linux-riscv" <linux-riscv-bounces@...ts.infradead.org>
Subject: Re: [PATCH] riscv: Add sysctl to control discard of vstate during
 syscall

2025-07-21T14:35:38+02:00, Radim Krčmář <rkrcmar@...tanamicro.com>:
> Shouldn't the RISC-V Linux syscall ABI be defined somewhere?

To clarify this point.  My issue is with the following part in
Documentation/arch/riscv/vector.rst:

>>  As indicated by version 1.0 of the V extension [1], vector registers are
>>  clobbered by system calls.
>>  [...]
>>  1: https://github.com/riscv/riscv-v-spec/blob/master/calling-convention.adoc

The ISA does not say that vector registers are clobbered by system
calls.  All the ISA says is:

  "This Appendix is only a placeholder to help explain the conventions
   used in the code examples, and is not considered frozen or
   part of the ratification process.  The official RISC-V psABI document
   is being expanded to specify the vector calling conventions."

while the RISC-V psABI says:

  "The calling convention for system calls does not fall within the
   scope of this document. Please refer to the documentation of the
   RISC-V execution environment interface (e.g OS kernel ABI, SBI)."

We made a circular dependency, misinterpreted the ISA, and probably
implemented a suboptimal syscall ABI -- preserving vector registers
seems strictly better.

> How come we could have broken it with 9657e9b7d253?

We changed the ABI once, so maybe we can change it back?

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ