From 971e7c6b277e1889799a63333dd191e0c05b6cb2 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 11 Feb 2023 23:12:25 +0000 Subject: [PATCH 1/2] prctl SME flags for gnu arm64. --- src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs index a20a1cf688e3c..f46ea941b97a6 100644 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -590,6 +590,13 @@ pub const PR_PAC_APDAKEY: ::c_ulong = 1 << 2; pub const PR_PAC_APDBKEY: ::c_ulong = 1 << 3; pub const PR_PAC_APGAKEY: ::c_ulong = 1 << 4; +pub const PR_SME_SET_VL: ::c_int = 63; +pub const PR_SME_GET_VL: ::c_int = 64; +pub const PR_SME_VL_LEN_MAX: ::c_int = 0xffff; + +pub const PR_SME_SET_VL_INHERIT: ::c_ulong = 1 << 17; +pub const PR_SME_SET_VL_ONE_EXEC: ::c_ulong = 1 << 18; + // Syscall table pub const SYS_io_setup: ::c_long = 0; pub const SYS_io_destroy: ::c_long = 1; From b2cd40758501fc9defb26ffabb56c34085fdbb31 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 11 Feb 2023 23:12:25 +0000 Subject: [PATCH 2/2] prctl SME flags for gnu arm64. --- libc-test/build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index ea7db1a503161..1b686b2b73ab5 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3586,8 +3586,10 @@ fn test_linux(target: &str) { // present in recent kernels only "PR_SCHED_CORE" | "PR_SCHED_CORE_CREATE" | "PR_SCHED_CORE_GET" | "PR_SCHED_CORE_MAX" | "PR_SCHED_CORE_SCOPE_PROCESS_GROUP" | "PR_SCHED_CORE_SCOPE_THREAD" | "PR_SCHED_CORE_SCOPE_THREAD_GROUP" | "PR_SCHED_CORE_SHARE_FROM" | "PR_SCHED_CORE_SHARE_TO" => true, - // present in recent kernels only + // present in recent kernels only >= 5.13 "PR_PAC_SET_ENABLED_KEYS" | "PR_PAC_GET_ENABLED_KEYS" => true, + // present in recent kernels only >= 5.19 + "PR_SME_SET_VL" | "PR_SME_GET_VL" | "PR_SME_VL_LEN_MAX" | "PR_SME_SET_VL_INHERIT" | "PR_SME_SET_VL_ONE_EXEC" => true, // Added in Linux 5.14 "FUTEX_LOCK_PI2" => true,