public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi@remlab.net>
To: linux-riscv@lists.infradead.org
Cc: Palmer Dabbelt <palmer@rivosinc.com>
Subject: Re: [PATCH] RISC-V: Clobber V registers on syscalls
Date: Thu, 15 Jun 2023 20:36:31 +0300	[thread overview]
Message-ID: <2357195.3bzvq7fpCv@basile.remlab.net> (raw)
In-Reply-To: <20230614163534.18668-1-palmer@rivosinc.com>

Le keskiviikkona 14. kesäkuuta 2023, 19.35.34 EEST Palmer Dabbelt a écrit :
> The V registers are clobbered by standard ABI functions, so userspace
> probably doesn't have anything useful in them by the time we get to the
> kernel.

Indeed, for your typical system call, wrapped by two or more layers of 
function calls inside libc, userspace will treat the registers as clobbered 
anyhow.

But AFAIU, other architectures don't gratuitiously clobber SIMD or vector 
registers, even those that are callee-clobbered by their respective function 
calling convention, or do they? FWIW, Arm is going the opposite direction with 
their higher privilege calls (newer versions of SMCCC define how to preserve 
SVE vectors).

The kernel cannot simply clobber registers, as that would likely cause data 
leakage from kernel to user mode. So it is unclear what the benefits would be 
here. And I fear that there will be less conventional use cases whence it 
makes sense to preserve registers on system calls.

For example an inline or compiler intrinsic implementation of C++20/C2X 
atomic-wait/atomic-notify, which would presumably invoke the futex() syscall 
on Linux, maybe??

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/




_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2023-06-15 17:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 16:35 [PATCH] RISC-V: Clobber V registers on syscalls Palmer Dabbelt
2023-06-15 17:36 ` Rémi Denis-Courmont [this message]
2023-06-15 20:33   ` Palmer Dabbelt
2023-06-16 19:58     ` Rémi Denis-Courmont
2023-06-16 19:47   ` Björn Töpel
2023-06-16 20:12 ` Björn Töpel
2023-06-19 18:18   ` Palmer Dabbelt
2023-06-19 19:01     ` Björn Töpel
2023-06-19 19:05       ` Palmer Dabbelt
2023-06-21 14:26         ` Björn Töpel
2023-06-21 14:44           ` Darius Rad
2023-06-21 18:16             ` Palmer Dabbelt
2023-06-21 14:50           ` Andy Chiu
2023-06-21 21:40             ` Björn Töpel
2023-06-22 15:47               ` Andy Chiu
2023-06-22 16:38                 ` Björn Töpel
2023-06-24  6:54                   ` Andy Chiu
2023-06-26 15:36                     ` Björn Töpel
2023-06-27  1:07                       ` Andy Chiu
2023-06-27  6:33                         ` Björn Töpel
2023-06-24  8:41                   ` Andy Chiu
2023-06-26 14:54                     ` Björn Töpel
2023-06-21 16:47           ` Rémi Denis-Courmont
2023-06-21 18:16             ` Palmer Dabbelt
2023-06-21 21:42               ` Björn Töpel
2025-06-16 22:30         ` Drew Fustini
2025-06-16 22:48           ` Drew Fustini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2357195.3bzvq7fpCv@basile.remlab.net \
    --to=remi@remlab.net \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@rivosinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox