From db0ce1dd876b4aef8f6bb3ed22ad3d887c4349f7 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 17 Jan 2026 12:43:46 +0900 Subject: [PATCH 1/2] sys/prctl.h: add several missing definitions Synced with linux v6.19-rc5. --- include/sys/prctl.h | 78 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/include/sys/prctl.h b/include/sys/prctl.h index 087a75c9..a7441807 100644 --- a/include/sys/prctl.h +++ b/include/sys/prctl.h @@ -114,6 +114,7 @@ struct prctl_mm_map { #define PR_GET_TID_ADDRESS 40 #define PR_SET_THP_DISABLE 41 +#define PR_THP_DISABLE_EXCEPT_ADVISED (1 << 1) #define PR_GET_THP_DISABLE 42 #define PR_MPX_ENABLE_MANAGEMENT 43 @@ -177,6 +178,83 @@ struct prctl_mm_map { #define PR_PAC_SET_ENABLED_KEYS 60 #define PR_PAC_GET_ENABLED_KEYS 61 +#define PR_SCHED_CORE 62 +#define PR_SCHED_CORE_GET 0 +#define PR_SCHED_CORE_CREATE 1 +#define PR_SCHED_CORE_SHARE_TO 2 +#define PR_SCHED_CORE_SHARE_FROM 3 +#define PR_SCHED_CORE_MAX 4 +#define PR_SCHED_CORE_SCOPE_THREAD 0 +#define PR_SCHED_CORE_SCOPE_THREAD_GROUP 1 +#define PR_SCHED_CORE_SCOPE_PROCESS_GROUP 2 + +#define PR_SME_SET_VL 63 +#define PR_SME_SET_VL_ONEXEC (1 << 18) +#define PR_SME_GET_VL 64 +#define PR_SME_VL_LEN_MASK 0xffff +#define PR_SME_VL_INHERIT (1 << 17) + +#define PR_SET_MDWE 65 +#define PR_MDWE_REFUSE_EXEC_GAIN (1UL << 0) +#define PR_MDWE_NO_INHERIT (1UL << 1) + +#define PR_GET_MDWE 66 + +#define PR_SET_VMA 0x53564d41 +#define PR_SET_VMA_ANON_NAME 0 + +#define PR_GET_AUXV 0x41555856 + +#define PR_SET_MEMORY_MERGE 67 +#define PR_GET_MEMORY_MERGE 68 + +#define PR_RISCV_V_SET_CONTROL 69 +#define PR_RISCV_V_GET_CONTROL 70 +#define PR_RISCV_V_VSTATE_CTRL_DEFAULT 0 +#define PR_RISCV_V_VSTATE_CTRL_OFF 1 +#define PR_RISCV_V_VSTATE_CTRL_ON 2 +#define PR_RISCV_V_VSTATE_CTRL_INHERIT (1 << 4) +#define PR_RISCV_V_VSTATE_CTRL_CUR_MASK 0x3 +#define PR_RISCV_V_VSTATE_CTRL_NEXT_MASK 0xc +#define PR_RISCV_V_VSTATE_CTRL_MASK 0x1f + +#define PR_RISCV_SET_ICACHE_FLUSH_CTX 71 +#define PR_RISCV_CTX_SW_FENCEI_ON 0 +#define PR_RISCV_CTX_SW_FENCEI_OFF 1 +#define PR_RISCV_SCOPE_PER_PROCESS 0 +#define PR_RISCV_SCOPE_PER_THREAD 1 + +#define PR_PPC_GET_DEXCR 72 +#define PR_PPC_SET_DEXCR 73 +#define PR_PPC_DEXCR_SBHE 0 +#define PR_PPC_DEXCR_IBRTPD 1 +#define PR_PPC_DEXCR_SRAPD 2 +#define PR_PPC_DEXCR_NPHIE 3 +#define PR_PPC_DEXCR_CTRL_EDITABLE 0x1 +#define PR_PPC_DEXCR_CTRL_SET 0x2 +#define PR_PPC_DEXCR_CTRL_CLEAR 0x4 +#define PR_PPC_DEXCR_CTRL_SET_ONEXEC 0x8 +#define PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC 0x10 +#define PR_PPC_DEXCR_CTRL_MASK 0x1f + +#define PR_GET_SHADOW_STACK_STATUS 74 + +#define PR_SET_SHADOW_STACK_STATUS 75 +#define PR_SHADOW_STACK_ENABLE (1UL << 0) +#define PR_SHADOW_STACK_WRITE (1UL << 1) +#define PR_SHADOW_STACK_PUSH (1UL << 2) + +#define PR_LOCK_SHADOW_STACK_STATUS 76 + +#define PR_TIMER_CREATE_RESTORE_IDS 77 +#define PR_TIMER_CREATE_RESTORE_IDS_OFF 0 +#define PR_TIMER_CREATE_RESTORE_IDS_ON 1 +#define PR_TIMER_CREATE_RESTORE_IDS_GET 2 + +#define PR_FUTEX_HASH 78 +#define PR_FUTEX_HASH_SET_SLOTS 1 +#define PR_FUTEX_HASH_GET_SLOTS 2 + int prctl (int, ...); #ifdef __cplusplus -- 2.52.0