summaryrefslogtreecommitdiff
path: root/include/linux/rseq.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2026-04-01 15:42:56 +0300
committerTakashi Iwai <tiwai@suse.de>2026-04-01 15:43:00 +0300
commit0542972950ef26670a5696e43c0ea2b7b6ac96d4 (patch)
tree9a38714da776c84a22efcdd8d82905bd7a9903a6 /include/linux/rseq.h
parent579e7b820de5dd5124585413bb5e9c278d255436 (diff)
parenta0dafdbd1049a8ea661a1a471be1b840bd8aed13 (diff)
downloadlinux-0542972950ef26670a5696e43c0ea2b7b6ac96d4.tar.xz
Merge branch 'for-linus' into for-next
Pull 7.0 devel branch for further cleanups of ctxfi driver & co. Signed-off-by: Takashi Iwai <tiwai@suse.de>
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) { }