All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi@remlab.net>
To: linux-riscv@lists.infradead.org
Subject: Re: [PATCH v2] riscv: Discard vector state on syscalls
Date: Tue, 27 Jun 2023 18:06:33 +0300	[thread overview]
Message-ID: <5684355.DvuYhMxLoT@basile.remlab.net> (raw)
In-Reply-To: <87y1k6m827.fsf@all.your.base.are.belong.to.us>

[Resend with different MTA]

Le 26 juin 2023 19:45:20 GMT+02:00, "Björn Töpel" <bjorn@kernel.org> a écrit :
>Björn Töpel <bjorn@kernel.org> writes:
>
>> From: Björn Töpel <bjorn@rivosinc.com>
>>
>> The RISC-V vector specification states:
>>   Executing a system call causes all caller-saved vector registers
>>   (v0-v31, vl, vtype) and vstart to become unspecified.
>
>A bit of a corner case, but this will make sigreturn syscalls discard
>the vector state as well.
>
>Is that an issue? E.g. a user cannot build userspace context switching
>application. Does arm64 SVE handle sigreturn in a special way?

Isn't sigreturn() supposed to return the status from the arch-dependent 
machine state within the siginfo structure, rather than whatever was saved on 
sigreturn() syscall entry? That being the case, I think throwing the vector 
register bank away on *entry* of sigreturn() is fine as with any other syscall, 
but the state must *not* be cleared on syscall exit.

An example usecase would be emulating RVV extensions (on a CPU supporting 
baseline RVV 1.0) with a SIGILL handler.

-- 
Rémi



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

  parent reply	other threads:[~2023-06-27 15:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 16:57 [PATCH v2] riscv: Discard vector state on syscalls Björn Töpel
2023-06-26 16:57 ` Björn Töpel
2023-06-26 17:45 ` Björn Töpel
2023-06-26 17:45   ` Björn Töpel
2023-06-26 18:04   ` Björn Töpel
2023-06-26 18:04     ` Björn Töpel
2023-06-27 15:06   ` Rémi Denis-Courmont [this message]
2023-06-27 15:15 ` Andy Chiu
2023-06-27 15:15   ` Andy Chiu
2023-06-28 10:35   ` Björn Töpel
2023-06-28 10:35     ` Björn Töpel
2023-06-28 17:03     ` Andy Chiu
2023-06-28 17:03       ` Andy Chiu
2023-06-29  5:52       ` Björn Töpel
2023-06-29  5:52         ` Björn Töpel

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=5684355.DvuYhMxLoT@basile.remlab.net \
    --to=remi@remlab.net \
    --cc=linux-riscv@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.