From: enh <enh@google.com>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] __riscv_flush_icache() in <sys/cachectl.h>
Date: Tue, 4 Apr 2023 17:14:04 -0700 [thread overview]
Message-ID: <CAJgzZoo3b0oBnEv6N8VXFbWvOhR-0obKPq9Ja_G7s0D9a92E1Q@mail.gmail.com> (raw)
In-Reply-To: <20230404233434.GF4163@brightrain.aerifal.cx>
[-- Attachment #1: Type: text/plain, Size: 1687 bytes --]
On Tue, Apr 4, 2023 at 4:34 PM Rich Felker <dalias@libc.org> wrote:
> On Tue, Apr 04, 2023 at 03:49:05PM -0700, enh wrote:
> > i'm still trying to decide whether it makes sense to
> > add __riscv_flush_icache() to bionic or not[1] and was looking to see
> > whether musl had added it. i notice you've _implemented_ it but not added
> > it to the <sys/cacheflush.h> header. was that deliberate or just an
> > oversight?
> >
> > _____
> > 1. see https://github.com/google/android-riscv64/issues/4 for my
> ramblings
> > on that topic.
>
> It's rather annoying that they added a new arch-specific header for
> this rather than using the existing <sys/cachectl.h> ...
>
i don't think this is a new thing --- i think they've always had
<sys/cachectl.h> only on systems like mips that actually need it, and it's
different between those systems. (my x86-64 glibc box has no
<sys/cachectl.h>, for example.)
> We probably need to do something to clean this up but I'm not sure
> what the right action is. I figured it was usable with no header, but
> apparently it needs some flags ..?
>
https://www.gnu.org/software/libc/manual/html_node/RISC_002dV.html refers
to a single flag ... but i don't think they actually _define_ that flag?
ah, it's in the kernel:
```
~/linux$ grep -r SYS_RISCV_FLUSH_ICACHE_LOCAL
arch/riscv/include/asm/cacheflush.h:#define SYS_RISCV_FLUSH_ICACHE_LOCAL 1UL
arch/riscv/include/asm/cacheflush.h:#define SYS_RISCV_FLUSH_ICACHE_ALL
(SYS_RISCV_FLUSH_ICACHE_LOCAL)
arch/riscv/kernel/sys_riscv.c: flush_icache_mm(current->mm, flags &
SYS_RISCV_FLUSH_ICACHE_LOCAL);
~/linux$
```
but not in a uapi header :-/
> Rich
>
[-- Attachment #2: Type: text/html, Size: 2686 bytes --]
prev parent reply other threads:[~2023-04-05 0:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 22:49 enh
2023-04-04 23:34 ` Rich Felker
2023-04-05 0:14 ` enh [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=CAJgzZoo3b0oBnEv6N8VXFbWvOhR-0obKPq9Ja_G7s0D9a92E1Q@mail.gmail.com \
--to=enh@google.com \
--cc=dalias@libc.org \
--cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).