Skip to content

Commit f25051d

Browse files
Sebastian Andrzej SiewiorPeter Zijlstra
authored andcommitted
tools headers: Synchronize prctl.h ABI header
Synchronize prctl.h with current uapi version after adding PR_FUTEX_HASH. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c042c50 commit f25051d

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

tools/include/uapi/linux/prctl.h

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ struct prctl_mm_map {
230230
# define PR_PAC_APDBKEY (1UL << 3)
231231
# define PR_PAC_APGAKEY (1UL << 4)
232232

233-
/* Tagged user address controls for arm64 */
233+
/* Tagged user address controls for arm64 and RISC-V */
234234
#define PR_SET_TAGGED_ADDR_CTRL 55
235235
#define PR_GET_TAGGED_ADDR_CTRL 56
236236
# define PR_TAGGED_ADDR_ENABLE (1UL << 0)
@@ -244,6 +244,9 @@ struct prctl_mm_map {
244244
# define PR_MTE_TAG_MASK (0xffffUL << PR_MTE_TAG_SHIFT)
245245
/* Unused; kept only for source compatibility */
246246
# define PR_MTE_TCF_SHIFT 1
247+
/* RISC-V pointer masking tag length */
248+
# define PR_PMLEN_SHIFT 24
249+
# define PR_PMLEN_MASK (0x7fUL << PR_PMLEN_SHIFT)
247250

248251
/* Control reclaim behavior when allocating memory */
249252
#define PR_SET_IO_FLUSHER 57
@@ -328,4 +331,43 @@ struct prctl_mm_map {
328331
# define PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC 0x10 /* Clear the aspect on exec */
329332
# define PR_PPC_DEXCR_CTRL_MASK 0x1f
330333

334+
/*
335+
* Get the current shadow stack configuration for the current thread,
336+
* this will be the value configured via PR_SET_SHADOW_STACK_STATUS.
337+
*/
338+
#define PR_GET_SHADOW_STACK_STATUS 74
339+
340+
/*
341+
* Set the current shadow stack configuration. Enabling the shadow
342+
* stack will cause a shadow stack to be allocated for the thread.
343+
*/
344+
#define PR_SET_SHADOW_STACK_STATUS 75
345+
# define PR_SHADOW_STACK_ENABLE (1UL << 0)
346+
# define PR_SHADOW_STACK_WRITE (1UL << 1)
347+
# define PR_SHADOW_STACK_PUSH (1UL << 2)
348+
349+
/*
350+
* Prevent further changes to the specified shadow stack
351+
* configuration. All bits may be locked via this call, including
352+
* undefined bits.
353+
*/
354+
#define PR_LOCK_SHADOW_STACK_STATUS 76
355+
356+
/*
357+
* Controls the mode of timer_create() for CRIU restore operations.
358+
* Enabling this allows CRIU to restore timers with explicit IDs.
359+
*
360+
* Don't use for normal operations as the result might be undefined.
361+
*/
362+
#define PR_TIMER_CREATE_RESTORE_IDS 77
363+
# define PR_TIMER_CREATE_RESTORE_IDS_OFF 0
364+
# define PR_TIMER_CREATE_RESTORE_IDS_ON 1
365+
# define PR_TIMER_CREATE_RESTORE_IDS_GET 2
366+
367+
/* FUTEX hash management */
368+
#define PR_FUTEX_HASH 78
369+
# define PR_FUTEX_HASH_SET_SLOTS 1
370+
# define PR_FUTEX_HASH_GET_SLOTS 2
371+
# define PR_FUTEX_HASH_GET_IMMUTABLE 3
372+
331373
#endif /* _LINUX_PRCTL_H */

0 commit comments

Comments
 (0)