include/linux/rseq_entry.h
Source file repositories/reference/linux-study-clean/include/linux/rseq_entry.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/rseq_entry.h- Extension
.h- Size
- 23954 bytes
- Lines
- 773
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/percpu.hlinux/hrtimer_rearm.hlinux/jump_label.hlinux/rseq.hlinux/sched/signal.hlinux/uaccess.hlinux/tracepoint-defs.h
Detected Declarations
struct rseq_statsfunction rseq_trace_updatefunction rseq_trace_ip_fixupfunction rseq_trace_updatefunction rseq_slice_extension_enabledfunction rseq_arm_slice_extension_timerfunction rseq_slice_clear_grantfunction __rseq_grant_slice_extensionfunction clear_tskfunction rseq_grant_slice_extensionfunction rseq_slice_extension_enabledfunction rseq_arm_slice_extension_timerfunction rseq_slice_clear_grantfunction rseq_note_user_irq_entryfunction pagefault_disablefunction scoped_user_rw_accessfunction rseq_update_user_csfunction scoped_user_rw_accessfunction pagefault_disablefunction scoped_user_rw_accessfunction rseq_update_usrfunction exit_to_user_mode_loopfunction rseq_sched_switch_eventfunction scoped_user_rw_accessfunction __rseq_exit_to_user_mode_restartfunction rseq_sched_switch_eventfunction test_tif_rseqfunction clear_tif_rseqfunction test_tif_rseqfunction clear_tif_rseqfunction rseq_exit_to_user_mode_restartfunction rseq_syscall_exit_to_user_modefunction rseq_irqentry_exit_to_user_modefunction rseq_debug_syscall_returnfunction rseq_note_user_irq_entryfunction rseq_syscall_exit_to_user_mode
Annotated Snippet
struct rseq_stats {
unsigned long exit;
unsigned long signal;
unsigned long slowpath;
unsigned long fastpath;
unsigned long ids;
unsigned long cs;
unsigned long clear;
unsigned long fixup;
unsigned long s_granted;
unsigned long s_expired;
unsigned long s_revoked;
unsigned long s_yielded;
unsigned long s_aborted;
};
DECLARE_PER_CPU(struct rseq_stats, rseq_stats);
/*
* Slow path has interrupts and preemption enabled, but the fast path
* runs with interrupts disabled so there is no point in having the
* preemption checks implied in __this_cpu_inc() for every operation.
*/
#ifdef RSEQ_BUILD_SLOW_PATH
#define rseq_stat_inc(which) this_cpu_inc((which))
#else
#define rseq_stat_inc(which) raw_cpu_inc((which))
#endif
#else /* CONFIG_RSEQ_STATS */
#define rseq_stat_inc(x) do { } while (0)
#endif /* !CONFIG_RSEQ_STATS */
#ifdef CONFIG_RSEQ
#include <linux/hrtimer_rearm.h>
#include <linux/jump_label.h>
#include <linux/rseq.h>
#include <linux/sched/signal.h>
#include <linux/uaccess.h>
#include <linux/tracepoint-defs.h>
#ifdef CONFIG_TRACEPOINTS
DECLARE_TRACEPOINT(rseq_update);
DECLARE_TRACEPOINT(rseq_ip_fixup);
void __rseq_trace_update(struct task_struct *t);
void __rseq_trace_ip_fixup(unsigned long ip, unsigned long start_ip,
unsigned long offset, unsigned long abort_ip);
static inline void rseq_trace_update(struct task_struct *t, struct rseq_ids *ids)
{
if (tracepoint_enabled(rseq_update) && ids)
__rseq_trace_update(t);
}
static inline void rseq_trace_ip_fixup(unsigned long ip, unsigned long start_ip,
unsigned long offset, unsigned long abort_ip)
{
if (tracepoint_enabled(rseq_ip_fixup))
__rseq_trace_ip_fixup(ip, start_ip, offset, abort_ip);
}
#else /* CONFIG_TRACEPOINT */
static inline void rseq_trace_update(struct task_struct *t, struct rseq_ids *ids) { }
static inline void rseq_trace_ip_fixup(unsigned long ip, unsigned long start_ip,
unsigned long offset, unsigned long abort_ip) { }
#endif /* !CONFIG_TRACEPOINT */
DECLARE_STATIC_KEY_MAYBE(CONFIG_RSEQ_DEBUG_DEFAULT_ENABLE, rseq_debug_enabled);
#ifdef RSEQ_BUILD_SLOW_PATH
#define rseq_inline
#else
#define rseq_inline __always_inline
#endif
#ifdef CONFIG_RSEQ_SLICE_EXTENSION
DECLARE_STATIC_KEY_TRUE(rseq_slice_extension_key);
static __always_inline bool rseq_slice_extension_enabled(void)
{
return static_branch_likely(&rseq_slice_extension_key);
}
extern unsigned int rseq_slice_ext_nsecs;
bool __rseq_arm_slice_extension_timer(void);
static __always_inline bool rseq_arm_slice_extension_timer(void)
{
if (!rseq_slice_extension_enabled())
Annotation
- Immediate include surface: `linux/percpu.h`, `linux/hrtimer_rearm.h`, `linux/jump_label.h`, `linux/rseq.h`, `linux/sched/signal.h`, `linux/uaccess.h`, `linux/tracepoint-defs.h`.
- Detected declarations: `struct rseq_stats`, `function rseq_trace_update`, `function rseq_trace_ip_fixup`, `function rseq_trace_update`, `function rseq_slice_extension_enabled`, `function rseq_arm_slice_extension_timer`, `function rseq_slice_clear_grant`, `function __rseq_grant_slice_extension`, `function clear_tsk`, `function rseq_grant_slice_extension`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.