summaryrefslogtreecommitdiff
path: root/include/linux/rseq.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2026-03-06 20:46:32 +0300
committerTejun Heo <tj@kernel.org>2026-03-06 20:46:32 +0300
commit32e940f2bd3b16551f23ea44be47f6f5d1746d64 (patch)
tree23037a80fd683ff1a52ca05e2d7432c0cbc8f98b /include/linux/rseq.h
parent477174ac35c510d0ed3043f5bd4fba25546a21ce (diff)
parent1dde502587657045b267f179d7a1ecc7b8a1a265 (diff)
downloadlinux-32e940f2bd3b16551f23ea44be47f6f5d1746d64.tar.xz
Merge branch 'for-7.0-fixes' into for-7.1
To prepare for hierarchical scheduling patchset which will cause multiple conflicts otherwise. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/rseq.h')
-rw-r--r--include/linux/rseq.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/rseq.h b/include/linux/rseq.h
index 7a01a0760405..b9d62fc2140d 100644
--- a/include/linux/rseq.h
+++ b/include/linux/rseq.h
@@ -146,6 +146,18 @@ static inline void rseq_fork(struct task_struct *t, u64 clone_flags)
t->rseq = current->rseq;
}
+/*
+ * Value returned by getauxval(AT_RSEQ_ALIGN) and expected by rseq
+ * registration. This is the active rseq area size rounded up to next
+ * power of 2, which guarantees that the rseq structure will always be
+ * aligned on the nearest power of two large enough to contain it, even
+ * as it grows.
+ */
+static inline unsigned int rseq_alloc_align(void)
+{
+ return 1U << get_count_order(offsetof(struct rseq, end));
+}
+
#else /* CONFIG_RSEQ */
static inline void rseq_handle_slowpath(struct pt_regs *regs) { }
static inline void rseq_signal_deliver(struct ksignal *ksig, struct pt_regs *regs) { }