RFC rseq: add support for RSEQ operations
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest5 patches 13 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | rseq: uapi: add rseq operation definitionsinclude/ include/ | +108 | 6 replies | |
| 2/5 | rseq: add per-task rseq operation stateinclude/ include/ | +18 | 1 reply | |
| 3/5 | rseq: apply operations on exit to user spaceinclude/ | +152 | 1 reply | |
| 4/5 | rseq: register and unregister operations via prctlkernel/ kernel/ | +212 | 1 reply | |
| 5/5 | selftests/rseq: add coverage for rseq operationstools/ tools/ tools/ +2 more | +223 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/5] rseq: add support for RSEQ operations
From: Olivier Dion <[email protected]>
Hi,
This series introduces RSEQ operations: a per-thread list of operations the kernel applies, on behalf of a ask, when returning to user space.
The main motivation is to help TCMalloc migrate from RSEQ v1 to RSEQ v2 and use the RSEQ area registered by glibc. TCMalloc currently relies on RSEQ v1 resetting the cpu_id field to invalidate a per-CPU pointer cached in TLS. This requires applications to disable glibc's implicit RSEQ registration and prevents sharing the glibc RSEQ area.
RSEQ operations provide an opt-in replacement for that invalidation mechanism. User space registers operation nodes with prctl; the kernel keeps the nodes in a per-thread circular list and applies them on return to user space. Only tasks with registered operations incur the additional RSEQ exit-path work.
The first patch adds the UAPI. The next three patches add the task state, operation execution, and prctl registration support. The final patch adds selftests covering normal operation and malformed-list and invalid-memory cases.
See also <https://lore.kernel.org/lkml/[email protected]>.
Thanks,
old
Olivier Dion (5):
rseq: uapi: add rseq operation definitions
rseq: add per-task rseq operation state
rseq: apply operations on exit to user space
rseq: register and unregister operations via prctl selftests/rseq: add coverage for rseq operations
include/linux/rseq.h | 10 +- include/linux/rseq_entry.h | 157 ++++++++++++++++- include/linux/rseq_types.h | 9 + include/uapi/linux/prctl.h | 12 ++ include/uapi/linux/rseq.h | 104 ++++++++++- kernel/rseq.c | 220 ++++++++++++++++++++++-- kernel/sys.c | 5 + tools/testing/selftests/rseq/.gitignore | 4 +- tools/testing/selftests/rseq/Makefile | 4 +- tools/testing/selftests/rseq/rseq-abi.h | 146 +++++++++++++--- tools/testing/selftests/rseq/rseq.c | 23 ++- tools/testing/selftests/rseq/rseq.h | 75 ++++++++ 12 files changed, 713 insertions(+), 56 deletions(-)
Signature · 1 line
2.54.0