|
Message-ID: <CAJgzZoo3b0oBnEv6N8VXFbWvOhR-0obKPq9Ja_G7s0D9a92E1Q@mail.gmail.com>
Date: Tue, 4 Apr 2023 17:14:04 -0700
From: enh <enh@...gle.com>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: __riscv_flush_icache() in <sys/cachectl.h>
On Tue, Apr 4, 2023 at 4:34 PM Rich Felker <dalias@...c.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
>
Content of type "text/html" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.