mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Ignotas \"gns\" WANG" <infiwang@proton.me>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: [musl] [PATCH] riscv: correct symbol version of __vdso_flush_icache
Date: Thu, 25 Jan 2024 16:55:16 +0000	[thread overview]
Message-ID: <Sd9ap3oE3qCZk9GSPRqKV4h8rHs22bqlchDjXicXmvHPr_pc0vOfPXBp_lxtpoe8p1XdCioL-ejpTq-soOAGHzG-U-Vrep8lrro7vqUWECo=@proton.me> (raw)

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


             reply	other threads:[~2024-01-25 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 16:55 Ignotas "gns" WANG [this message]
2024-01-25 19:05 ` Rich Felker
2024-01-25 19:10   ` Rich Felker

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='Sd9ap3oE3qCZk9GSPRqKV4h8rHs22bqlchDjXicXmvHPr_pc0vOfPXBp_lxtpoe8p1XdCioL-ejpTq-soOAGHzG-U-Vrep8lrro7vqUWECo=@proton.me' \
    --to=infiwang@proton.me \
    --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).