From de5f4213dafa8f8b0b52cdaf06bb35ad4cab1681 Mon Sep 17 00:00:00 2001 From: Sean Christopherson Date: Wed, 1 Sep 2021 13:30:28 -0700 Subject: tools: Move x86 syscall number fallbacks to .../uapi/ Move unistd_{32,64}.h from x86/include/asm to x86/include/uapi/asm so that tools/selftests that install kernel headers, e.g. KVM selftests, can include non-uapi tools headers, e.g. to get 'struct list_head', without effectively overriding the installed non-tool uapi headers. Swapping KVM's search order, e.g. to search the kernel headers before tool headers, is not a viable option as doing results in linux/type.h and other core headers getting pulled from the kernel headers, which do not have the kernel-internal typedefs that are used through tools, including many files outside of selftests/kvm's control. Prior to commit cec07f53c398 ("perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/"), the handcoded numbers were actual fallbacks, i.e. overriding unistd_{32,64}.h from the kernel headers was unintentional. Signed-off-by: Sean Christopherson Message-Id: <20210901203030.1292304-4-seanjc@google.com> Signed-off-by: Paolo Bonzini --- tools/arch/x86/include/asm/unistd_32.h | 16 ---------------- tools/arch/x86/include/asm/unistd_64.h | 19 ------------------- tools/arch/x86/include/uapi/asm/unistd_32.h | 16 ++++++++++++++++ tools/arch/x86/include/uapi/asm/unistd_64.h | 19 +++++++++++++++++++ 4 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 tools/arch/x86/include/asm/unistd_32.h delete mode 100644 tools/arch/x86/include/asm/unistd_64.h create mode 100644 tools/arch/x86/include/uapi/asm/unistd_32.h create mode 100644 tools/arch/x86/include/uapi/asm/unistd_64.h (limited to 'tools/arch') diff --git a/tools/arch/x86/include/asm/unistd_32.h b/tools/arch/x86/include/asm/unistd_32.h deleted file mode 100644 index 60a89dba01b6..000000000000 --- a/tools/arch/x86/include/asm/unistd_32.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __NR_perf_event_open -# define __NR_perf_event_open 336 -#endif -#ifndef __NR_futex -# define __NR_futex 240 -#endif -#ifndef __NR_gettid -# define __NR_gettid 224 -#endif -#ifndef __NR_getcpu -# define __NR_getcpu 318 -#endif -#ifndef __NR_setns -# define __NR_setns 346 -#endif diff --git a/tools/arch/x86/include/asm/unistd_64.h b/tools/arch/x86/include/asm/unistd_64.h deleted file mode 100644 index 4205ed4158bf..000000000000 --- a/tools/arch/x86/include/asm/unistd_64.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __NR_userfaultfd -#define __NR_userfaultfd 282 -#endif -#ifndef __NR_perf_event_open -# define __NR_perf_event_open 298 -#endif -#ifndef __NR_futex -# define __NR_futex 202 -#endif -#ifndef __NR_gettid -# define __NR_gettid 186 -#endif -#ifndef __NR_getcpu -# define __NR_getcpu 309 -#endif -#ifndef __NR_setns -#define __NR_setns 308 -#endif diff --git a/tools/arch/x86/include/uapi/asm/unistd_32.h b/tools/arch/x86/include/uapi/asm/unistd_32.h new file mode 100644 index 000000000000..60a89dba01b6 --- /dev/null +++ b/tools/arch/x86/include/uapi/asm/unistd_32.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __NR_perf_event_open +# define __NR_perf_event_open 336 +#endif +#ifndef __NR_futex +# define __NR_futex 240 +#endif +#ifndef __NR_gettid +# define __NR_gettid 224 +#endif +#ifndef __NR_getcpu +# define __NR_getcpu 318 +#endif +#ifndef __NR_setns +# define __NR_setns 346 +#endif diff --git a/tools/arch/x86/include/uapi/asm/unistd_64.h b/tools/arch/x86/include/uapi/asm/unistd_64.h new file mode 100644 index 000000000000..4205ed4158bf --- /dev/null +++ b/tools/arch/x86/include/uapi/asm/unistd_64.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __NR_userfaultfd +#define __NR_userfaultfd 282 +#endif +#ifndef __NR_perf_event_open +# define __NR_perf_event_open 298 +#endif +#ifndef __NR_futex +# define __NR_futex 202 +#endif +#ifndef __NR_gettid +# define __NR_gettid 186 +#endif +#ifndef __NR_getcpu +# define __NR_getcpu 309 +#endif +#ifndef __NR_setns +#define __NR_setns 308 +#endif -- cgit