From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 4C9FD2F849 for ; Tue, 17 Sep 2024 20:51:22 +0200 (CEST) Received: (qmail 5964 invoked by uid 550); 17 Sep 2024 18:46:15 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 9776 invoked from network); 17 Sep 2024 18:08:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=liao-gg.20230601.gappssmtp.com; s=20230601; t=1726596495; x=1727201295; darn=lists.openwall.com; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=vr84D+4JRB3uhEkwfIidOnuxJW5P9pDzPVcnaQ7WIGE=; b=M6rkyUvNJrbTYdfV/khuAplv/9+nKMPqK75oRFjHz2IMKO0ZXu4i9/NdzsXc8IhNiQ TNUWmwM1sEQ2nUT73IooEce/Ah/Q9W78K8BXhkF6KcDIthcL7ZHpLGYZGn8fHYLX+ID5 q3QPqNuqwGaDgmyoUeZkk5RzMv3AEIQNvpoaMsP847n49LnKyjYHYluVgtm47D8gH4g6 DLf4I+KOwUVAtk5jLgvcmjViC8pV6YVeTwuAsd61CHDzLzWazqRtm9oDyfH17v4LiOZD yxHOuudiUoLY7FOpe6RD+DIfbmdUaFksDqX9k/kdyzlGwo75wo8INpH2q/fWeM/takAq HCTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726596495; x=1727201295; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vr84D+4JRB3uhEkwfIidOnuxJW5P9pDzPVcnaQ7WIGE=; b=DGTKIM0H7l7lo9hWpxUYDA29UDX4xS8aw1E6+QTDp387TKXasrzQ8ww1nPIU8YKCgs SxU+251Qk5aVIClvcJLu/q63XADGJVFTutALyQU5Iz7ebDL/TQMzS7uMSpkw1tMG6VeD kKvSSphD6R/RfZ1NpGltigN34HC1CEX0FfXY90YkASQXdVuX1yBRSskuLYiAks7StqJ7 f1rV+VmYfePtOlkT0eufYl1qbJOIksd65/VlcMUbMK9o6EOek1IWdUCxhCz99DS7MXyw NWL7FK3y5ca8RuuDabIWEdGfx0Ap56O4plqOiPS9fS2idz5jYH3ZW0R2gc9TTq8Uxp9P oYqg== X-Gm-Message-State: AOJu0YxazxVnXMZeQXE9G9zN8WPMnx2lEsWT07xgGx/6D7JY6YT1x+GX G8/0SovL1WI2JoJ+thuITMo/jflqu1p/m7x2rIIzIpxpFXUEGcinKhX6w+K0K4VoPLO2s/4tynY Q/XOph+jQSuV/cx4Vu2tBtfqF8KNMYDl3qpmmC6H377bxlIFWMIcrEVMWyro= X-Google-Smtp-Source: AGHT+IGP01xee59KtttPmxtiWBjlF4idzUeUlesh8mbylUK2my2z+Ph3OK4ddD7CHU4yVaWZk7VOxlsWAbBMRxBsAfI= X-Received: by 2002:a17:907:6d26:b0:a86:b38d:d703 with SMTP id a640c23a62f3a-a9029618120mr2123838766b.50.1726596494527; Tue, 17 Sep 2024 11:08:14 -0700 (PDT) MIME-Version: 1.0 From: Kevin Date: Wed, 18 Sep 2024 02:08:02 +0800 Message-ID: To: musl@lists.openwall.com Content-Type: multipart/alternative; boundary="000000000000ba2b6d06225492a5" Subject: [musl] [PATCH] Add clock_gettime VDSO support for Riscv64 --000000000000ba2b6d06225492a5 Content-Type: text/plain; charset="UTF-8" Hello, Currently, musl on Riscv64 does not implement VDSO for the clock_gettime function call. The following patch should fix it. (Rudimentary testing on a Riscv64 virtual machine confirms this works.) A similar patch could probably be made for Riscv32. This patch was made based on information from: https://man7.org/linux/man-pages/man7/vdso.7.html Please CC me on replies. --- arch/riscv64/syscall_arch.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/riscv64/syscall_arch.h b/arch/riscv64/syscall_arch.h index 7fd042cd..81993fc8 100644 --- a/arch/riscv64/syscall_arch.h +++ b/arch/riscv64/syscall_arch.h @@ -71,8 +71,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo } #define VDSO_USEFUL -/* We don't have a clock_gettime function. #define VDSO_CGT_SYM "__vdso_clock_gettime" -#define VDSO_CGT_VER "LINUX_2.6" */ +#define VDSO_CGT_VER "LINUX_4.15" #define IPC_64 0 -- 2.34.1 --000000000000ba2b6d06225492a5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

Currently, musl on Riscv64 does = not implement VDSO for the clock_gettime function call. The following patch= should fix it. (Rudimentary testing on a Riscv64 virtual machine confirms = this works.) A similar patch could probably be made for Riscv32. This patch= was made based on information from:=C2=A0https://man7.org/linux/man-pages/man7/vdso.7.h= tml

Please CC me on replies.

---
=C2= =A0arch/riscv64/syscall_arch.h | 3 +--
=C2=A01 file changed, 1 insertion= (+), 2 deletions(-)

diff --git a/arch/riscv64/syscall_arch.h b/arch/= riscv64/syscall_arch.h
index 7fd042cd..81993fc8 100644
--- a/arch/ris= cv64/syscall_arch.h
+++ b/arch/riscv64/syscall_arch.h
@@ -71,8 +71,7 = @@ static inline long __syscall6(long n, long a, long b, long c, long d, lo= ng e, lo
=C2=A0}
=C2=A0
=C2=A0#define VDSO_USEFUL
-/* We don= 9;t have a clock_gettime function.
=C2=A0#define VDSO_CGT_SYM "__vd= so_clock_gettime"
-#define VDSO_CGT_VER "LINUX_2.6" */+#define VDSO_CGT_VER "LINUX_4.15"
=C2=A0
=C2=A0#define IP= C_64 0
--
2.34.1

--000000000000ba2b6d06225492a5--