From: Vineet Gupta <vineetg@rivosinc.com>
To: Palmer Dabbelt <palmer@rivosinc.com>,
Andrew Waterman <andrew@sifive.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] RISC-V: Clobber V state on system calls
Date: Wed, 27 Mar 2024 15:16:36 -0700 [thread overview]
Message-ID: <50c6ed10-faa0-42c1-93b5-c1b18a62a298@rivosinc.com> (raw)
In-Reply-To: <mhng-bc102b0d-db47-45ca-bb76-c167a3b01d01@palmer-ri-x1c9>
On 3/27/24 14:53, Palmer Dabbelt wrote:
> On Wed, 27 Mar 2024 14:48:45 PDT (-0700), Andrew Waterman wrote:
>> LGTM. I suspect this hasn't manifested as a bug because a glibc
>> routine with an inline syscall would need to be vectorized for this to
>> be a potential problem. But the prophylaxis is a good idea.
> IIUC we've also got another quirk where GCC discards all V register
> state on inline ASM blocks
If so, is this patch needed ? No, it doesn't unless V regs are in
clobber list.
> (but I think doesn't discard the V CSR
> state), so it'd be pretty unlikely we actually vectorize anything with
> the syscall macros. Getting a reproducer for those is next on the TODO
> list 😉
If one specifies vtype as clobber, it is refreshed with a vsetvl.
gcc seems to be doing the right thing ATM. I've posted a test which
confirms the same [1]
-Vineet
[1] https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648499.html
prev parent reply other threads:[~2024-03-27 22:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 19:36 Palmer Dabbelt
2024-03-27 21:48 ` Andrew Waterman
2024-03-27 21:53 ` Palmer Dabbelt
2024-03-27 22:16 ` Vineet Gupta [this message]
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=50c6ed10-faa0-42c1-93b5-c1b18a62a298@rivosinc.com \
--to=vineetg@rivosinc.com \
--cc=andrew@sifive.com \
--cc=libc-alpha@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).