* [PATCH] linux-yocto_5.2.bb: Fix build races in kernel-selftests
@ 2019-08-29 4:53 Khem Raj
2019-08-29 5:02 ` ✗ patchtest: failure for " Patchwork
2019-08-29 12:22 ` [PATCH] " Bruce Ashfield
0 siblings, 2 replies; 4+ messages in thread
From: Khem Raj @ 2019-08-29 4:53 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
---
...x-test_verifier-test_maps-make-depen.patch | 58 +++++++++++++
...ructure-test_-progs-maps-verifier-te.patch | 86 +++++++++++++++++++
meta/recipes-kernel/linux/linux-yocto_5.2.bb | 3 +
3 files changed, 147 insertions(+)
create mode 100644 meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
create mode 100644 meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch
diff --git a/meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch b/meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
new file mode 100644
index 0000000000..e397b10cb4
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
@@ -0,0 +1,58 @@
+From 08a2303803397c98e0f279bb6fb22afc673786a3 Mon Sep 17 00:00:00 2001
+From: Andrii Nakryiko <andriin@fb.com>
+Date: Tue, 16 Jul 2019 12:38:36 -0700
+Subject: [PATCH 1/2] selftests/bpf: fix test_verifier/test_maps make
+ dependencies
+
+e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only")
+exposed existing problem in Makefile for test_verifier and test_maps tests:
+their dependency on auto-generated header file with a list of all tests wasn't
+recorded explicitly. This patch fixes these issues.
+
+Fixes: 51a0e301a563 ("bpf: Add BPF_MAP_TYPE_SK_STORAGE test to test_maps")
+Fixes: 6b7b6995c43e ("selftests: bpf: tests.h should depend on .c files, not the output")
+Cc: Ilya Leoshkevich <iii@linux.ibm.com>
+Cc: Stanislav Fomichev <sdf@google.com>
+Cc: Martin KaFai Lau <kafai@fb.com>
+Signed-off-by: Andrii Nakryiko <andriin@fb.com>
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+---
+ tools/testing/selftests/bpf/Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
+index b9e88ccc289b..cd12bf414056 100644
+--- a/tools/testing/selftests/bpf/Makefile
++++ b/tools/testing/selftests/bpf/Makefile
+@@ -77,8 +77,6 @@ all: $(TEST_CUSTOM_PROGS)
+ $(OUTPUT)/urandom_read: $(OUTPUT)/%: %.c
+ $(CC) -o $@ $< -Wl,--build-id
+
+-$(OUTPUT)/test_maps: map_tests/*.c
+-
+ BPFOBJ := $(OUTPUT)/libbpf.a
+
+ $(TEST_GEN_PROGS): $(BPFOBJ)
+@@ -242,9 +240,10 @@ MAP_TESTS_DIR = $(OUTPUT)/map_tests
+ $(MAP_TESTS_DIR):
+ mkdir -p $@
+ MAP_TESTS_H := $(MAP_TESTS_DIR)/tests.h
++MAP_TESTS_FILES := $(wildcard map_tests/*.c)
+ test_maps.c: $(MAP_TESTS_H)
+ $(OUTPUT)/test_maps: CFLAGS += $(TEST_MAPS_CFLAGS)
+-MAP_TESTS_FILES := $(wildcard map_tests/*.c)
++$(OUTPUT)/test_maps: test_maps.c $(MAP_TESTS_H) $(MAP_TESTS_FILES)
+ $(MAP_TESTS_H): $(MAP_TESTS_DIR) $(MAP_TESTS_FILES)
+ $(shell ( cd map_tests/; \
+ echo '/* Generated header, do not edit */'; \
+@@ -261,6 +260,7 @@ $(MAP_TESTS_H): $(MAP_TESTS_DIR) $(MAP_TESTS_FILES)
+ VERIFIER_TESTS_H := $(OUTPUT)/verifier/tests.h
+ test_verifier.c: $(VERIFIER_TESTS_H)
+ $(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
++$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
+
+ VERIFIER_TESTS_DIR = $(OUTPUT)/verifier
+ $(VERIFIER_TESTS_DIR):
+--
+2.23.0
+
diff --git a/meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch b/meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch
new file mode 100644
index 0000000000..36692088b0
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch
@@ -0,0 +1,86 @@
+From 2fd88b60e6255206d46baa543a637aa1e1cc6186 Mon Sep 17 00:00:00 2001
+From: Andrii Nakryiko <andriin@fb.com>
+Date: Tue, 16 Jul 2019 12:38:37 -0700
+Subject: [PATCH 2/2] selftests/bpf: structure test_{progs, maps, verifier}
+ test runners uniformly
+
+It's easier to follow the logic if it's structured the same.
+There is just slight difference between test_progs/test_maps and
+test_verifier. test_verifier's verifier/*.c files are not really compilable
+C files (they are more of include headers), so they can't be specified as
+explicit dependencies of test_verifier.
+
+Cc: Alexei Starovoitov <ast@fb.com>
+Signed-off-by: Andrii Nakryiko <andriin@fb.com>
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+---
+ tools/testing/selftests/bpf/Makefile | 24 ++++++++++--------------
+ 1 file changed, 10 insertions(+), 14 deletions(-)
+
+diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
+index cd12bf414056..b76c43eb5d4f 100644
+--- a/tools/testing/selftests/bpf/Makefile
++++ b/tools/testing/selftests/bpf/Makefile
+@@ -161,6 +161,7 @@ endif
+ endif
+
+ TEST_PROGS_CFLAGS := -I. -I$(OUTPUT)
++TEST_MAPS_CFLAGS := -I. -I$(OUTPUT)
+ TEST_VERIFIER_CFLAGS := -I. -I$(OUTPUT) -Iverifier
+
+ ifneq ($(SUBREG_CODEGEN),)
+@@ -212,16 +213,14 @@ ifeq ($(DWARF2BTF),y)
+ $(BTF_PAHOLE) -J $@
+ endif
+
+-PROG_TESTS_H := $(OUTPUT)/prog_tests/tests.h
+-test_progs.c: $(PROG_TESTS_H)
+-$(OUTPUT)/test_progs: CFLAGS += $(TEST_PROGS_CFLAGS)
+-$(OUTPUT)/test_progs: prog_tests/*.c
+-
+ PROG_TESTS_DIR = $(OUTPUT)/prog_tests
+ $(PROG_TESTS_DIR):
+ mkdir -p $@
+-
++PROG_TESTS_H := $(PROG_TESTS_DIR)/tests.h
+ PROG_TESTS_FILES := $(wildcard prog_tests/*.c)
++test_progs.c: $(PROG_TESTS_H)
++$(OUTPUT)/test_progs: CFLAGS += $(TEST_PROGS_CFLAGS)
++$(OUTPUT)/test_progs: test_progs.c $(PROG_TESTS_H) $(PROG_TESTS_FILES)
+ $(PROG_TESTS_H): $(PROG_TESTS_DIR) $(PROG_TESTS_FILES)
+ $(shell ( cd prog_tests/; \
+ echo '/* Generated header, do not edit */'; \
+@@ -235,7 +234,6 @@ $(PROG_TESTS_H): $(PROG_TESTS_DIR) $(PROG_TESTS_FILES)
+ echo '#endif' \
+ ) > $(PROG_TESTS_H))
+
+-TEST_MAPS_CFLAGS := -I. -I$(OUTPUT)
+ MAP_TESTS_DIR = $(OUTPUT)/map_tests
+ $(MAP_TESTS_DIR):
+ mkdir -p $@
+@@ -257,17 +255,15 @@ $(MAP_TESTS_H): $(MAP_TESTS_DIR) $(MAP_TESTS_FILES)
+ echo '#endif' \
+ ) > $(MAP_TESTS_H))
+
+-VERIFIER_TESTS_H := $(OUTPUT)/verifier/tests.h
+-test_verifier.c: $(VERIFIER_TESTS_H)
+-$(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
+-$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
+-
+ VERIFIER_TESTS_DIR = $(OUTPUT)/verifier
+ $(VERIFIER_TESTS_DIR):
+ mkdir -p $@
+-
++VERIFIER_TESTS_H := $(VERIFIER_TESTS_DIR)/tests.h
+ VERIFIER_TEST_FILES := $(wildcard verifier/*.c)
+-$(OUTPUT)/verifier/tests.h: $(VERIFIER_TESTS_DIR) $(VERIFIER_TEST_FILES)
++test_verifier.c: $(VERIFIER_TESTS_H)
++$(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
++$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
++$(VERIFIER_TESTS_H): $(VERIFIER_TEST_FILES) | $(VERIFIER_TESTS_DIR)
+ $(shell ( cd verifier/; \
+ echo '/* Generated header, do not edit */'; \
+ echo '#ifdef FILL_ARRAY'; \
+--
+2.23.0
+
diff --git a/meta/recipes-kernel/linux/linux-yocto_5.2.bb b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
index d873a1f2b3..b3cb51162b 100644
--- a/meta/recipes-kernel/linux/linux-yocto_5.2.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
@@ -29,6 +29,9 @@ SRCREV_meta ?= "b53e99257175fd6f41f31e5ebec46c1bd11076b8"
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.2;destsuffix=${KMETA}"
+SRC_URI += "file://0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch \
+ file://0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch \
+"
LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
LINUX_VERSION ?= "5.2.10"
--
2.23.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* ✗ patchtest: failure for linux-yocto_5.2.bb: Fix build races in kernel-selftests
2019-08-29 4:53 [PATCH] linux-yocto_5.2.bb: Fix build races in kernel-selftests Khem Raj
@ 2019-08-29 5:02 ` Patchwork
2019-08-29 12:22 ` [PATCH] " Bruce Ashfield
1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2019-08-29 5:02 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
== Series Details ==
Series: linux-yocto_5.2.bb: Fix build races in kernel-selftests
Revision: 1
URL : https://patchwork.openembedded.org/series/19553/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:
* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at 684fc36402)
* Issue Added patch file is missing Upstream-Status in the header [test_upstream_status_presence_format]
Suggested fix Add Upstream-Status: <Valid status> to the header of meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
Standard format Upstream-Status: <Valid status>
Valid status Pending, Accepted, Backport, Denied, Inappropriate [reason], Submitted [where]
If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).
---
Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] linux-yocto_5.2.bb: Fix build races in kernel-selftests
2019-08-29 4:53 [PATCH] linux-yocto_5.2.bb: Fix build races in kernel-selftests Khem Raj
2019-08-29 5:02 ` ✗ patchtest: failure for " Patchwork
@ 2019-08-29 12:22 ` Bruce Ashfield
2019-08-30 4:36 ` Bruce Ashfield
1 sibling, 1 reply; 4+ messages in thread
From: Bruce Ashfield @ 2019-08-29 12:22 UTC (permalink / raw)
To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
I'll merge this directly to the 5.2 branches, rather than patches (but
you knew I'd say that). I'll queue it and run some tests ASAP.
Bruce
On Thu, Aug 29, 2019 at 12:53 AM Khem Raj <raj.khem@gmail.com> wrote:
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
> ---
> ...x-test_verifier-test_maps-make-depen.patch | 58 +++++++++++++
> ...ructure-test_-progs-maps-verifier-te.patch | 86 +++++++++++++++++++
> meta/recipes-kernel/linux/linux-yocto_5.2.bb | 3 +
> 3 files changed, 147 insertions(+)
> create mode 100644 meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
> create mode 100644 meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch
>
> diff --git a/meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch b/meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
> new file mode 100644
> index 0000000000..e397b10cb4
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
> @@ -0,0 +1,58 @@
> +From 08a2303803397c98e0f279bb6fb22afc673786a3 Mon Sep 17 00:00:00 2001
> +From: Andrii Nakryiko <andriin@fb.com>
> +Date: Tue, 16 Jul 2019 12:38:36 -0700
> +Subject: [PATCH 1/2] selftests/bpf: fix test_verifier/test_maps make
> + dependencies
> +
> +e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only")
> +exposed existing problem in Makefile for test_verifier and test_maps tests:
> +their dependency on auto-generated header file with a list of all tests wasn't
> +recorded explicitly. This patch fixes these issues.
> +
> +Fixes: 51a0e301a563 ("bpf: Add BPF_MAP_TYPE_SK_STORAGE test to test_maps")
> +Fixes: 6b7b6995c43e ("selftests: bpf: tests.h should depend on .c files, not the output")
> +Cc: Ilya Leoshkevich <iii@linux.ibm.com>
> +Cc: Stanislav Fomichev <sdf@google.com>
> +Cc: Martin KaFai Lau <kafai@fb.com>
> +Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> +Signed-off-by: Alexei Starovoitov <ast@kernel.org>
> +---
> + tools/testing/selftests/bpf/Makefile | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> +index b9e88ccc289b..cd12bf414056 100644
> +--- a/tools/testing/selftests/bpf/Makefile
> ++++ b/tools/testing/selftests/bpf/Makefile
> +@@ -77,8 +77,6 @@ all: $(TEST_CUSTOM_PROGS)
> + $(OUTPUT)/urandom_read: $(OUTPUT)/%: %.c
> + $(CC) -o $@ $< -Wl,--build-id
> +
> +-$(OUTPUT)/test_maps: map_tests/*.c
> +-
> + BPFOBJ := $(OUTPUT)/libbpf.a
> +
> + $(TEST_GEN_PROGS): $(BPFOBJ)
> +@@ -242,9 +240,10 @@ MAP_TESTS_DIR = $(OUTPUT)/map_tests
> + $(MAP_TESTS_DIR):
> + mkdir -p $@
> + MAP_TESTS_H := $(MAP_TESTS_DIR)/tests.h
> ++MAP_TESTS_FILES := $(wildcard map_tests/*.c)
> + test_maps.c: $(MAP_TESTS_H)
> + $(OUTPUT)/test_maps: CFLAGS += $(TEST_MAPS_CFLAGS)
> +-MAP_TESTS_FILES := $(wildcard map_tests/*.c)
> ++$(OUTPUT)/test_maps: test_maps.c $(MAP_TESTS_H) $(MAP_TESTS_FILES)
> + $(MAP_TESTS_H): $(MAP_TESTS_DIR) $(MAP_TESTS_FILES)
> + $(shell ( cd map_tests/; \
> + echo '/* Generated header, do not edit */'; \
> +@@ -261,6 +260,7 @@ $(MAP_TESTS_H): $(MAP_TESTS_DIR) $(MAP_TESTS_FILES)
> + VERIFIER_TESTS_H := $(OUTPUT)/verifier/tests.h
> + test_verifier.c: $(VERIFIER_TESTS_H)
> + $(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
> ++$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
> +
> + VERIFIER_TESTS_DIR = $(OUTPUT)/verifier
> + $(VERIFIER_TESTS_DIR):
> +--
> +2.23.0
> +
> diff --git a/meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch b/meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch
> new file mode 100644
> index 0000000000..36692088b0
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch
> @@ -0,0 +1,86 @@
> +From 2fd88b60e6255206d46baa543a637aa1e1cc6186 Mon Sep 17 00:00:00 2001
> +From: Andrii Nakryiko <andriin@fb.com>
> +Date: Tue, 16 Jul 2019 12:38:37 -0700
> +Subject: [PATCH 2/2] selftests/bpf: structure test_{progs, maps, verifier}
> + test runners uniformly
> +
> +It's easier to follow the logic if it's structured the same.
> +There is just slight difference between test_progs/test_maps and
> +test_verifier. test_verifier's verifier/*.c files are not really compilable
> +C files (they are more of include headers), so they can't be specified as
> +explicit dependencies of test_verifier.
> +
> +Cc: Alexei Starovoitov <ast@fb.com>
> +Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> +Signed-off-by: Alexei Starovoitov <ast@kernel.org>
> +---
> + tools/testing/selftests/bpf/Makefile | 24 ++++++++++--------------
> + 1 file changed, 10 insertions(+), 14 deletions(-)
> +
> +diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> +index cd12bf414056..b76c43eb5d4f 100644
> +--- a/tools/testing/selftests/bpf/Makefile
> ++++ b/tools/testing/selftests/bpf/Makefile
> +@@ -161,6 +161,7 @@ endif
> + endif
> +
> + TEST_PROGS_CFLAGS := -I. -I$(OUTPUT)
> ++TEST_MAPS_CFLAGS := -I. -I$(OUTPUT)
> + TEST_VERIFIER_CFLAGS := -I. -I$(OUTPUT) -Iverifier
> +
> + ifneq ($(SUBREG_CODEGEN),)
> +@@ -212,16 +213,14 @@ ifeq ($(DWARF2BTF),y)
> + $(BTF_PAHOLE) -J $@
> + endif
> +
> +-PROG_TESTS_H := $(OUTPUT)/prog_tests/tests.h
> +-test_progs.c: $(PROG_TESTS_H)
> +-$(OUTPUT)/test_progs: CFLAGS += $(TEST_PROGS_CFLAGS)
> +-$(OUTPUT)/test_progs: prog_tests/*.c
> +-
> + PROG_TESTS_DIR = $(OUTPUT)/prog_tests
> + $(PROG_TESTS_DIR):
> + mkdir -p $@
> +-
> ++PROG_TESTS_H := $(PROG_TESTS_DIR)/tests.h
> + PROG_TESTS_FILES := $(wildcard prog_tests/*.c)
> ++test_progs.c: $(PROG_TESTS_H)
> ++$(OUTPUT)/test_progs: CFLAGS += $(TEST_PROGS_CFLAGS)
> ++$(OUTPUT)/test_progs: test_progs.c $(PROG_TESTS_H) $(PROG_TESTS_FILES)
> + $(PROG_TESTS_H): $(PROG_TESTS_DIR) $(PROG_TESTS_FILES)
> + $(shell ( cd prog_tests/; \
> + echo '/* Generated header, do not edit */'; \
> +@@ -235,7 +234,6 @@ $(PROG_TESTS_H): $(PROG_TESTS_DIR) $(PROG_TESTS_FILES)
> + echo '#endif' \
> + ) > $(PROG_TESTS_H))
> +
> +-TEST_MAPS_CFLAGS := -I. -I$(OUTPUT)
> + MAP_TESTS_DIR = $(OUTPUT)/map_tests
> + $(MAP_TESTS_DIR):
> + mkdir -p $@
> +@@ -257,17 +255,15 @@ $(MAP_TESTS_H): $(MAP_TESTS_DIR) $(MAP_TESTS_FILES)
> + echo '#endif' \
> + ) > $(MAP_TESTS_H))
> +
> +-VERIFIER_TESTS_H := $(OUTPUT)/verifier/tests.h
> +-test_verifier.c: $(VERIFIER_TESTS_H)
> +-$(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
> +-$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
> +-
> + VERIFIER_TESTS_DIR = $(OUTPUT)/verifier
> + $(VERIFIER_TESTS_DIR):
> + mkdir -p $@
> +-
> ++VERIFIER_TESTS_H := $(VERIFIER_TESTS_DIR)/tests.h
> + VERIFIER_TEST_FILES := $(wildcard verifier/*.c)
> +-$(OUTPUT)/verifier/tests.h: $(VERIFIER_TESTS_DIR) $(VERIFIER_TEST_FILES)
> ++test_verifier.c: $(VERIFIER_TESTS_H)
> ++$(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
> ++$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
> ++$(VERIFIER_TESTS_H): $(VERIFIER_TEST_FILES) | $(VERIFIER_TESTS_DIR)
> + $(shell ( cd verifier/; \
> + echo '/* Generated header, do not edit */'; \
> + echo '#ifdef FILL_ARRAY'; \
> +--
> +2.23.0
> +
> diff --git a/meta/recipes-kernel/linux/linux-yocto_5.2.bb b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> index d873a1f2b3..b3cb51162b 100644
> --- a/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> @@ -29,6 +29,9 @@ SRCREV_meta ?= "b53e99257175fd6f41f31e5ebec46c1bd11076b8"
> SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
> git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.2;destsuffix=${KMETA}"
>
> +SRC_URI += "file://0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch \
> + file://0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch \
> +"
> LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
> LINUX_VERSION ?= "5.2.10"
>
> --
> 2.23.0
>
--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] linux-yocto_5.2.bb: Fix build races in kernel-selftests
2019-08-29 12:22 ` [PATCH] " Bruce Ashfield
@ 2019-08-30 4:36 ` Bruce Ashfield
0 siblings, 0 replies; 4+ messages in thread
From: Bruce Ashfield @ 2019-08-30 4:36 UTC (permalink / raw)
To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
I have these staged and they will be part of my next version of the 5.2 recipes.
Bruce
On Thu, Aug 29, 2019 at 8:22 AM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
>
> I'll merge this directly to the 5.2 branches, rather than patches (but
> you knew I'd say that). I'll queue it and run some tests ASAP.
>
> Bruce
>
> On Thu, Aug 29, 2019 at 12:53 AM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
> > ---
> > ...x-test_verifier-test_maps-make-depen.patch | 58 +++++++++++++
> > ...ructure-test_-progs-maps-verifier-te.patch | 86 +++++++++++++++++++
> > meta/recipes-kernel/linux/linux-yocto_5.2.bb | 3 +
> > 3 files changed, 147 insertions(+)
> > create mode 100644 meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
> > create mode 100644 meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch
> >
> > diff --git a/meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch b/meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
> > new file mode 100644
> > index 0000000000..e397b10cb4
> > --- /dev/null
> > +++ b/meta/recipes-kernel/linux/files/0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch
> > @@ -0,0 +1,58 @@
> > +From 08a2303803397c98e0f279bb6fb22afc673786a3 Mon Sep 17 00:00:00 2001
> > +From: Andrii Nakryiko <andriin@fb.com>
> > +Date: Tue, 16 Jul 2019 12:38:36 -0700
> > +Subject: [PATCH 1/2] selftests/bpf: fix test_verifier/test_maps make
> > + dependencies
> > +
> > +e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only")
> > +exposed existing problem in Makefile for test_verifier and test_maps tests:
> > +their dependency on auto-generated header file with a list of all tests wasn't
> > +recorded explicitly. This patch fixes these issues.
> > +
> > +Fixes: 51a0e301a563 ("bpf: Add BPF_MAP_TYPE_SK_STORAGE test to test_maps")
> > +Fixes: 6b7b6995c43e ("selftests: bpf: tests.h should depend on .c files, not the output")
> > +Cc: Ilya Leoshkevich <iii@linux.ibm.com>
> > +Cc: Stanislav Fomichev <sdf@google.com>
> > +Cc: Martin KaFai Lau <kafai@fb.com>
> > +Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> > +Signed-off-by: Alexei Starovoitov <ast@kernel.org>
> > +---
> > + tools/testing/selftests/bpf/Makefile | 6 +++---
> > + 1 file changed, 3 insertions(+), 3 deletions(-)
> > +
> > +diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> > +index b9e88ccc289b..cd12bf414056 100644
> > +--- a/tools/testing/selftests/bpf/Makefile
> > ++++ b/tools/testing/selftests/bpf/Makefile
> > +@@ -77,8 +77,6 @@ all: $(TEST_CUSTOM_PROGS)
> > + $(OUTPUT)/urandom_read: $(OUTPUT)/%: %.c
> > + $(CC) -o $@ $< -Wl,--build-id
> > +
> > +-$(OUTPUT)/test_maps: map_tests/*.c
> > +-
> > + BPFOBJ := $(OUTPUT)/libbpf.a
> > +
> > + $(TEST_GEN_PROGS): $(BPFOBJ)
> > +@@ -242,9 +240,10 @@ MAP_TESTS_DIR = $(OUTPUT)/map_tests
> > + $(MAP_TESTS_DIR):
> > + mkdir -p $@
> > + MAP_TESTS_H := $(MAP_TESTS_DIR)/tests.h
> > ++MAP_TESTS_FILES := $(wildcard map_tests/*.c)
> > + test_maps.c: $(MAP_TESTS_H)
> > + $(OUTPUT)/test_maps: CFLAGS += $(TEST_MAPS_CFLAGS)
> > +-MAP_TESTS_FILES := $(wildcard map_tests/*.c)
> > ++$(OUTPUT)/test_maps: test_maps.c $(MAP_TESTS_H) $(MAP_TESTS_FILES)
> > + $(MAP_TESTS_H): $(MAP_TESTS_DIR) $(MAP_TESTS_FILES)
> > + $(shell ( cd map_tests/; \
> > + echo '/* Generated header, do not edit */'; \
> > +@@ -261,6 +260,7 @@ $(MAP_TESTS_H): $(MAP_TESTS_DIR) $(MAP_TESTS_FILES)
> > + VERIFIER_TESTS_H := $(OUTPUT)/verifier/tests.h
> > + test_verifier.c: $(VERIFIER_TESTS_H)
> > + $(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
> > ++$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
> > +
> > + VERIFIER_TESTS_DIR = $(OUTPUT)/verifier
> > + $(VERIFIER_TESTS_DIR):
> > +--
> > +2.23.0
> > +
> > diff --git a/meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch b/meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch
> > new file mode 100644
> > index 0000000000..36692088b0
> > --- /dev/null
> > +++ b/meta/recipes-kernel/linux/files/0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch
> > @@ -0,0 +1,86 @@
> > +From 2fd88b60e6255206d46baa543a637aa1e1cc6186 Mon Sep 17 00:00:00 2001
> > +From: Andrii Nakryiko <andriin@fb.com>
> > +Date: Tue, 16 Jul 2019 12:38:37 -0700
> > +Subject: [PATCH 2/2] selftests/bpf: structure test_{progs, maps, verifier}
> > + test runners uniformly
> > +
> > +It's easier to follow the logic if it's structured the same.
> > +There is just slight difference between test_progs/test_maps and
> > +test_verifier. test_verifier's verifier/*.c files are not really compilable
> > +C files (they are more of include headers), so they can't be specified as
> > +explicit dependencies of test_verifier.
> > +
> > +Cc: Alexei Starovoitov <ast@fb.com>
> > +Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> > +Signed-off-by: Alexei Starovoitov <ast@kernel.org>
> > +---
> > + tools/testing/selftests/bpf/Makefile | 24 ++++++++++--------------
> > + 1 file changed, 10 insertions(+), 14 deletions(-)
> > +
> > +diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> > +index cd12bf414056..b76c43eb5d4f 100644
> > +--- a/tools/testing/selftests/bpf/Makefile
> > ++++ b/tools/testing/selftests/bpf/Makefile
> > +@@ -161,6 +161,7 @@ endif
> > + endif
> > +
> > + TEST_PROGS_CFLAGS := -I. -I$(OUTPUT)
> > ++TEST_MAPS_CFLAGS := -I. -I$(OUTPUT)
> > + TEST_VERIFIER_CFLAGS := -I. -I$(OUTPUT) -Iverifier
> > +
> > + ifneq ($(SUBREG_CODEGEN),)
> > +@@ -212,16 +213,14 @@ ifeq ($(DWARF2BTF),y)
> > + $(BTF_PAHOLE) -J $@
> > + endif
> > +
> > +-PROG_TESTS_H := $(OUTPUT)/prog_tests/tests.h
> > +-test_progs.c: $(PROG_TESTS_H)
> > +-$(OUTPUT)/test_progs: CFLAGS += $(TEST_PROGS_CFLAGS)
> > +-$(OUTPUT)/test_progs: prog_tests/*.c
> > +-
> > + PROG_TESTS_DIR = $(OUTPUT)/prog_tests
> > + $(PROG_TESTS_DIR):
> > + mkdir -p $@
> > +-
> > ++PROG_TESTS_H := $(PROG_TESTS_DIR)/tests.h
> > + PROG_TESTS_FILES := $(wildcard prog_tests/*.c)
> > ++test_progs.c: $(PROG_TESTS_H)
> > ++$(OUTPUT)/test_progs: CFLAGS += $(TEST_PROGS_CFLAGS)
> > ++$(OUTPUT)/test_progs: test_progs.c $(PROG_TESTS_H) $(PROG_TESTS_FILES)
> > + $(PROG_TESTS_H): $(PROG_TESTS_DIR) $(PROG_TESTS_FILES)
> > + $(shell ( cd prog_tests/; \
> > + echo '/* Generated header, do not edit */'; \
> > +@@ -235,7 +234,6 @@ $(PROG_TESTS_H): $(PROG_TESTS_DIR) $(PROG_TESTS_FILES)
> > + echo '#endif' \
> > + ) > $(PROG_TESTS_H))
> > +
> > +-TEST_MAPS_CFLAGS := -I. -I$(OUTPUT)
> > + MAP_TESTS_DIR = $(OUTPUT)/map_tests
> > + $(MAP_TESTS_DIR):
> > + mkdir -p $@
> > +@@ -257,17 +255,15 @@ $(MAP_TESTS_H): $(MAP_TESTS_DIR) $(MAP_TESTS_FILES)
> > + echo '#endif' \
> > + ) > $(MAP_TESTS_H))
> > +
> > +-VERIFIER_TESTS_H := $(OUTPUT)/verifier/tests.h
> > +-test_verifier.c: $(VERIFIER_TESTS_H)
> > +-$(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
> > +-$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
> > +-
> > + VERIFIER_TESTS_DIR = $(OUTPUT)/verifier
> > + $(VERIFIER_TESTS_DIR):
> > + mkdir -p $@
> > +-
> > ++VERIFIER_TESTS_H := $(VERIFIER_TESTS_DIR)/tests.h
> > + VERIFIER_TEST_FILES := $(wildcard verifier/*.c)
> > +-$(OUTPUT)/verifier/tests.h: $(VERIFIER_TESTS_DIR) $(VERIFIER_TEST_FILES)
> > ++test_verifier.c: $(VERIFIER_TESTS_H)
> > ++$(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
> > ++$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
> > ++$(VERIFIER_TESTS_H): $(VERIFIER_TEST_FILES) | $(VERIFIER_TESTS_DIR)
> > + $(shell ( cd verifier/; \
> > + echo '/* Generated header, do not edit */'; \
> > + echo '#ifdef FILL_ARRAY'; \
> > +--
> > +2.23.0
> > +
> > diff --git a/meta/recipes-kernel/linux/linux-yocto_5.2.bb b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> > index d873a1f2b3..b3cb51162b 100644
> > --- a/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> > +++ b/meta/recipes-kernel/linux/linux-yocto_5.2.bb
> > @@ -29,6 +29,9 @@ SRCREV_meta ?= "b53e99257175fd6f41f31e5ebec46c1bd11076b8"
> > SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
> > git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.2;destsuffix=${KMETA}"
> >
> > +SRC_URI += "file://0001-selftests-bpf-fix-test_verifier-test_maps-make-depen.patch \
> > + file://0002-selftests-bpf-structure-test_-progs-maps-verifier-te.patch \
> > +"
> > LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
> > LINUX_VERSION ?= "5.2.10"
> >
> > --
> > 2.23.0
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-08-30 4:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-29 4:53 [PATCH] linux-yocto_5.2.bb: Fix build races in kernel-selftests Khem Raj
2019-08-29 5:02 ` ✗ patchtest: failure for " Patchwork
2019-08-29 12:22 ` [PATCH] " Bruce Ashfield
2019-08-30 4:36 ` Bruce Ashfield
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.