diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2025-12-15 17:52:06 +0100 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-01-22 11:11:16 +0100 |
| commit | f8380f976804533df4c6c3d3a0b2cd03c2d262bc (patch) | |
| tree | a575c2e92d8ee13ee36669b815113810110285f4 /kernel | |
| parent | d7a5da7a0f7fa7ff081140c4f6f971db98882703 (diff) | |
rseq: Provide static branch for time slice extensions
Guard the time slice extension functionality with a static key, which can
be disabled on the kernel command line.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251215155708.733429292@linutronix.de
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/rseq.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/rseq.c b/kernel/rseq.c index 07c324d5a201..bf75268580ef 100644 --- a/kernel/rseq.c +++ b/kernel/rseq.c @@ -483,3 +483,20 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len, int, flags, u32 efault: return -EFAULT; } + +#ifdef CONFIG_RSEQ_SLICE_EXTENSION +DEFINE_STATIC_KEY_TRUE(rseq_slice_extension_key); + +static int __init rseq_slice_cmdline(char *str) +{ + bool on; + + if (kstrtobool(str, &on)) + return 0; + + if (!on) + static_branch_disable(&rseq_slice_extension_key); + return 1; +} +__setup("rseq_slice_ext=", rseq_slice_cmdline); +#endif /* CONFIG_RSEQ_SLICE_EXTENSION */ |
