mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH] riscv: correct symbol version of __vdso_flush_icache
@ 2024-01-25 16:55 Ignotas "gns" WANG
  2024-01-25 19:05 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Ignotas "gns" WANG @ 2024-01-25 16:55 UTC (permalink / raw)
  To: musl

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

Hi,

I'm porting LuaJIT to RISC-V, our binary built with musl would occasionally SIGILL at patched JIT insns. It looks that musl's __riscv_flush_icache is faulty, which may be the cause of this cache coherency issue.

For the patch, see the attachments.

Since I'm not a subscriber to the musl list, CC me please.

[-- Attachment #2: 0001-riscv-correct-symbol-version-of-__vdso_flush_icache.patch --]
[-- Type: application/octet-stream, Size: 901 bytes --]

From e427fd578a8de3220e72ab31b9eb18b412195a93 Mon Sep 17 00:00:00 2001
From: gns <infiwang@proton.me>
Date: Thu, 25 Jan 2024 23:59:52 +0800
Subject: [PATCH] riscv: correct symbol version of __vdso_flush_icache

Previously, __riscv_flush_icache would not work correctly as __vdso_flush_icache
had a wrong symbol version. Fix this by correcting symbol version.

Fixes: 0a48860c27a8 ("add riscv64 architecture support")
---
 src/linux/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/linux/cache.c b/src/linux/cache.c
index 0eb051c2..45024309 100644
--- a/src/linux/cache.c
+++ b/src/linux/cache.c
@@ -21,7 +21,7 @@ weak_alias(__cachectl, cachectl);
 #ifdef SYS_riscv_flush_icache
 
 #define VDSO_FLUSH_ICACHE_SYM "__vdso_flush_icache"
-#define VDSO_FLUSH_ICACHE_VER "LINUX_4.5"
+#define VDSO_FLUSH_ICACHE_VER "LINUX_4.15"
 
 static void *volatile vdso_func;
 
-- 
2.39.2


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

end of thread, other threads:[~2024-01-25 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 16:55 [musl] [PATCH] riscv: correct symbol version of __vdso_flush_icache Ignotas "gns" WANG
2024-01-25 19:05 ` Rich Felker
2024-01-25 19:10   ` Rich Felker

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