]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kselftest/arm64: Include <asm/ptrace.h> for user_gcs definition
authorLeo Yan <leo.yan@arm.com>
Wed, 29 Apr 2026 14:30:10 +0000 (15:30 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 1 May 2026 14:17:59 +0000 (15:17 +0100)
kselftest includes kernel uAPI headers with option:

  -isystem $(top_srcdir)/usr/include

Include <asm/ptrace.h> in libc-gcs.c for the definition of struct
user_gcs from the uAPI headers, and remove the redundant definition in
gcs-util.h. This fixes a compilation error on systems where the
toolchain defines NT_ARM_GCS.

Fixes: a505a52b4e29 ("kselftest/arm64: Add a GCS test program built with the system libc")
Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
tools/testing/selftests/arm64/gcs/gcs-util.h
tools/testing/selftests/arm64/gcs/libc-gcs.c

index c99a6b39ac147b4efbc9b5fbadb43daf4da2c85e..7a81bb07ed4b8b82ee90d93b336b26760703d55b 100644 (file)
 
 #ifndef NT_ARM_GCS
 #define NT_ARM_GCS 0x410
-
-struct user_gcs {
-       __u64 features_enabled;
-       __u64 features_locked;
-       __u64 gcspr_el0;
-};
 #endif
 
 /* Shadow Stack/Guarded Control Stack interface */
index 17b2fabfec386e523e788d8bcfcafa553c93bd9b..72e82bfbecc99e34da71d56cf5401c137d6e9a48 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <asm/hwcap.h>
 #include <asm/mman.h>
+#include <asm/ptrace.h>
 
 #include <linux/compiler.h>