include/linux/rseq_types.h

Source file repositories/reference/linux-study-clean/include/linux/rseq_types.h

File Facts

System
Linux kernel
Corpus path
include/linux/rseq_types.h
Extension
.h
Size
5657 bytes
Lines
206
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct rseq_event {
	union {
		u64				all;
		struct {
			union {
				u32		events;
				struct {
					u8	sched_switch;
					u8	ids_changed;
					u8	user_irq;
				};
			};

			u8			has_rseq;
			u8			__pad;
			union {
				u16		error;
				struct {
					u8	fatal;
					u8	slowpath;
				};
			};
		};
	};
};

/**
 * struct rseq_ids - Cache for ids, which need to be updated
 * @cpu_cid:	Compound of @cpu_id and @mm_cid to make the
 *		compiler emit a single compare on 64-bit
 * @cpu_id:	The CPU ID which was written last to user space
 * @mm_cid:	The MM CID which was written last to user space
 * @node_id:	The node ID which was written last to user space
 *
 * @cpu_id, @mm_cid and @node_id are updated when the data is written to user space.
 */
struct rseq_ids {
	union {
		u64		cpu_cid;
		struct {
			u32	cpu_id;
			u32	mm_cid;
		};
	};
	u32			node_id;
};

/**
 * union rseq_slice_state - Status information for rseq time slice extension
 * @state:	Compound to access the overall state
 * @enabled:	Time slice extension is enabled for the task
 * @granted:	Time slice extension was granted to the task
 */
union rseq_slice_state {
	u16			state;
	struct {
		u8		enabled;
		u8		granted;
	};
};

/**
 * struct rseq_slice - Status information for rseq time slice extension
 * @state:	Time slice extension state
 * @expires:	The time when a grant expires
 * @yielded:	Indicator for rseq_slice_yield()
 */
struct rseq_slice {
	union rseq_slice_state	state;
	u64			expires;
	u8			yielded;
};

/**
 * struct rseq_data - Storage for all rseq related data
 * @usrptr:	Pointer to the registered user space RSEQ memory
 * @len:	Length of the RSEQ region
 * @sig:	Signature of critical section abort IPs
 * @event:	Storage for event management
 * @ids:	Storage for cached CPU ID and MM CID
 * @slice:	Storage for time slice extension data
 */
struct rseq_data {
	struct rseq __user		*usrptr;
	u32				len;
	u32				sig;
	struct rseq_event		event;
	struct rseq_ids			ids;
#ifdef CONFIG_RSEQ_SLICE_EXTENSION
	struct rseq_slice		slice;

Annotation

Implementation Notes