* [PATCH 0/4] Kselftest integration into Kernel CI - Part 1
@ 2020-03-04 22:13 Shuah Khan
2020-03-04 22:13 ` [PATCH 2/4] selftests: Fix seccomp to support relocatable build (O=objdir) Shuah Khan
2020-03-04 23:09 ` [PATCH 0/4] Kselftest integration into Kernel CI - Part 1 Shuah Khan
0 siblings, 2 replies; 7+ messages in thread
From: Shuah Khan @ 2020-03-04 22:13 UTC (permalink / raw)
To: shuah, keescook, luto, wad, daniel, kafai, yhs, andriin, gregkh, tglx
Cc: Shuah Khan, khilman, mpe, linux-kselftest, linux-kernel, netdev, bpf
This patch series consists of first round of fixes to integrate
Kselftest into Kernel CI.
You can find full list of problems in my announcement I sent out
last week:
https://lkml.org/lkml/2020/2/27/2221
These fixes to android and seccomp tests address relocatable support.
However, they will still leave the source directory dirty.
android test does headers_install in source directory. This is an easier
problem to fix. seccomp on the other hand builds fixdep scripts under
scripts/basic and installs headers in the source directory. It is linked
to solving bpf relocatable build issue which I haven't given it a lot of
thought for now.
There is no dependency on source directory for run-time which is what
we want.
I will apply these kernelci topic branch for testing
git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git
Shuah Khan (4):
selftests: Fix kselftest O=objdir build from cluttering top level
objdir
selftests: Fix seccomp to support relocatable build (O=objdir)
selftests: android: ion: Fix ionmap_test compile error
selftests: android: Fix custom install from skipping test progs
tools/testing/selftests/Makefile | 4 ++--
tools/testing/selftests/android/Makefile | 2 +-
tools/testing/selftests/android/ion/Makefile | 2 +-
tools/testing/selftests/seccomp/Makefile | 16 +++-------------
4 files changed, 7 insertions(+), 17 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/4] selftests: Fix seccomp to support relocatable build (O=objdir)
2020-03-04 22:13 [PATCH 0/4] Kselftest integration into Kernel CI - Part 1 Shuah Khan
@ 2020-03-04 22:13 ` Shuah Khan
2020-03-04 22:42 ` Kees Cook
2020-03-04 23:09 ` [PATCH 0/4] Kselftest integration into Kernel CI - Part 1 Shuah Khan
1 sibling, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2020-03-04 22:13 UTC (permalink / raw)
To: shuah, keescook, luto, wad, daniel, kafai, yhs, andriin, gregkh, tglx
Cc: Shuah Khan, khilman, mpe, linux-kselftest, linux-kernel, netdev, bpf
Fix seccomp relocatable builds. This is a simple fix to use the
right lib.mk variable TEST_GEN_PROGS for objects to leverage
lib.mk common framework for relocatable builds.
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
tools/testing/selftests/seccomp/Makefile | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
index 1760b3e39730..a8a9717fc1be 100644
--- a/tools/testing/selftests/seccomp/Makefile
+++ b/tools/testing/selftests/seccomp/Makefile
@@ -1,17 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
-all:
-
-include ../lib.mk
-
-.PHONY: all clean
-
-BINARIES := seccomp_bpf seccomp_benchmark
CFLAGS += -Wl,-no-as-needed -Wall
+LDFLAGS += -lpthread
-seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h
- $(CC) $(CFLAGS) $(LDFLAGS) $< -lpthread -o $@
-
-TEST_PROGS += $(BINARIES)
-EXTRA_CLEAN := $(BINARIES)
+TEST_GEN_PROGS := seccomp_bpf seccomp_benchmark
-all: $(BINARIES)
+include ../lib.mk
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] selftests: Fix seccomp to support relocatable build (O=objdir)
2020-03-04 22:13 ` [PATCH 2/4] selftests: Fix seccomp to support relocatable build (O=objdir) Shuah Khan
@ 2020-03-04 22:42 ` Kees Cook
2020-03-04 23:15 ` Shuah Khan
0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2020-03-04 22:42 UTC (permalink / raw)
To: Shuah Khan
Cc: shuah, luto, wad, daniel, kafai, yhs, andriin, gregkh, tglx,
khilman, mpe, linux-kselftest, linux-kernel, netdev, bpf
On Wed, Mar 04, 2020 at 03:13:33PM -0700, Shuah Khan wrote:
> Fix seccomp relocatable builds. This is a simple fix to use the
> right lib.mk variable TEST_GEN_PROGS for objects to leverage
> lib.mk common framework for relocatable builds.
>
> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
> ---
> tools/testing/selftests/seccomp/Makefile | 16 +++-------------
> 1 file changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
> index 1760b3e39730..a8a9717fc1be 100644
> --- a/tools/testing/selftests/seccomp/Makefile
> +++ b/tools/testing/selftests/seccomp/Makefile
> @@ -1,17 +1,7 @@
> # SPDX-License-Identifier: GPL-2.0
> -all:
> -
> -include ../lib.mk
> -
> -.PHONY: all clean
> -
> -BINARIES := seccomp_bpf seccomp_benchmark
> CFLAGS += -Wl,-no-as-needed -Wall
> +LDFLAGS += -lpthread
>
> -seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h
How is the ../kselftest_harness.h dependency detected in the resulting
build rules?
Otherwise, looks good.
-Kees
> - $(CC) $(CFLAGS) $(LDFLAGS) $< -lpthread -o $@
> -
> -TEST_PROGS += $(BINARIES)
> -EXTRA_CLEAN := $(BINARIES)
> +TEST_GEN_PROGS := seccomp_bpf seccomp_benchmark
>
> -all: $(BINARIES)
> +include ../lib.mk
> --
> 2.20.1
>
--
Kees Cook
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] Kselftest integration into Kernel CI - Part 1
2020-03-04 22:13 [PATCH 0/4] Kselftest integration into Kernel CI - Part 1 Shuah Khan
2020-03-04 22:13 ` [PATCH 2/4] selftests: Fix seccomp to support relocatable build (O=objdir) Shuah Khan
@ 2020-03-04 23:09 ` Shuah Khan
1 sibling, 0 replies; 7+ messages in thread
From: Shuah Khan @ 2020-03-04 23:09 UTC (permalink / raw)
To: shuah, keescook, luto, wad, daniel, kafai, yhs, andriin, gregkh, tglx
Cc: khilman, mpe, linux-kselftest, linux-kernel, netdev, bpf,
skh >> Shuah Khan
On 3/4/20 3:13 PM, Shuah Khan wrote:
> This patch series consists of first round of fixes to integrate
> Kselftest into Kernel CI.
>
> You can find full list of problems in my announcement I sent out
> last week:
>
> https://lkml.org/lkml/2020/2/27/2221
Here is the lore link:
https://lore.kernel.org/lkml/3b3dc707-7ae7-955b-69fe-b9abe9ae26c5@linuxfoundation.org/
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] selftests: Fix seccomp to support relocatable build (O=objdir)
2020-03-04 22:42 ` Kees Cook
@ 2020-03-04 23:15 ` Shuah Khan
2020-03-05 0:22 ` Michael Ellerman
0 siblings, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2020-03-04 23:15 UTC (permalink / raw)
To: Kees Cook
Cc: shuah, luto, wad, daniel, kafai, yhs, andriin, gregkh, tglx,
khilman, mpe, linux-kselftest, linux-kernel, netdev, bpf,
Shuah Khan
On 3/4/20 3:42 PM, Kees Cook wrote:
> On Wed, Mar 04, 2020 at 03:13:33PM -0700, Shuah Khan wrote:
>> Fix seccomp relocatable builds. This is a simple fix to use the
>> right lib.mk variable TEST_GEN_PROGS for objects to leverage
>> lib.mk common framework for relocatable builds.
>>
>> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
>> ---
>> tools/testing/selftests/seccomp/Makefile | 16 +++-------------
>> 1 file changed, 3 insertions(+), 13 deletions(-)
>>
>> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
>> index 1760b3e39730..a8a9717fc1be 100644
>> --- a/tools/testing/selftests/seccomp/Makefile
>> +++ b/tools/testing/selftests/seccomp/Makefile
>> @@ -1,17 +1,7 @@
>> # SPDX-License-Identifier: GPL-2.0
>> -all:
>> -
>> -include ../lib.mk
>> -
>> -.PHONY: all clean
>> -
>> -BINARIES := seccomp_bpf seccomp_benchmark
>> CFLAGS += -Wl,-no-as-needed -Wall
>> +LDFLAGS += -lpthread
>>
>> -seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h
>
> How is the ../kselftest_harness.h dependency detected in the resulting
> build rules?
>
> Otherwise, looks good.
Didn't see any problems. I will look into adding the dependency.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] selftests: Fix seccomp to support relocatable build (O=objdir)
2020-03-04 23:15 ` Shuah Khan
@ 2020-03-05 0:22 ` Michael Ellerman
2020-03-05 0:29 ` Shuah Khan
0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2020-03-05 0:22 UTC (permalink / raw)
To: Shuah Khan, Kees Cook
Cc: shuah, luto, wad, daniel, kafai, yhs, andriin, gregkh, tglx,
khilman, linux-kselftest, linux-kernel, netdev, bpf, Shuah Khan
Shuah Khan <skhan@linuxfoundation.org> writes:
> On 3/4/20 3:42 PM, Kees Cook wrote:
>> On Wed, Mar 04, 2020 at 03:13:33PM -0700, Shuah Khan wrote:
>>> Fix seccomp relocatable builds. This is a simple fix to use the
>>> right lib.mk variable TEST_GEN_PROGS for objects to leverage
>>> lib.mk common framework for relocatable builds.
>>>
>>> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
>>> ---
>>> tools/testing/selftests/seccomp/Makefile | 16 +++-------------
>>> 1 file changed, 3 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
>>> index 1760b3e39730..a8a9717fc1be 100644
>>> --- a/tools/testing/selftests/seccomp/Makefile
>>> +++ b/tools/testing/selftests/seccomp/Makefile
>>> @@ -1,17 +1,7 @@
>>> # SPDX-License-Identifier: GPL-2.0
>>> -all:
>>> -
>>> -include ../lib.mk
>>> -
>>> -.PHONY: all clean
>>> -
>>> -BINARIES := seccomp_bpf seccomp_benchmark
>>> CFLAGS += -Wl,-no-as-needed -Wall
>>> +LDFLAGS += -lpthread
>>>
>>> -seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h
>>
>> How is the ../kselftest_harness.h dependency detected in the resulting
>> build rules?
>>
>> Otherwise, looks good.
>
> Didn't see any problems. I will look into adding the dependency.
Before:
$ make --no-print-directory -C tools/testing/selftests/ TARGETS=seccomp
make --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
ARCH=powerpc -C ../../.. headers_install
INSTALL /home/michael/build/adhoc/kselftest/usr/include
gcc -Wl,-no-as-needed -Wall seccomp_bpf.c -lpthread -o seccomp_bpf
gcc -Wl,-no-as-needed -Wall seccomp_benchmark.c -o seccomp_benchmark
$ touch tools/testing/selftests/kselftest_harness.h
$ make --no-print-directory -C tools/testing/selftests/ TARGETS=seccomp
make --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
ARCH=powerpc -C ../../.. headers_install
INSTALL /home/michael/build/adhoc/kselftest/usr/include
gcc -Wl,-no-as-needed -Wall seccomp_bpf.c -lpthread -o seccomp_bpf
$
Note that touching the header causes it to rebuild seccomp_bpf.
With this patch applied:
$ make --no-print-directory -C tools/testing/selftests/ TARGETS=seccomp
make -s --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
ARCH=powerpc -C ../../.. headers_install
gcc -Wl,-no-as-needed -Wall -lpthread seccomp_bpf.c -o /home/michael/build/adhoc/kselftest/seccomp/seccomp_bpf
gcc -Wl,-no-as-needed -Wall -lpthread seccomp_benchmark.c -o /home/michael/build/adhoc/kselftest/seccomp/seccomp_benchmark
$ touch tools/testing/selftests/kselftest_harness.h
$ make --no-print-directory -C tools/testing/selftests/ TARGETS=seccomp
make -s --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
ARCH=powerpc -C ../../.. headers_install
make[1]: Nothing to be done for 'all'.
$
So yeah it still needs:
seccomp_bpf: ../kselftest_harness.h
cheers
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] selftests: Fix seccomp to support relocatable build (O=objdir)
2020-03-05 0:22 ` Michael Ellerman
@ 2020-03-05 0:29 ` Shuah Khan
0 siblings, 0 replies; 7+ messages in thread
From: Shuah Khan @ 2020-03-05 0:29 UTC (permalink / raw)
To: Michael Ellerman, Kees Cook
Cc: shuah, luto, wad, daniel, kafai, yhs, andriin, gregkh, tglx,
khilman, linux-kselftest, linux-kernel, netdev, bpf, Shuah Khan
On 3/4/20 5:22 PM, Michael Ellerman wrote:
> Shuah Khan <skhan@linuxfoundation.org> writes:
>> On 3/4/20 3:42 PM, Kees Cook wrote:
>>> On Wed, Mar 04, 2020 at 03:13:33PM -0700, Shuah Khan wrote:
>>>> Fix seccomp relocatable builds. This is a simple fix to use the
>>>> right lib.mk variable TEST_GEN_PROGS for objects to leverage
>>>> lib.mk common framework for relocatable builds.
>>>>
>>>> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
>>>> ---
>>>> tools/testing/selftests/seccomp/Makefile | 16 +++-------------
>>>> 1 file changed, 3 insertions(+), 13 deletions(-)
>>>>
>>>> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
>>>> index 1760b3e39730..a8a9717fc1be 100644
>>>> --- a/tools/testing/selftests/seccomp/Makefile
>>>> +++ b/tools/testing/selftests/seccomp/Makefile
>>>> @@ -1,17 +1,7 @@
>>>> # SPDX-License-Identifier: GPL-2.0
>>>> -all:
>>>> -
>>>> -include ../lib.mk
>>>> -
>>>> -.PHONY: all clean
>>>> -
>>>> -BINARIES := seccomp_bpf seccomp_benchmark
>>>> CFLAGS += -Wl,-no-as-needed -Wall
>>>> +LDFLAGS += -lpthread
>>>>
>>>> -seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h
>>>
>>> How is the ../kselftest_harness.h dependency detected in the resulting
>>> build rules?
>>>
>>> Otherwise, looks good.
>>
>> Didn't see any problems. I will look into adding the dependency.
>
> Before:
>
> $ make --no-print-directory -C tools/testing/selftests/ TARGETS=seccomp
> make --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
> ARCH=powerpc -C ../../.. headers_install
> INSTALL /home/michael/build/adhoc/kselftest/usr/include
> gcc -Wl,-no-as-needed -Wall seccomp_bpf.c -lpthread -o seccomp_bpf
> gcc -Wl,-no-as-needed -Wall seccomp_benchmark.c -o seccomp_benchmark
>
> $ touch tools/testing/selftests/kselftest_harness.h
>
> $ make --no-print-directory -C tools/testing/selftests/ TARGETS=seccomp
> make --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
> ARCH=powerpc -C ../../.. headers_install
> INSTALL /home/michael/build/adhoc/kselftest/usr/include
> gcc -Wl,-no-as-needed -Wall seccomp_bpf.c -lpthread -o seccomp_bpf
> $
>
> Note that touching the header causes it to rebuild seccomp_bpf.
>
> With this patch applied:
>
> $ make --no-print-directory -C tools/testing/selftests/ TARGETS=seccomp
> make -s --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
> ARCH=powerpc -C ../../.. headers_install
> gcc -Wl,-no-as-needed -Wall -lpthread seccomp_bpf.c -o /home/michael/build/adhoc/kselftest/seccomp/seccomp_bpf
> gcc -Wl,-no-as-needed -Wall -lpthread seccomp_benchmark.c -o /home/michael/build/adhoc/kselftest/seccomp/seccomp_benchmark
>
> $ touch tools/testing/selftests/kselftest_harness.h
>
> $ make --no-print-directory -C tools/testing/selftests/ TARGETS=seccomp
> make -s --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
> ARCH=powerpc -C ../../.. headers_install
> make[1]: Nothing to be done for 'all'.
> $
>
>
Thanks. I realized I overlooked header dependency case.
> So yeah it still needs:
>
> seccomp_bpf: ../kselftest_harness.h
>
>
Yes v2 coming up. It also has to handle OUTPUT relocation.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-03-05 0:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04 22:13 [PATCH 0/4] Kselftest integration into Kernel CI - Part 1 Shuah Khan
2020-03-04 22:13 ` [PATCH 2/4] selftests: Fix seccomp to support relocatable build (O=objdir) Shuah Khan
2020-03-04 22:42 ` Kees Cook
2020-03-04 23:15 ` Shuah Khan
2020-03-05 0:22 ` Michael Ellerman
2020-03-05 0:29 ` Shuah Khan
2020-03-04 23:09 ` [PATCH 0/4] Kselftest integration into Kernel CI - Part 1 Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).