selftests: Fix incorrect kernel headers search path
Subsystems (23)
Mathieu Desnoyers
maintainercover selftests: Fix incorrect kernel headers search path
Hi,
This series fixes incorrect kernel header search path in kernel selftests.
Near the end of the series, a few changes are not tagged as "Fixes" because the current behavior is to rely on the kernel sources uapi files rather than on the installed kernel header files. Nevertheless, those are updated for consistency.
There are situations where "../../../../include/" was added to -I search path, which is bogus for userspace tests and caused issues with types.h. Those are removed.
Thanks,
Mathieu
Mathieu Desnoyers (34):
selftests: arm64: Fix incorrect kernel headers search path
selftests: bpf: Fix incorrect kernel headers search path
selftests: clone3: Fix incorrect kernel headers search path
selftests: core: Fix incorrect kernel headers search path
selftests: dma: Fix incorrect kernel headers search path
selftests: dmabuf-heaps: Fix incorrect kernel headers search path
selftests: drivers: Fix incorrect kernel headers search path
selftests: filesystems: Fix incorrect kernel headers search path
selftests: futex: Fix incorrect kernel headers search path
selftests: gpio: Fix incorrect kernel headers search path
selftests: ipc: Fix incorrect kernel headers search path
selftests: kcmp: Fix incorrect kernel headers search path
selftests: media_tests: Fix incorrect kernel headers search path
selftests: membarrier: Fix incorrect kernel headers search path
selftests: mount_setattr: Fix incorrect kernel headers search path
selftests: move_mount_set_group: Fix incorrect kernel headers search
path
selftests: net: Fix incorrect kernel headers search path
selftests: perf_events: Fix incorrect kernel headers search path
selftests: pid_namespace: Fix incorrect kernel headers search path
selftests: pidfd: Fix incorrect kernel headers search path
selftests: powerpc: Fix incorrect kernel headers search path
selftests: ptp: Fix incorrect kernel headers search path
selftests: rseq: Fix incorrect kernel headers search path
selftests: sched: Fix incorrect kernel headers search path
selftests: seccomp: Fix incorrect kernel headers search path
selftests: sync: Fix incorrect kernel headers search path
selftests: user_events: Fix incorrect kernel headers search path
selftests: vm: Fix incorrect kernel headers search path
selftests: x86: Fix incorrect kernel headers search path
selftests: bpf docs: Use installed kernel headers search path
selftests: iommu: Use installed kernel headers search path
selftests: memfd: Use installed kernel headers search path
selftests: ptrace: Use installed kernel headers search path
selftests: tdx: Use installed kernel headers search path
tools/testing/selftests/arm64/fp/Makefile | 2 +- tools/testing/selftests/arm64/tags/Makefile | 2 +- tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/Makefile.docs | 2 +- tools/testing/selftests/clone3/Makefile | 2 +- tools/testing/selftests/core/Makefile | 2 +- tools/testing/selftests/dma/Makefile | 2 +- tools/testing/selftests/dmabuf-heaps/Makefile | 2 +- tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 3 +-- tools/testing/selftests/drivers/dma-buf/Makefile | 2 +- tools/testing/selftests/drivers/s390x/uvdevice/Makefile | 3 +-- tools/testing/selftests/filesystems/Makefile | 2 +- tools/testing/selftests/filesystems/binderfs/Makefile | 2 +- tools/testing/selftests/filesystems/epoll/Makefile | 2 +- tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/gpio/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 3 +-- tools/testing/selftests/ipc/Makefile | 2 +- tools/testing/selftests/kcmp/Makefile | 2 +- tools/testing/selftests/media_tests/Makefile | 2 +- tools/testing/selftests/membarrier/Makefile | 2 +- tools/testing/selftests/memfd/Makefile | 4 +--- tools/testing/selftests/mount_setattr/Makefile | 2 +- tools/testing/selftests/move_mount_set_group/Makefile | 2 +- tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/net/bpf/Makefile | 2 +- tools/testing/selftests/net/mptcp/Makefile | 2 +- tools/testing/selftests/net/openvswitch/Makefile | 2 +- tools/testing/selftests/perf_events/Makefile | 2 +- tools/testing/selftests/pid_namespace/Makefile | 2 +- tools/testing/selftests/pidfd/Makefile | 2 +- tools/testing/selftests/powerpc/ptrace/Makefile | 2 +- tools/testing/selftests/powerpc/security/Makefile | 2 +- tools/testing/selftests/powerpc/syscalls/Makefile | 2 +- tools/testing/selftests/powerpc/tm/Makefile | 2 +- tools/testing/selftests/ptp/Makefile | 2 +- tools/testing/selftests/ptrace/Makefile | 2 +- tools/testing/selftests/rseq/Makefile | 2 +- tools/testing/selftests/sched/Makefile | 2 +- tools/testing/selftests/seccomp/Makefile | 2 +- tools/testing/selftests/sync/Makefile | 2 +- tools/testing/selftests/tdx/Makefile | 2 +- tools/testing/selftests/tdx/tdx_guest_test.c | 2 +- tools/testing/selftests/user_events/Makefile | 2 +- tools/testing/selftests/vm/Makefile | 2 +- tools/testing/selftests/x86/Makefile | 2 +- 46 files changed, 46 insertions(+), 51 deletions(-)
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 1/34 selftests: arm64: Fix incorrect kernel headers search path
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/arm64/fp/Makefile | 2 +- tools/testing/selftests/arm64/tags/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/arm64/fp/Makefile +1 -1
@@ -3,7 +3,7 @@ # A proper top_srcdir is needed by KSFT(lib.mk) top_srcdir = $(realpath ../../../../../) -CFLAGS += -I$(top_srcdir)/usr/include/ +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := fp-stress \ sve-ptrace sve-probe-vls \
tools/testing/selftests/arm64/tags/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := tags_test TEST_PROGS := run_tags_test.sh
Signature · 1 line
2.25.1
Re: [PATCH 01/34] selftests: arm64: Fix incorrect kernel headers search path
Quoted 10 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]
Quoted 5 lines
--- tools/testing/selftests/arm64/fp/Makefile | 2 +- tools/testing/selftests/arm64/tags/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Adding arm maintainers.
Would you me to take this patch through kselftest tree? If you decide to take this through yours:
thanks,
-- Shuah
Re: [PATCH 01/34] selftests: arm64: Fix incorrect kernel headers search path
Hi Shuah,
Quoted 17 lines · Shuah Khan
Quoted 10 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]Quoted 5 lines
--- tools/testing/selftests/arm64/fp/Makefile | 2 +- tools/testing/selftests/arm64/tags/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 4 lines
Adding arm maintainers.
Would you me to take this patch through kselftest tree? If you decide to take this through yours:
Are you taking the whole series? If yes:
(otherwise I can pick this up)
Signature · 1 line
Catalin
Shuah Khan
maintainerRe: [PATCH 01/34] selftests: arm64: Fix incorrect kernel headers search path
Quoted 22 lines · Catalin Marinas
Hi Shuah,
Quoted 19 lines · Shuah Khan
Quoted 10 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]Quoted 5 lines
--- tools/testing/selftests/arm64/fp/Makefile | 2 +- tools/testing/selftests/arm64/tags/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Adding arm maintainers.
Quoted 9 lines
Quoted 2 lines
Would you me to take this patch through kselftest tree? If you decide to take this through yours:
Are you taking the whole series? If yes:
Acked-by Catalin Marinas <[email protected]>(otherwise I can pick this up)
I am taking several patches in the series with an exception when maintainers want to take them through theirs.
I will apply to mine and take this through.
thanks,
-- Shuah
Mathieu Desnoyers
maintainerPATCH 2/34 selftests: bpf: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/Makefile +1 -1
@@ -327,7 +327,7 @@ endif CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH)) BPF_CFLAGS = -g -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ -I$(INCLUDE_DIR) -I$(CURDIR) -I$(APIDIR) \ - -I$(abspath $(OUTPUT)/../usr/include) + $(KHDR_INCLUDES) CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \ -Wno-compare-distinct-pointer-types
Signature · 1 line
2.25.1
Re: [PATCH 02/34] selftests: bpf: Fix incorrect kernel headers search path
Quoted 19 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]--- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/Makefile +0
-0
tools/testing/selftests/bpf/Makefile endif · line 333
Quoted 8 lines
tools/testing/selftests/bpf/Makefile +1
-1@@ -327,7 +327,7 @@ endif CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH)) BPF_CFLAGS = -g -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ -I$(INCLUDE_DIR) -I$(CURDIR) -I$(APIDIR) \ - -I$(abspath $(OUTPUT)/../usr/include) + $(KHDR_INCLUDES) CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \ -Wno-compare-distinct-pointer-types
Adding bpf maintainers - bpf patches usually go through bpf tree.
thanks,
-- Shuah
Re: [PATCH 02/34] selftests: bpf: Fix incorrect kernel headers search path
Quoted 27 lines · Shuah Khan
Quoted 25 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]--- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/Makefile +1
-1@@ -327,7 +327,7 @@ endif CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH)) BPF_CFLAGS = -g -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ -I$(INCLUDE_DIR) -I$(CURDIR) -I$(APIDIR) \ - -I$(abspath $(OUTPUT)/../usr/include) + $(KHDR_INCLUDES)
Quoted 8 lines
tools/testing/selftests/bpf/Makefile endif · line 333
Quoted 2 lines
tools/testing/selftests/bpf/Makefile +0
-0CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \ -Wno-compare-distinct-pointer-typesAdding bpf maintainers - bpf patches usually go through bpf tree.
Acked-by Shuah Khan <[email protected]>
Please resubmit as separate patch with [PATCH bpf-next] subj and cc bpf@vger, so that BPF CI can test it on various architectures and config combinations.
Mathieu Desnoyers
maintainerRe: [PATCH 02/34] selftests: bpf: Fix incorrect kernel headers search path
Quoted 35 lines · Alexei Starovoitov
Quoted 34 lines · Shuah Khan
Quoted 19 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]--- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/Makefile +0
-0tools/testing/selftests/bpf/Makefile endif · line 333
Quoted 8 lines
tools/testing/selftests/bpf/Makefile +1
-1@@ -327,7 +327,7 @@ endif CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH)) BPF_CFLAGS = -g -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ -I$(INCLUDE_DIR) -I$(CURDIR) -I$(APIDIR) \ - -I$(abspath $(OUTPUT)/../usr/include) + $(KHDR_INCLUDES) CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \ -Wno-compare-distinct-pointer-typesAdding bpf maintainers - bpf patches usually go through bpf tree.
Quoted 5 lines
Quoted 1 line
Acked-by Shuah Khan <[email protected]>Please resubmit as separate patch with [PATCH bpf-next] subj and cc bpf@vger, so that BPF CI can test it on various architectures and config combinations.
Hi Shuah,
Do you have means to resubmit it on your end, or should I do it ?
Thanks,
Mathieu
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com
Shuah Khan
maintainerRe: [PATCH 02/34] selftests: bpf: Fix incorrect kernel headers search path
Quoted 38 lines · Mathieu Desnoyers
Quoted 37 lines · Alexei Starovoitov
Quoted 35 lines · Shuah Khan
Quoted 26 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]---
tools/testing/selftests/bpf/Makefile| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/Makefile +1
-1@@ -327,7 +327,7 @@ endif CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH)) BPF_CFLAGS = -g -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ -I$(INCLUDE_DIR) -I$(CURDIR) -I$(APIDIR) \ - -I$(abspath $(OUTPUT)/../usr/include) + $(KHDR_INCLUDES) CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \Quoted 1 line
-Wno-compare-distinct-pointer-types
Adding bpf maintainers - bpf patches usually go through bpf tree.
Acked-by Shuah Khan <[email protected]>
Quoted 8 lines
Quoted 3 lines
Please resubmit as separate patch with [PATCH bpf-next] subj and cc bpf@vger, so that BPF CI can test it on various architectures and config combinations.
Hi Shuah,
Do you have means to resubmit it on your end, or should I do it ?
Hi Mathieu,
Please go ahead and resubmit.
thanks,
-- Shuah
Mathieu Desnoyers
maintainerPATCH 3/34 selftests: clone3: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/clone3/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/clone3/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -g -std=gnu99 -I../../../../usr/include/ +CFLAGS += -g -std=gnu99 $(KHDR_INCLUDES) LDLIBS += -lcap TEST_GEN_PROGS := clone3 clone3_clear_sighand clone3_set_tid \
Signature · 1 line
2.25.1
Re: [PATCH 03/34] selftests: clone3: Fix incorrect kernel headers search path
Quoted 19 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]--- tools/testing/selftests/clone3/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/clone3/Makefile +0
-0
tools/testing/selftests/clone3/Makefile line 5
Quoted 6 lines
tools/testing/selftests/clone3/Makefile +1
-1@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -g -std=gnu99 -I../../../../usr/include/ +CFLAGS += -g -std=gnu99 $(KHDR_INCLUDES) LDLIBS += -lcap TEST_GEN_PROGS := clone3 clone3_clear_sighand clone3_set_tid \
Hi Christian,
Would you me to take this patch through kselftest tree? If you decide to take this through yours:
thanks,
-- Shuah
Re: [PATCH 03/34] selftests: clone3: Fix incorrect kernel headers search path
Quoted 6 lines · Shuah Khan
Quoted 5 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Quoted 6 lines
Quoted 6 lines
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]---
Looks good to me,
Quoted 16 lines
tools/testing/selftests/clone3/Makefile line 4
Quoted 13 lines
tools/testing/selftests/clone3/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/clone3/Makefile +1
-1@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -g -std=gnu99 -I../../../../usr/include/ +CFLAGS += -g -std=gnu99 $(KHDR_INCLUDES) LDLIBS += -lcap TEST_GEN_PROGS := clone3 clone3_clear_sighand clone3_set_tid \
Quoted 1 line
Hi Christian,
Hey Shuah,
Quoted 2 lines
Would you me to take this patch through kselftest tree? If you
Feel free to take it through the kselftest tree. Thank you! Christian
Mathieu Desnoyers
maintainerPATCH 4/34 selftests: core: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/core/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/core/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -CFLAGS += -g -I../../../../usr/include/ +CFLAGS += -g $(KHDR_INCLUDES) TEST_GEN_PROGS := close_range_test
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 5/34 selftests: dma: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/dma/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/dma/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) CFLAGS += -I../../../../include/ TEST_GEN_PROGS := dma_map_benchmark
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 6/34 selftests: dmabuf-heaps: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/dmabuf-heaps/Makefile | 2 +- tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
tools/testing/selftests/dmabuf-heaps/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -static -O3 -Wl,-no-as-needed -Wall +CFLAGS += -static -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) TEST_GEN_PROGS = dmabuf-heap
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c +1 -2
@@ -13,10 +13,9 @@#include <sys/types.h> #include <linux/dma-buf.h> +#include <linux/dma-heap.h> #include <drm/drm.h> -#include "../../../../include/uapi/linux/dma-heap.h" -#define DEVPATH "/dev/dma_heap"static int check_vgem (int fd)
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 7/34 selftests: drivers: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/drivers/dma-buf/Makefile | 2 +- tools/testing/selftests/drivers/s390x/uvdevice/Makefile | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
tools/testing/selftests/drivers/dma-buf/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -CFLAGS += -I../../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := udmabuf
tools/testing/selftests/drivers/s390x/uvdevice/Makefile +1 -2
@@ -11,10 +11,9 @@ else TEST_GEN_PROGS := test_uvdevice top_srcdir ?= ../../../../../.. -khdr_dir = $(top_srcdir)/usr/include LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include -CFLAGS += -Wall -Werror -static -I$(khdr_dir) -I$(LINUX_TOOL_ARCH_INCLUDE) +CFLAGS += -Wall -Werror -static $(KHDR_INCLUDES) -I$(LINUX_TOOL_ARCH_INCLUDE) include ../../../lib.mk
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 8/34 selftests: filesystems: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/filesystems/Makefile | 2 +- tools/testing/selftests/filesystems/binderfs/Makefile | 2 +- tools/testing/selftests/filesystems/epoll/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/filesystems/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := devpts_pts TEST_GEN_PROGS_EXTENDED := dnotify_test
tools/testing/selftests/filesystems/binderfs/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../../usr/include/ -pthread +CFLAGS += $(KHDR_INCLUDES) -pthread TEST_GEN_PROGS := binderfs_test binderfs_test: binderfs_test.c ../../kselftest.h ../../kselftest_harness.h
tools/testing/selftests/filesystems/epoll/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) LDLIBS += -lpthread TEST_GEN_PROGS := epoll_wakeup_test
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 9/34 selftests: futex: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/futex/functional/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/futex/functional/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -INCLUDES := -I../include -I../../ -I../../../../../usr/include/ +INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 10/34 selftests: gpio: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/gpio/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/gpio/Makefile +1 -1
@@ -3,6 +3,6 @@ TEST_PROGS := gpio-mockup.sh gpio-sim.sh TEST_FILES := gpio-mockup-sysfs.sh TEST_GEN_PROGS_EXTENDED := gpio-mockup-cdev gpio-chip-info gpio-line-name -CFLAGS += -O2 -g -Wall -I../../../../usr/include/ $(KHDR_INCLUDES) +CFLAGS += -O2 -g -Wall $(KHDR_INCLUDES) include ../lib.mk
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 11/34 selftests: ipc: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/ipc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ipc/Makefile +1 -1
@@ -10,7 +10,7 @@ ifeq ($(ARCH),x86_64) CFLAGS := -DCONFIG_X86_64 -D__x86_64__ endif -CFLAGS += -I../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := msgque
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 12/34 selftests: kcmp: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/kcmp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kcmp/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -CFLAGS += -I../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := kcmp_test
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 13/34 selftests: media_tests: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/media_tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/media_tests/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # -CFLAGS += -I../ -I../../../../usr/include/ +CFLAGS += -I../ $(KHDR_INCLUDES) TEST_GEN_PROGS := media_device_test media_device_open video_device_test include ../lib.mk
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 14/34 selftests: membarrier: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/membarrier/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/membarrier/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -CFLAGS += -g -I../../../../usr/include/ +CFLAGS += -g $(KHDR_INCLUDES) LDLIBS += -lpthread TEST_GEN_PROGS := membarrier_test_single_thread \
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 15/34 selftests: mount_setattr: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/mount_setattr/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mount_setattr/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for mount selftests. -CFLAGS = -g -I../../../../usr/include/ -Wall -O2 -pthread +CFLAGS = -g $(KHDR_INCLUDES) -Wall -O2 -pthread TEST_GEN_FILES += mount_setattr_test
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 16/34 selftests: move_mount_set_group: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/move_mount_set_group/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/move_mount_set_group/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for mount selftests. -CFLAGS = -g -I../../../../usr/include/ -Wall -O2 +CFLAGS = -g $(KHDR_INCLUDES) -Wall -O2 TEST_GEN_FILES += move_mount_set_group_test
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 17/34 selftests: net: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/net/bpf/Makefile | 2 +- tools/testing/selftests/net/mptcp/Makefile | 2 +- tools/testing/selftests/net/openvswitch/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/net/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for net selftests CFLAGS = -Wall -Wl,--no-as-needed -O2 -g -CFLAGS += -I../../../../usr/include/ $(KHDR_INCLUDES) +CFLAGS += $(KHDR_INCLUDES) TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh \ rtnetlink.sh xfrm_policy.sh test_blackhole_dev.sh
tools/testing/selftests/net/bpf/Makefile +1 -1
@@ -7,7 +7,7 @@ BPFDIR := $(abspath ../../../lib/bpf) APIDIR := $(abspath ../../../include/uapi) CCINCLUDE += -I../../bpf -CCINCLUDE += -I../../../../../usr/include/ +CCINCLUDE += $(KHDR_INCLUDES) CCINCLUDE += -I$(SCRATCH_DIR)/include BPFOBJ := $(BUILD_DIR)/libbpf/libbpf.a
tools/testing/selftests/net/mptcp/Makefile +1 -1
@@ -2,7 +2,7 @@ top_srcdir = ../../../../.. -CFLAGS = -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES) +CFLAGS = -Wall -Wl,--no-as-needed -O2 -g $(KHDR_INCLUDES) TEST_PROGS := mptcp_connect.sh pm_netlink.sh mptcp_join.sh diag.sh \ simult_flows.sh mptcp_sockopt.sh userspace_pm.sh
tools/testing/selftests/net/openvswitch/Makefile +1 -1
@@ -2,7 +2,7 @@ top_srcdir = ../../../../.. -CFLAGS = -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES) +CFLAGS = -Wall -Wl,--no-as-needed -O2 -g $(KHDR_INCLUDES) TEST_PROGS := openvswitch.sh
Signature · 1 line
2.25.1
Re: [PATCH 17/34] selftests: net: Fix incorrect kernel headers search path
Hi Mathieu,
Quoted 4 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Thank you for the patch!
Quoted 5 lines
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]
(It might be useful to add a "Fixes" tag as well to clearly indicate the dependence with a specific commit and better understand the fix.)
(and add all the individual maintainers of the files you modify -- feel free to use 'b4' to help you for this task ;-) )
(...)
tools/testing/selftests/net/mptcp/Makefile line 5
Quoted 10 lines
tools/testing/selftests/net/mptcp/Makefile +1
-1@@ -2,7 +2,7 @@ top_srcdir = ../../../../.. -CFLAGS = -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES) +CFLAGS = -Wall -Wl,--no-as-needed -O2 -g $(KHDR_INCLUDES)
I only looked at the modification here with MPTCP selftests and it looks good to me. It makes sense because if KHDR_INCLUDES is not set, it will be set later by lib.mk I suppose.
Just one small thing: I guess you can also remove "top_srcdir" variable that is no longer used, right? I see that "lib.mk" uses a variable with the same name but it overrides its value anyway. But it is likely I missed something there :)
If indeed it is no longer needed, I guess a few Makefile can be adapted according to:
git grep top_srcdir -- tools/testing/selftests/*/
I guess most of these Makefile are very similar, no? For MPTCP, we simply looked at what was done elsewhere :)
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Mathieu Desnoyers
maintainerRe: [PATCH 17/34] selftests: net: Fix incorrect kernel headers search path
Quoted 9 lines · Matthieu Baerts
Hi Mathieu,
Quoted 4 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Thank you for the patch!
You're welcome :)
Quoted 9 lines
Quoted 6 lines
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+](It might be useful to add a "Fixes" tag as well to clearly indicate the dependence with a specific commit and better understand the fix.)
Just a bit of context: I found this problematic pattern in my own selftests (rseq and membarrier), and figured that it was an issue all across the board. I did an initial single-patch fix, and then split it up in 34 patches based on feedback from Shuah Khan.
I know it should have a Fixed ... tag, but I simply don't have time to do the historical investigation work for all the 34 patches form this patchset. Perhaps someone else is up to the task ?
Quoted 3 lines
(and add all the individual maintainers of the files you modify -- feel free to use 'b4' to help you for this task ;-) )
If this can be automated, then perhaps Shuah can use it to append the relevant information ?
Quoted 23 lines
(...)
tools/testing/selftests/net/mptcp/Makefile line 5
Quoted 10 lines
tools/testing/selftests/net/mptcp/Makefile +1
-1@@ -2,7 +2,7 @@ top_srcdir = ../../../../.. -CFLAGS = -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES) +CFLAGS = -Wall -Wl,--no-as-needed -O2 -g $(KHDR_INCLUDES)I only looked at the modification here with MPTCP selftests and it looks good to me. It makes sense because if
KHDR_INCLUDESis not set, it will be set later by lib.mk I suppose.Just one small thing: I guess you can also remove "
top_srcdir" variable that is no longer used, right? I see that "lib.mk" uses a variable with the same name but it overrides its value anyway. But it is likely I missed something there :)
Quoted 5 lines
If indeed it is no longer needed, I guess a few
Makefilecan be adapted according to:git grep
top_srcdir--tools/testing/selftests/*/
Yes, this should perhaps come as additional fixes on top of my series. I don't have time to do it myself though.
Anyone willing to contribute it ?
Quoted 2 lines
I guess most of these
Makefileare very similar, no? For MPTCP, we simply looked at what was done elsewhere :)
Yes, I did likewise.
Thanks for the feedback,
Mathieu
Quoted 3 lines
Cheers,
Matt
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com
Re: [PATCH 17/34] selftests: net: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersQuoted 10 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]
Quoted 7 lines
--- tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/net/bpf/Makefile | 2 +- tools/testing/selftests/net/mptcp/Makefile | 2 +- tools/testing/selftests/net/openvswitch/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
Adding net maintainers:
Would you me to take this patch through kselftest tree? If you decide to take this through yours:
thanks,
-- Shuah
Mathieu Desnoyers
maintainerPATCH 18/34 selftests: perf_events: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/perf_events/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/perf_events/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -Wl,-no-as-needed -Wall -I../../../../usr/include +CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDFLAGS += -lpthread TEST_GEN_PROGS := sigtrap_threads remove_on_exec
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 19/34 selftests: pid_namespace: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/pid_namespace/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/pid_namespace/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -g -I../../../../usr/include/ +CFLAGS += -g $(KHDR_INCLUDES) TEST_GEN_PROGS = regression_enomem
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 20/34 selftests: pidfd: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/pidfd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/pidfd/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -CFLAGS += -g -I../../../../usr/include/ -pthread -Wall +CFLAGS += -g $(KHDR_INCLUDES) -pthread -Wall TEST_GEN_PROGS := pidfd_test pidfd_fdinfo_test pidfd_open_test \ pidfd_poll_test pidfd_wait pidfd_getfd_test pidfd_setns_test
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 21/34 selftests: powerpc: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/powerpc/ptrace/Makefile | 2 +- tools/testing/selftests/powerpc/security/Makefile | 2 +- tools/testing/selftests/powerpc/syscalls/Makefile | 2 +- tools/testing/selftests/powerpc/tm/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/powerpc/ptrace/Makefile +1 -1
@@ -33,7 +33,7 @@ TESTS_64 := $(patsubst %,$(OUTPUT)/%,$(TESTS_64)) $(TESTS_64): CFLAGS += -m64 $(TM_TESTS): CFLAGS += -I../tm -mhtm -CFLAGS += -I../../../../../usr/include -fno-pie +CFLAGS += $(KHDR_INCLUDES) -fno-pie $(OUTPUT)/ptrace-gpr: ptrace-gpr.S $(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: LDLIBS += -pthread
tools/testing/selftests/powerpc/security/Makefile +1 -1
@@ -5,7 +5,7 @@ TEST_PROGS := mitigation-patching.sh top_srcdir = ../../../../.. -CFLAGS += -I../../../../../usr/include +CFLAGS += $(KHDR_INCLUDES) include ../../lib.mk
tools/testing/selftests/powerpc/syscalls/Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only TEST_GEN_PROGS := ipc_unmuxed rtas_filter -CFLAGS += -I../../../../../usr/include +CFLAGS += $(KHDR_INCLUDES) top_srcdir = ../../../../.. include ../../lib.mk
tools/testing/selftests/powerpc/tm/Makefile +1 -1
@@ -17,7 +17,7 @@ $(TEST_GEN_PROGS): ../harness.c ../utils.c CFLAGS += -mhtm $(OUTPUT)/tm-syscall: tm-syscall-asm.S -$(OUTPUT)/tm-syscall: CFLAGS += -I../../../../../usr/include +$(OUTPUT)/tm-syscall: CFLAGS += $(KHDR_INCLUDES) $(OUTPUT)/tm-tmspr: CFLAGS += -pthread $(OUTPUT)/tm-vmx-unavail: CFLAGS += -pthread -m64 $(OUTPUT)/tm-resched-dscr: ../pmu/lib.c
Signature · 1 line
2.25.1
Re: [PATCH 21/34] selftests: powerpc: Fix incorrect kernel headers search path
Quoted 61 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]--- tools/testing/selftests/powerpc/ptrace/Makefile | 2 +- tools/testing/selftests/powerpc/security/Makefile | 2 +- tools/testing/selftests/powerpc/syscalls/Makefile | 2 +- tools/testing/selftests/powerpc/tm/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)tools/testing/selftests/powerpc/ptrace/Makefile +1
-1@@ -33,7 +33,7 @@ TESTS_64 := $(patsubst %,$(OUTPUT)/%,$(TESTS_64)) $(TESTS_64): CFLAGS += -m64 $(TM_TESTS): CFLAGS += -I../tm -mhtm -CFLAGS += -I../../../../../usr/include -fno-pie +CFLAGS += $(KHDR_INCLUDES) -fno-pie $(OUTPUT)/ptrace-gpr: ptrace-gpr.S $(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: LDLIBS += -pthreadtools/testing/selftests/powerpc/security/Makefile +1
-1@@ -5,7 +5,7 @@ TEST_PROGS := mitigation-patching.sh top_srcdir = ../../../../.. -CFLAGS += -I../../../../../usr/include +CFLAGS += $(KHDR_INCLUDES) include ../../lib.mktools/testing/selftests/powerpc/syscalls/Makefile +1
-1@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only TEST_GEN_PROGS := ipc_unmuxed rtas_filter -CFLAGS += -I../../../../../usr/include +CFLAGS += $(KHDR_INCLUDES) top_srcdir = ../../../../.. include ../../lib.mktools/testing/selftests/powerpc/tm/Makefile +0
-0
tools/testing/selftests/powerpc/tm/Makefile $(TEST_GEN_PROGS): ../harness.c ../utils.c · line 23
Quoted 8 lines
tools/testing/selftests/powerpc/tm/Makefile +1
-1@@ -17,7 +17,7 @@ $(TEST_GEN_PROGS): ../harness.c ../utils.c CFLAGS += -mhtm $(OUTPUT)/tm-syscall: tm-syscall-asm.S -$(OUTPUT)/tm-syscall: CFLAGS += -I../../../../../usr/include +$(OUTPUT)/tm-syscall: CFLAGS += $(KHDR_INCLUDES) $(OUTPUT)/tm-tmspr: CFLAGS += -pthread $(OUTPUT)/tm-vmx-unavail: CFLAGS += -pthread -m64 $(OUTPUT)/tm-resched-dscr: ../pmu/lib.c
Adding powerpc maitainers.
Would you me to take this patch through kselftest tree? If you decide to take this through yours:
thanks,
-- Shuah
Mathieu Desnoyers
maintainerPATCH 22/34 selftests: ptp: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/ptp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ptp/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -I../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) TEST_PROGS := testptp LDLIBS += -lrt all: $(TEST_PROGS)
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 23/34 selftests: rseq: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/rseq/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rseq/Makefile +1 -1
@@ -4,7 +4,7 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) CLANG_FLAGS += -no-integrated-as endif -CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -L$(OUTPUT) -Wl,-rpath=./ \ +CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ \ $(CLANG_FLAGS) LDLIBS += -lpthread -ldl
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 24/34 selftests: sched: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/sched/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/sched/Makefile +1 -1
@@ -4,7 +4,7 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) CLANG_FLAGS += -no-integrated-as endif -CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -Wl,-rpath=./ \ +CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -Wl,-rpath=./ \ $(CLANG_FLAGS) LDLIBS += -lpthread
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 25/34 selftests: seccomp: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/seccomp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/seccomp/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -Wl,-no-as-needed -Wall -isystem ../../../../usr/include/ +CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDFLAGS += -lpthread LDLIBS += -lcap
Signature · 1 line
2.25.1
Re: [PATCH 25/34] selftests: seccomp: Fix incorrect kernel headers search path
Quoted 19 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]--- tools/testing/selftests/seccomp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/seccomp/Makefile +0
-0
tools/testing/selftests/seccomp/Makefile line 5
Quoted 6 lines
tools/testing/selftests/seccomp/Makefile +1
-1@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -Wl,-no-as-needed -Wall -isystem ../../../../usr/include/ +CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDFLAGS += -lpthread LDLIBS += -lcap
Now the right one.
Kees,
I plan to take this through kselftest unless there are conflicts. In case there are conflicts and you want to take this through yours
thanks,
-- Shuah
Mathieu Desnoyers
maintainerPATCH 26/34 selftests: sync: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/sync/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/sync/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra -CFLAGS += -I../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) LDFLAGS += -pthread .PHONY: all clean
Signature · 1 line
2.25.1
Re: [PATCH 26/34] selftests: sync: Fix incorrect kernel headers search path
Quoted 19 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]--- tools/testing/selftests/sync/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/sync/Makefile +0
-0
tools/testing/selftests/sync/Makefile line 6
Quoted 7 lines
tools/testing/selftests/sync/Makefile +1
-1@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra -CFLAGS += -I../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) LDFLAGS += -pthread .PHONY: all clean
Adding seccomp maintainers:
kees,
I plan to take this through kselftest unless there are conflicts. In case there are conflicts and you want to take this through yours
thanks,
-- Shuah
Shuah Khan
maintainerRe: [PATCH 26/34] selftests: sync: Fix incorrect kernel headers search path
Quoted 29 lines · Shuah Khan
Quoted 23 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]---
tools/testing/selftests/sync/Makefile| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/sync/Makefile +0
-0@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra
tools/testing/selftests/sync/Makefile +1
-1-CFLAGS += -I../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES)Quoted 2 lines
LDFLAGS += -pthread
.PHONY: all cleanAdding seccomp maintainers:
Quoted 7 lines
kees,
I plan to take this through kselftest unless there are conflicts. In case there are conflicts and you want to take this through yours
Acked-by Shuah Khan <[email protected]>
Sorry wrong message. I am taking this one through mine.
-- Shuah
Mathieu Desnoyers
maintainerPATCH 27/34 selftests: user_events: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/user_events/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/user_events/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -Wl,-no-as-needed -Wall -I../../../../usr/include +CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDLIBS += -lrt -lpthread -lm TEST_GEN_PROGS = ftrace_test dyn_test perf_test
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 28/34 selftests: vm: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/vm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/Makefile +1 -1
@@ -25,7 +25,7 @@ MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/' -e 's/ppc64.*/p # LDLIBS. MAKEFLAGS += --no-builtin-rules -CFLAGS = -Wall -I $(top_srcdir) -I $(top_srcdir)/usr/include $(EXTRA_CFLAGS) $(KHDR_INCLUDES) +CFLAGS = -Wall -I $(top_srcdir) $(EXTRA_CFLAGS) $(KHDR_INCLUDES) LDLIBS = -lrt -lpthread TEST_GEN_FILES = cow TEST_GEN_FILES += compaction_test
Signature · 1 line
2.25.1
Re: [PATCH 28/34] selftests: vm: Fix incorrect kernel headers search path
Quoted 19 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>Cc <[email protected]> [5.18+]--- tools/testing/selftests/vm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/vm/Makefile +0
-0
tools/testing/selftests/vm/Makefile MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/' -e 's/ppc64.*/p · line 31
Quoted 8 lines
tools/testing/selftests/vm/Makefile +1
-1@@ -25,7 +25,7 @@ MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/' -e 's/ppc64.*/p # LDLIBS. MAKEFLAGS += --no-builtin-rules -CFLAGS = -Wall -I $(top_srcdir) -I $(top_srcdir)/usr/include $(EXTRA_CFLAGS) $(KHDR_INCLUDES) +CFLAGS = -Wall -I $(top_srcdir) $(EXTRA_CFLAGS) $(KHDR_INCLUDES) LDLIBS = -lrt -lpthread TEST_GEN_FILES = cow TEST_GEN_FILES += compaction_test
Adding mm maintainers.
Andrew,
Would you me to take this patch through kselftest tree? If you decide to take this through yours:
thanks,
-- Shuah
Mathieu Desnoyers
maintainerPATCH 29/34 selftests: x86: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for kernel headers. This prevents building against kernel headers from the build environment in scenarios where kernel headers are installed into a specific output directory (O=...).
--- tools/testing/selftests/x86/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/x86/Makefile +1 -1
@@ -34,7 +34,7 @@ BINARIES_64 := $(TARGETS_C_64BIT_ALL:%=%_64) BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) -CFLAGS := -O2 -g -std=gnu99 -pthread -Wall +CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES) # call32_from_64 in thunks.S uses absolute addresses. ifeq ($(CAN_BUILD_WITH_NOPIE),1)
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 30/34 selftests: bpf docs: Use installed kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for installed kernel headers rather than using kernel headers in include/uapi from the source kernel tree kernel headers.
--- tools/testing/selftests/bpf/Makefile.docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/Makefile.docs +1 -1
@@ -44,7 +44,7 @@ RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null) # $1 - target for scripts/bpf_doc.py # $2 - man page section to generate the troff file define DOCS_RULES = -$(OUTPUT)bpf-$1.rst: ../../../../include/uapi/linux/bpf.h +$(OUTPUT)bpf-$1.rst: $(KHDR_INCLUDES)/linux/bpf.h $$(QUIET_GEN)../../../../scripts/bpf_doc.py $1 \ --filename $$< > $$@
Signature · 1 line
2.25.1
Re: [PATCH 30/34] selftests: bpf docs: Use installed kernel headers search path
Quoted 17 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for installed kernel headers rather than using kernel headers in
include/uapifrom the source kernel tree kernel headers.Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>--- tools/testing/selftests/bpf/Makefile.docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/Makefile.docs +0
-0
tools/testing/selftests/bpf/Makefile.docs RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null) · line 50
Quoted 8 lines
tools/testing/selftests/bpf/Makefile.docs +1
-1@@ -44,7 +44,7 @@ RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null) # $1 - target for scripts/bpf_doc.py # $2 - man page section to generate the troff file define DOCS_RULES = -$(OUTPUT)bpf-$1.rst: ../../../../include/uapi/linux/bpf.h +$(OUTPUT)bpf-$1.rst: $(KHDR_INCLUDES)/linux/bpf.h $$(QUIET_GEN)../../../../scripts/bpf_doc.py $1 \ --filename $$< > $$@
Adding bpf maintainers.
Here is my ack:
thanks,
-- Shuah
Mathieu Desnoyers
maintainerPATCH 31/34 selftests: iommu: Use installed kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for installed kernel headers rather than using kernel headers in include/uapi from the source kernel tree kernel headers.
Remove bogus ../../../../include/ from the search path, because kernel source headers are not needed by those user-space selftests, and it causes issues because -I paths are searched before -isystem paths, and conflicts for files appearing both in kernel sources and in uapi headers with incompatible semantics (e.g. types.h).
--- tools/testing/selftests/iommu/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/iommu/Makefile +1 -2
@@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -I../../../../include/uapi/ -CFLAGS += -I../../../../include/ +CFLAGS += $(KHDR_INCLUDES) CFLAGS += -D_GNU_SOURCE
Signature · 1 line
2.25.1
Re: [PATCH 31/34] selftests: iommu: Use installed kernel headers search path
Quoted 23 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for installed kernel headers rather than using kernel headers in
include/uapifrom the source kernel tree kernel headers.Remove bogus ../../../../include/ from the search path, because kernel source headers are not needed by those user-space selftests, and it causes issues because -I paths are searched before -isystem paths, and conflicts for files appearing both in kernel sources and in uapi headers with incompatible semantics (e.g.
types.h).Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>--- tools/testing/selftests/iommu/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)tools/testing/selftests/iommu/Makefile +0
-0
tools/testing/selftests/iommu/Makefile line 6
Quoted 8 lines
tools/testing/selftests/iommu/Makefile +1
-2@@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -I../../../../include/uapi/ -CFLAGS += -I../../../../include/ +CFLAGS += $(KHDR_INCLUDES) CFLAGS += -D_GNU_SOURCE
Adding iommu test maintainers:
I plan to take this through kselftest unless there are conflicts. In case there are conflicts and you want to take this through yours
thanks,
-- Shuah
Re: [PATCH 31/34] selftests: iommu: Use installed kernel headers search path
Quoted 33 lines · Shuah Khan
Quoted 23 lines · Mathieu Desnoyers
Use $(KHDR_INCLUDES) as lookup path for installed kernel headers rather than using kernel headers in
include/uapifrom the source kernel tree kernel headers.Remove bogus ../../../../include/ from the search path, because kernel source headers are not needed by those user-space selftests, and it causes issues because -I paths are searched before -isystem paths, and conflicts for files appearing both in kernel sources and in uapi headers with incompatible semantics (e.g.
types.h).Signed-off-by Mathieu Desnoyers <[email protected]>Cc Shuah Khan <[email protected]>Cc Ingo Molnar <[email protected]>--- tools/testing/selftests/iommu/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)tools/testing/selftests/iommu/Makefile +0
-0tools/testing/selftests/iommu/Makefile line 4
Quoted 6 lines
tools/testing/selftests/iommu/Makefile +1
-2@@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -I../../../../include/uapi/ -CFLAGS += -I../../../../include/ +CFLAGS += $(KHDR_INCLUDES) CFLAGS += -D_GNU_SOURCEAdding iommu test maintainers:
Quoted 4 lines
I plan to take this through kselftest unless there are conflicts. In case there are conflicts and you want to take this through yours
Acked-by Shuah Khan <[email protected]>
Go ahead please
Jason
Mathieu Desnoyers
maintainerPATCH 32/34 selftests: memfd: Use installed kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for installed kernel headers rather than using kernel headers in include/uapi from the source kernel tree kernel headers.
Remove bogus ../../../../include/ from the search path, because kernel source headers are not needed by those user-space selftests, and it causes issues because -I paths are searched before -isystem paths, and conflicts for files appearing both in kernel sources and in uapi headers with incompatible semantics (e.g. types.h).
--- tools/testing/selftests/memfd/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
tools/testing/selftests/memfd/Makefile +1 -3
@@ -1,8 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -D_FILE_OFFSET_BITS=64 -CFLAGS += -I../../../../include/uapi/ -CFLAGS += -I../../../../include/ -CFLAGS += -I../../../../usr/include/ +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := memfd_test TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 33/34 selftests: ptrace: Use installed kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for installed kernel headers rather than using kernel headers in include/uapi from the source kernel tree kernel headers.
--- tools/testing/selftests/ptrace/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ptrace/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only -CFLAGS += -std=c99 -pthread -iquote../../../../include/uapi -Wall +CFLAGS += -std=c99 -pthread -Wall $(KHDR_INCLUDES) TEST_GEN_PROGS := get_syscall_info peeksiginfo vmaccess
Signature · 1 line
2.25.1
Mathieu Desnoyers
maintainerPATCH 34/34 selftests: tdx: Use installed kernel headers search path
In reply to Mathieu DesnoyersUse $(KHDR_INCLUDES) as lookup path for installed kernel headers rather than using kernel headers in include/uapi from the source kernel tree kernel headers.
--- tools/testing/selftests/tdx/Makefile | 2 +- tools/testing/selftests/tdx/tdx_guest_test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/tdx/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -O3 -Wl,-no-as-needed -Wall -static +CFLAGS += -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) -static TEST_GEN_PROGS := tdx_guest_test
tools/testing/selftests/tdx/tdx_guest_test.c +1 -1
@@ -12,8 +12,8 @@#include <errno.h> #include <fcntl.h> +#include <linux/tdx-guest.h> #include "../kselftest_harness.h" -#include "../../../../include/uapi/linux/tdx-guest.h" #define TDX_GUEST_DEVNAME "/dev/tdx_guest"#define HEX_DUMP_SIZE 8
Signature · 1 line
2.25.1
Shuah Khan
maintainerQuoted 14 lines · Mathieu Desnoyers
Hi,
This series fixes incorrect kernel header search path in kernel selftests.
Near the end of the series, a few changes are not tagged as "Fixes" because the current behavior is to rely on the kernel sources uapi files rather than on the installed kernel header files. Nevertheless, those are updated for consistency.
There are situations where "../../../../include/" was added to -I search path, which is bogus for userspace tests and caused issues with
types.h. Those are removed.
Quoted 5 lines
Thanks,
Mathieu
Mathieu Desnoyers (34):
The below patches are now applied to linux-kselftest next for Linux 6.3-rc1
Quoted 23 lines
selftests: arm64: Fix incorrect kernel headers search path
selftests: clone3: Fix incorrect kernel headers search path
selftests: core: Fix incorrect kernel headers search path
selftests: dma: Fix incorrect kernel headers search path
selftests: dmabuf-heaps: Fix incorrect kernel headers search path
selftests: drivers: Fix incorrect kernel headers search path
selftests: filesystems: Fix incorrect kernel headers search path
selftests: futex: Fix incorrect kernel headers search path
selftests: gpio: Fix incorrect kernel headers search path
selftests: ipc: Fix incorrect kernel headers search path
selftests: kcmp: Fix incorrect kernel headers search path
selftests:media_tests: Fix incorrect kernel headers search path
selftests: membarrier: Fix incorrect kernel headers search path
selftests:mount_setattr: Fix incorrect kernel headers search path
selftests:move_mount_set_group: Fix incorrect kernel headers search
path
selftests:perf_events: Fix incorrect kernel headers search path
selftests:pid_namespace: Fix incorrect kernel headers search path
selftests: pidfd: Fix incorrect kernel headers search path
selftests: ptp: Fix incorrect kernel headers search path
selftests: rseq: Fix incorrect kernel headers search path
selftests: sched: Fix incorrect kernel headers search path
selftests: seccomp: Fix incorrect kernel headers search path
Quoted 9 lines
selftests: sync: Fix incorrect kernel headers search path
selftests:user_events: Fix incorrect kernel headers search path
selftests: vm: Fix incorrect kernel headers search path
selftests: x86: Fix incorrect kernel headers search path
selftests: iommu: Use installed kernel headers search path
selftests: memfd: Use installed kernel headers search path
selftests: ptrace: Use installed kernel headers search path
selftests: tdx: Use installed kernel headers search path
These will be applied by maintainers to their trees.
Quoted 4 lines
selftests: bpf: Fix incorrect kernel headers search path # 02/34
selftests: net: Fix incorrect kernel headers search path # 17/34
selftests: powerpc: Fix incorrect kernel headers search path # 21/34
selftests: bpf docs: Use installed kernel headers search path # 30/34
thanks,
-- Shuah
Quoted 57 lines · Shuah Khan
Quoted 14 lines · Mathieu Desnoyers
Hi,
This series fixes incorrect kernel header search path in kernel selftests.
Near the end of the series, a few changes are not tagged as "Fixes" because the current behavior is to rely on the kernel sources uapi files rather than on the installed kernel header files. Nevertheless, those are updated for consistency.
There are situations where "../../../../include/" was added to -I search path, which is bogus for userspace tests and caused issues with
types.h. Those are removed.Quoted 5 lines
Thanks,
Mathieu
Mathieu Desnoyers (34):
The below patches are now applied to linux-kselftest next for Linux 6.3-rc1
Quoted 23 lines
selftests: arm64: Fix incorrect kernel headers search path
selftests: clone3: Fix incorrect kernel headers search path
selftests: core: Fix incorrect kernel headers search path
selftests: dma: Fix incorrect kernel headers search path
selftests: dmabuf-heaps: Fix incorrect kernel headers search path
selftests: drivers: Fix incorrect kernel headers search path
selftests: filesystems: Fix incorrect kernel headers search path
selftests: futex: Fix incorrect kernel headers search path
selftests: gpio: Fix incorrect kernel headers search path
selftests: ipc: Fix incorrect kernel headers search path
selftests: kcmp: Fix incorrect kernel headers search path
selftests:media_tests: Fix incorrect kernel headers search path
selftests: membarrier: Fix incorrect kernel headers search path
selftests:mount_setattr: Fix incorrect kernel headers search path
selftests:move_mount_set_group: Fix incorrect kernel headers search
path
selftests:perf_events: Fix incorrect kernel headers search path
selftests:pid_namespace: Fix incorrect kernel headers search path
selftests: pidfd: Fix incorrect kernel headers search path
selftests: ptp: Fix incorrect kernel headers search path
selftests: rseq: Fix incorrect kernel headers search path
selftests: sched: Fix incorrect kernel headers search path
selftests: seccomp: Fix incorrect kernel headers search pathQuoted 9 lines
selftests: sync: Fix incorrect kernel headers search path
selftests:user_events: Fix incorrect kernel headers search path
selftests: vm: Fix incorrect kernel headers search path
selftests: x86: Fix incorrect kernel headers search path
selftests: iommu: Use installed kernel headers search path
selftests: memfd: Use installed kernel headers search path
selftests: ptrace: Use installed kernel headers search path
selftests: tdx: Use installed kernel headers search path
Quoted 1 line
These will be applied by maintainers to their trees.
Not in this form. They break the build.
Quoted 7 lines
Quoted 4 lines
selftests: bpf: Fix incorrect kernel headers search path # 02/34
selftests: net: Fix incorrect kernel headers search path # 17/34
selftests: powerpc: Fix incorrect kernel headers search path # 21/34
selftests: bpf docs: Use installed kernel headers search path # 30/34thanks,
-- Shuah
Shuah Khan
maintainerQuoted 58 lines · Alexei Starovoitov
Quoted 57 lines · Shuah Khan
Quoted 14 lines · Mathieu Desnoyers
Hi,
This series fixes incorrect kernel header search path in kernel selftests.
Near the end of the series, a few changes are not tagged as "Fixes" because the current behavior is to rely on the kernel sources uapi files rather than on the installed kernel header files. Nevertheless, those are updated for consistency.
There are situations where "../../../../include/" was added to -I search path, which is bogus for userspace tests and caused issues with
types.h. Those are removed.Quoted 5 lines
Thanks,
Mathieu
Mathieu Desnoyers (34):
The below patches are now applied to linux-kselftest next for Linux 6.3-rc1
Quoted 32 lines
selftests: arm64: Fix incorrect kernel headers search path
selftests: clone3: Fix incorrect kernel headers search path
selftests: core: Fix incorrect kernel headers search path
selftests: dma: Fix incorrect kernel headers search path
selftests: dmabuf-heaps: Fix incorrect kernel headers search path
selftests: drivers: Fix incorrect kernel headers search path
selftests: filesystems: Fix incorrect kernel headers search path
selftests: futex: Fix incorrect kernel headers search path
selftests: gpio: Fix incorrect kernel headers search path
selftests: ipc: Fix incorrect kernel headers search path
selftests: kcmp: Fix incorrect kernel headers search path
selftests:media_tests: Fix incorrect kernel headers search path
selftests: membarrier: Fix incorrect kernel headers search path
selftests:mount_setattr: Fix incorrect kernel headers search path
selftests:move_mount_set_group: Fix incorrect kernel headers search
path
selftests:perf_events: Fix incorrect kernel headers search path
selftests:pid_namespace: Fix incorrect kernel headers search path
selftests: pidfd: Fix incorrect kernel headers search path
selftests: ptp: Fix incorrect kernel headers search path
selftests: rseq: Fix incorrect kernel headers search path
selftests: sched: Fix incorrect kernel headers search path
selftests: seccomp: Fix incorrect kernel headers search path
selftests: sync: Fix incorrect kernel headers search path
selftests:user_events: Fix incorrect kernel headers search path
selftests: vm: Fix incorrect kernel headers search path
selftests: x86: Fix incorrect kernel headers search path
selftests: iommu: Use installed kernel headers search path
selftests: memfd: Use installed kernel headers search path
selftests: ptrace: Use installed kernel headers search path
selftests: tdx: Use installed kernel headers search path
Quoted 3 lines
Quoted 1 line
These will be applied by maintainers to their trees.
Not in this form. They break the build.
Mathieu is sending you the patches in the format you requested in the thread on this patch.
thanks,
-- Shuah
Quoted 8 lines · Shuah Khan
Quoted 5 lines
Quoted 3 lines
These will be applied by maintainers to their trees.
Not in this form. They break the build.
Mathieu is sending you the patches in the format you requested in the thread on this patch.
It's not the format, but the patch itself is incorrect.
Shuah Khan
maintainerHi Mathieu,
Quoted 11 lines · Shuah Khan
Quoted 10 lines · Mathieu Desnoyers
Hi,
This series fixes incorrect kernel header search path in kernel selftests.
Near the end of the series, a few changes are not tagged as "Fixes" because the current behavior is to rely on the kernel sources uapi files rather than on the installed kernel header files. Nevertheless, those are updated for consistency.
Quoted 4 lines
Quoted 4 lines
There are situations where "../../../../include/" was added to -I search path, which is bogus for userspace tests and caused issues with
types.h. Those are removed.
Thanks again for taking care of this. I did out of tree build testing on x86 on linux-kselftest next with these patches below. I haven't seen any problems introduced by the patch set.
Quoted 1 line
Quoted 1 line
selftests: dma: Fix incorrect kernel headers search path
This one needs a change and I will send a patch on top of yours. Even with that this test depends on unexported header from the repo and won't build out of tree. This is not related to your change.
Quoted 1 line
Quoted 1 line
selftests:
mount_setattr: Fix incorrect kernel headers search path
This one fails to build with our without patch - an existing error.
I have to do cross-build tests on arm64 and other arch patches still. This will happen later this week.
Quoted 1 line
Quoted 1 line
selftests: arm64: Fix incorrect kernel headers search path
drivers patch below had arch specific tests - testing todo
The rest looks good. I will try to run bpf patches on my system. I do have clang, llvm installed on mine. TODO
thanks,
-- Shuah
Shuah Khan
maintainerQuoted 29 lines · Shuah Khan
Hi Mathieu,
Quoted 11 lines · Shuah Khan
Quoted 10 lines · Mathieu Desnoyers
Hi,
This series fixes incorrect kernel header search path in kernel selftests.
Near the end of the series, a few changes are not tagged as "Fixes" because the current behavior is to rely on the kernel sources uapi files rather than on the installed kernel header files. Nevertheless, those are updated for consistency.
Quoted 4 lines
Quoted 4 lines
There are situations where "../../../../include/" was added to -I search path, which is bogus for userspace tests and caused issues with
types.h. Those are removed.Thanks again for taking care of this. I did out of tree build testing on x86 on linux-kselftest next with these patches below. I haven't seen any problems introduced by the patch set.
Quoted 1 line
Quoted 1 line
selftests: dma: Fix incorrect kernel headers search path
This one needs a change and I will send a patch on top of yours. Even with that this test depends on unexported header from the repo and won't build out of tree. This is not related to your change.
Quoted 5 lines
Quoted 1 line
Quoted 1 line
selftests:
mount_setattr: Fix incorrect kernel headers search pathThis one fails to build with our without patch - an existing error.
I have to do cross-build tests on arm64 and other arch patches still. This will happen later this week.
arm64, s390 patches look good.
thanks,
-- Shuah
Shuah Khan
maintainerQuoted 30 lines · Shuah Khan
Quoted 29 lines · Shuah Khan
Hi Mathieu,
Quoted 11 lines · Shuah Khan
Quoted 10 lines · Mathieu Desnoyers
Hi,
This series fixes incorrect kernel header search path in kernel selftests.
Near the end of the series, a few changes are not tagged as "Fixes" because the current behavior is to rely on the kernel sources uapi files rather than on the installed kernel header files. Nevertheless, those are updated for consistency.
Quoted 4 lines
Quoted 4 lines
There are situations where "../../../../include/" was added to -I search path, which is bogus for userspace tests and caused issues with
types.h. Those are removed.Thanks again for taking care of this. I did out of tree build testing on x86 on linux-kselftest next with these patches below. I haven't seen any problems introduced by the patch set.
Quoted 1 line
Quoted 1 line
selftests: dma: Fix incorrect kernel headers search path
This one needs a change and I will send a patch on top of yours. Even with that this test depends on unexported header from the repo and won't build out of tree. This is not related to your change.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
selftests:
mount_setattr: Fix incorrect kernel headers search pathThis one fails to build with our without patch - an existing error.
I have to do cross-build tests on arm64 and other arch patches still. This will happen later this week.
arm64, s390 patches look good.
I am seeing problem with selftests/dma and selfttests/user_events.
1. selftests: dma: Fix incorrect kernel headers search path
dma test no longer builds. This test depends on linux/map_benchmark.h which is not included in uapi
The order of include directorries -isystem followed by installed kernel headers, breaks the test build with the change to use KHDR_INCLUDES
I am going to revert this patch for now and figure a longer term fix. The problem is the dependency on a non-uapi file: linux/map_benchmark.h
header file for map_benchmark definition") change added this dependency on including linux/map_benchmark.h
Christoph, Do you see this map_benchmark.h as part of uapi?
2. selftests: user_events: Fix incorrect kernel headers search path This one depends on linux/user_events.h which has bee removed from uapi in this commit:
commit 5cfff569cab8bf544bab62c911c5d6efd5af5e05
Author: Steven Rostedt (Google) <[email protected]> Date: Fri Apr 1 14:39:03 2022 -0400
tracing: Move user_events.h temporarily out of include/uapi
This isn't a regression from 6.2 - this test stopped building once user_events.h has been removed from uapi. I will add a note that this test depends on a non-uapi header and can't be built at the moment.
thanks,
-- Shuah
Michael Ellerman
AppliedRe: (subset) [PATCH 00/34] selftests: Fix incorrect kernel headers search path
In reply to Mathieu DesnoyersQuoted 9 lines · Mathieu Desnoyers
This series fixes incorrect kernel header search path in kernel selftests.
Near the end of the series, a few changes are not tagged as "Fixes" because the current behavior is to rely on the kernel sources uapi files rather than on the installed kernel header files. Nevertheless, those are updated for consistency.
[...]
Applied to powerpc/next.
[21/34] selftests: powerpc: Fix incorrect kernel headers search path
https://git.kernel.org/powerpc/c/4f11410bf6da87defe8fd59b0413f0d9f71744da
cheers