mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] __riscv_flush_icache() in <sys/cachectl.h>
@ 2023-04-04 22:49 enh
  2023-04-04 23:34 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: enh @ 2023-04-04 22:49 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [musl] __riscv_flush_icache() in <sys/cachectl.h>
  2023-04-04 22:49 [musl] __riscv_flush_icache() in <sys/cachectl.h> enh
@ 2023-04-04 23:34 ` Rich Felker
  2023-04-05  0:14   ` enh
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2023-04-04 23:34 UTC (permalink / raw)
  To: enh; +Cc: musl

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> ...

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 ..?

Rich

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [musl] __riscv_flush_icache() in <sys/cachectl.h>
  2023-04-04 23:34 ` Rich Felker
@ 2023-04-05  0:14   ` enh
  0 siblings, 0 replies; 3+ messages in thread
From: enh @ 2023-04-05  0:14 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-05  0:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-04 22:49 [musl] __riscv_flush_icache() in <sys/cachectl.h> enh
2023-04-04 23:34 ` Rich Felker
2023-04-05  0:14   ` enh

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).