I just ran truss on a Qt application and saw tons of clock_gettime syscalls. Looking at it in GDB shows that __vdso_clock_gettime returns ENOSYS. It appears that riscv_timer_timecount does not have a tc_fill_vdso_timehands function, so the tc_fill_vdso_timehands() function will always return 0.
Patch: https://reviews.freebsd.org/D30963
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=348c41d1815dc2e872a1deba1f4bf760caaa1094 commit 348c41d1815dc2e872a1deba1f4bf760caaa1094 Author: Jessica Clarke <jrtc27@FreeBSD.org> AuthorDate: 2021-07-05 15:16:53 +0000 Commit: Jessica Clarke <jrtc27@FreeBSD.org> CommitDate: 2021-07-05 15:16:53 +0000 riscv: Implement non-stub __vdso_gettc and __vdso_gettimekeep PR: 256905 Reviewed by: arichardson, mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30963 lib/libc/riscv/sys/Makefile.inc | 2 +- lib/libc/riscv/sys/__vdso_gettc.c (new) | 56 +++++++++++++++++++++++++++++++++ sys/riscv/include/vdso.h | 2 ++ sys/riscv/riscv/elf_machdep.c | 4 +-- sys/riscv/riscv/timer.c | 14 +++++++++ 5 files changed, 75 insertions(+), 3 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c69a739379bea9de88869f7abc3db58f1a16363c commit c69a739379bea9de88869f7abc3db58f1a16363c Author: Jessica Clarke <jrtc27@FreeBSD.org> AuthorDate: 2021-07-05 15:16:53 +0000 Commit: Jessica Clarke <jrtc27@FreeBSD.org> CommitDate: 2021-09-07 12:06:44 +0000 riscv: Implement non-stub __vdso_gettc and __vdso_gettimekeep PR: 256905 Reviewed by: arichardson, mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30963 (cherry picked from commit 348c41d1815dc2e872a1deba1f4bf760caaa1094) lib/libc/riscv/sys/Makefile.inc | 2 +- lib/libc/riscv/sys/__vdso_gettc.c (new) | 56 +++++++++++++++++++++++++++++++++ sys/riscv/include/vdso.h | 2 ++ sys/riscv/riscv/elf_machdep.c | 4 +-- sys/riscv/riscv/timer.c | 14 +++++++++ 5 files changed, 75 insertions(+), 3 deletions(-)