~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/rseq.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/rseq.h (Architecture ppc) and /include/linux/rseq.h (Architecture alpha)


  1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linu      1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2 #ifndef _LINUX_RSEQ_H                               2 #ifndef _LINUX_RSEQ_H
  3 #define _LINUX_RSEQ_H                               3 #define _LINUX_RSEQ_H
  4                                                     4 
  5 #ifdef CONFIG_RSEQ                                  5 #ifdef CONFIG_RSEQ
  6                                                     6 
  7 #include <linux/preempt.h>                          7 #include <linux/preempt.h>
  8 #include <linux/sched.h>                            8 #include <linux/sched.h>
  9                                                     9 
 10 /*                                                 10 /*
 11  * Map the event mask on the user-space ABI en     11  * Map the event mask on the user-space ABI enum rseq_cs_flags
 12  * for direct mask checks.                         12  * for direct mask checks.
 13  */                                                13  */
 14 enum rseq_event_mask_bits {                        14 enum rseq_event_mask_bits {
 15         RSEQ_EVENT_PREEMPT_BIT  = RSEQ_CS_FLAG     15         RSEQ_EVENT_PREEMPT_BIT  = RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT,
 16         RSEQ_EVENT_SIGNAL_BIT   = RSEQ_CS_FLAG     16         RSEQ_EVENT_SIGNAL_BIT   = RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT,
 17         RSEQ_EVENT_MIGRATE_BIT  = RSEQ_CS_FLAG     17         RSEQ_EVENT_MIGRATE_BIT  = RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT,
 18 };                                                 18 };
 19                                                    19 
 20 enum rseq_event_mask {                             20 enum rseq_event_mask {
 21         RSEQ_EVENT_PREEMPT      = (1U << RSEQ_     21         RSEQ_EVENT_PREEMPT      = (1U << RSEQ_EVENT_PREEMPT_BIT),
 22         RSEQ_EVENT_SIGNAL       = (1U << RSEQ_     22         RSEQ_EVENT_SIGNAL       = (1U << RSEQ_EVENT_SIGNAL_BIT),
 23         RSEQ_EVENT_MIGRATE      = (1U << RSEQ_     23         RSEQ_EVENT_MIGRATE      = (1U << RSEQ_EVENT_MIGRATE_BIT),
 24 };                                                 24 };
 25                                                    25 
 26 static inline void rseq_set_notify_resume(stru     26 static inline void rseq_set_notify_resume(struct task_struct *t)
 27 {                                                  27 {
 28         if (t->rseq)                               28         if (t->rseq)
 29                 set_tsk_thread_flag(t, TIF_NOT     29                 set_tsk_thread_flag(t, TIF_NOTIFY_RESUME);
 30 }                                                  30 }
 31                                                    31 
 32 void __rseq_handle_notify_resume(struct ksigna     32 void __rseq_handle_notify_resume(struct ksignal *sig, struct pt_regs *regs);
 33                                                    33 
 34 static inline void rseq_handle_notify_resume(s     34 static inline void rseq_handle_notify_resume(struct ksignal *ksig,
 35                                              s     35                                              struct pt_regs *regs)
 36 {                                                  36 {
 37         if (current->rseq)                         37         if (current->rseq)
 38                 __rseq_handle_notify_resume(ks     38                 __rseq_handle_notify_resume(ksig, regs);
 39 }                                                  39 }
 40                                                    40 
 41 static inline void rseq_signal_deliver(struct      41 static inline void rseq_signal_deliver(struct ksignal *ksig,
 42                                        struct      42                                        struct pt_regs *regs)
 43 {                                                  43 {
 44         preempt_disable();                         44         preempt_disable();
 45         __set_bit(RSEQ_EVENT_SIGNAL_BIT, &curr     45         __set_bit(RSEQ_EVENT_SIGNAL_BIT, &current->rseq_event_mask);
 46         preempt_enable();                          46         preempt_enable();
 47         rseq_handle_notify_resume(ksig, regs);     47         rseq_handle_notify_resume(ksig, regs);
 48 }                                                  48 }
 49                                                    49 
 50 /* rseq_preempt() requires preemption to be di     50 /* rseq_preempt() requires preemption to be disabled. */
 51 static inline void rseq_preempt(struct task_st     51 static inline void rseq_preempt(struct task_struct *t)
 52 {                                                  52 {
 53         __set_bit(RSEQ_EVENT_PREEMPT_BIT, &t->     53         __set_bit(RSEQ_EVENT_PREEMPT_BIT, &t->rseq_event_mask);
 54         rseq_set_notify_resume(t);                 54         rseq_set_notify_resume(t);
 55 }                                                  55 }
 56                                                    56 
 57 /* rseq_migrate() requires preemption to be di     57 /* rseq_migrate() requires preemption to be disabled. */
 58 static inline void rseq_migrate(struct task_st     58 static inline void rseq_migrate(struct task_struct *t)
 59 {                                                  59 {
 60         __set_bit(RSEQ_EVENT_MIGRATE_BIT, &t->     60         __set_bit(RSEQ_EVENT_MIGRATE_BIT, &t->rseq_event_mask);
 61         rseq_set_notify_resume(t);                 61         rseq_set_notify_resume(t);
 62 }                                                  62 }
 63                                                    63 
 64 /*                                                 64 /*
 65  * If parent process has a registered restarta     65  * If parent process has a registered restartable sequences area, the
 66  * child inherits. Unregister rseq for a clone     66  * child inherits. Unregister rseq for a clone with CLONE_VM set.
 67  */                                                67  */
 68 static inline void rseq_fork(struct task_struc     68 static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
 69 {                                                  69 {
 70         if (clone_flags & CLONE_VM) {              70         if (clone_flags & CLONE_VM) {
 71                 t->rseq = NULL;                    71                 t->rseq = NULL;
 72                 t->rseq_len = 0;                   72                 t->rseq_len = 0;
 73                 t->rseq_sig = 0;                   73                 t->rseq_sig = 0;
 74                 t->rseq_event_mask = 0;            74                 t->rseq_event_mask = 0;
 75         } else {                                   75         } else {
 76                 t->rseq = current->rseq;           76                 t->rseq = current->rseq;
 77                 t->rseq_len = current->rseq_le     77                 t->rseq_len = current->rseq_len;
 78                 t->rseq_sig = current->rseq_si     78                 t->rseq_sig = current->rseq_sig;
 79                 t->rseq_event_mask = current->     79                 t->rseq_event_mask = current->rseq_event_mask;
 80         }                                          80         }
 81 }                                                  81 }
 82                                                    82 
 83 static inline void rseq_execve(struct task_str     83 static inline void rseq_execve(struct task_struct *t)
 84 {                                                  84 {
 85         t->rseq = NULL;                            85         t->rseq = NULL;
 86         t->rseq_len = 0;                           86         t->rseq_len = 0;
 87         t->rseq_sig = 0;                           87         t->rseq_sig = 0;
 88         t->rseq_event_mask = 0;                    88         t->rseq_event_mask = 0;
 89 }                                                  89 }
 90                                                    90 
 91 #else                                              91 #else
 92                                                    92 
 93 static inline void rseq_set_notify_resume(stru     93 static inline void rseq_set_notify_resume(struct task_struct *t)
 94 {                                                  94 {
 95 }                                                  95 }
 96 static inline void rseq_handle_notify_resume(s     96 static inline void rseq_handle_notify_resume(struct ksignal *ksig,
 97                                              s     97                                              struct pt_regs *regs)
 98 {                                                  98 {
 99 }                                                  99 }
100 static inline void rseq_signal_deliver(struct     100 static inline void rseq_signal_deliver(struct ksignal *ksig,
101                                        struct     101                                        struct pt_regs *regs)
102 {                                                 102 {
103 }                                                 103 }
104 static inline void rseq_preempt(struct task_st    104 static inline void rseq_preempt(struct task_struct *t)
105 {                                                 105 {
106 }                                                 106 }
107 static inline void rseq_migrate(struct task_st    107 static inline void rseq_migrate(struct task_struct *t)
108 {                                                 108 {
109 }                                                 109 }
110 static inline void rseq_fork(struct task_struc    110 static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
111 {                                                 111 {
112 }                                                 112 }
113 static inline void rseq_execve(struct task_str    113 static inline void rseq_execve(struct task_struct *t)
114 {                                                 114 {
115 }                                                 115 }
116                                                   116 
117 #endif                                            117 #endif
118                                                   118 
119 #ifdef CONFIG_DEBUG_RSEQ                          119 #ifdef CONFIG_DEBUG_RSEQ
120                                                   120 
121 void rseq_syscall(struct pt_regs *regs);          121 void rseq_syscall(struct pt_regs *regs);
122                                                   122 
123 #else                                             123 #else
124                                                   124 
125 static inline void rseq_syscall(struct pt_regs    125 static inline void rseq_syscall(struct pt_regs *regs)
126 {                                                 126 {
127 }                                                 127 }
128                                                   128 
129 #endif                                            129 #endif
130                                                   130 
131 #endif /* _LINUX_RSEQ_H */                        131 #endif /* _LINUX_RSEQ_H */
132                                                   132 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php