Summary: | Handle new Linux kernel feature: Restartable Sequences ("rseq") | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Derek Bruening <derek.bruening> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | hgreving, mark, msc |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | implement rseq as ENOSYS |
Description
Derek Bruening
2019-03-12 00:37:57 UTC
Details on DynamoRIO's "run twice" solution and implementation for the rseq feature which is now generally available in recent kernels are at https://github.com/DynamoRIO/dynamorio/wiki/Restartable-Sequences glibc will start using rseq: https://sourceware.org/pipermail/libc-alpha/2021-December/133656.html If they get an ENOSYS they will simply not use it. So I propose that for now we "implement" rseq by just returning ENOSYS and not produce an warning for now. Created attachment 144436 [details]
implement rseq as ENOSYS
Updated link for the stale wiki page from the first comment above detailing the run-twice solution DynamoRIO has been using successfully for years now: https://dynamorio.org/page_rseq.html For now I pushed the ENOSYS patch to make sure things just work with the new glibc. commit 1024237358f01009fe233cb1294f3b8211304eaa Author: Mark Wielaard <mark@klomp.org> Date: Fri Dec 10 17:41:59 2021 +0100 Implement linux rseq syscall as ENOSYS This implements rseq for amd64, arm, arm64, ppc32, ppc64, s390x and x86 linux as ENOSYS (without warning). glibc will start using rseq to accelerate sched_getcpu, if available. This would cause a warning from valgrind every time a new thread is started. Real rseq (restartable sequences) support is pretty hard, so for now just explicitly return ENOSYS (just like we do for clone3). https://sourceware.org/pipermail/libc-alpha/2021-December/133656.html Leaving this bug open for a real implementation. *** Bug 449199 has been marked as a duplicate of this bug. *** |