lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241004190013.GB56767@maniforge>
Date: Fri, 4 Oct 2024 14:00:13 -0500
From: David Vernet <void@...ifault.com>
To: Björn Töpel <bjorn@...nel.org>
Cc: Tejun Heo <tj@...nel.org>, Shuah Khan <shuah@...nel.org>,
	linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
	Björn Töpel <bjorn@...osinc.com>,
	bpf@...r.kernel.org, linux-riscv@...ts.infradead.org,
	Anders Roxell <anders.roxell@...aro.org>
Subject: Re: [PATCH] selftests: sched_ext: Add sched_ext as proper selftest
 target

On Fri, Oct 04, 2024 at 11:42:46AM +0200, Björn Töpel wrote:
> From: Björn Töpel <bjorn@...osinc.com>

Thanks a lot Björn for working on this.

> The sched_ext selftests is missing proper cross-compilation support, a
> proper target entry, and out-of-tree build support.
> 
> When building the kselftest suite, e.g.:
> 
>   make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \
>     SKIP_TARGETS="" O=/output/foo -C tools/testing/selftests install
> 
> The expectation is that the sched_ext is included, cross-built, and
> placed into /output/foo.
> 
> Add CROSS_COMPILE, OUTPUT, and TARGETS support to the sched_ext
> selftest.
> 
> Signed-off-by: Björn Töpel <bjorn@...osinc.com>
> ---
>  tools/testing/selftests/Makefile           |  1 +
>  tools/testing/selftests/sched_ext/Makefile | 59 +++++++++++++++-------
>  2 files changed, 41 insertions(+), 19 deletions(-)
> 
> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
> index b38199965f99..20ee8a0b795c 100644
> --- a/tools/testing/selftests/Makefile
> +++ b/tools/testing/selftests/Makefile
> @@ -88,6 +88,7 @@ TARGETS += rlimits
>  TARGETS += rseq
>  TARGETS += rtc
>  TARGETS += rust
> +TARGETS += sched_ext
>  TARGETS += seccomp
>  TARGETS += sgx
>  TARGETS += sigaltstack
> diff --git a/tools/testing/selftests/sched_ext/Makefile b/tools/testing/selftests/sched_ext/Makefile
> index 0754a2c110a1..66467a99184d 100644
> --- a/tools/testing/selftests/sched_ext/Makefile
> +++ b/tools/testing/selftests/sched_ext/Makefile
> @@ -13,14 +13,8 @@ LLVM_SUFFIX := $(LLVM)
>  endif
>  
>  CC := $(LLVM_PREFIX)clang$(LLVM_SUFFIX) $(CLANG_FLAGS) -fintegrated-as
> -else
> -CC := gcc

Given that we're including ../lib.mk, can we just get rid of this whole block?

>  endif # LLVM
>  
> -ifneq ($(CROSS_COMPILE),)
> -$(error CROSS_COMPILE not supported for scx selftests)
> -endif # CROSS_COMPILE
> -
>  CURDIR := $(abspath .)
>  REPOROOT := $(abspath ../../../..)
>  TOOLSDIR := $(REPOROOT)/tools
> @@ -34,18 +28,39 @@ GENHDR := $(GENDIR)/autoconf.h
>  SCXTOOLSDIR := $(TOOLSDIR)/sched_ext
>  SCXTOOLSINCDIR := $(TOOLSDIR)/sched_ext/include
>  
> -OUTPUT_DIR := $(CURDIR)/build
> +ifeq (,$(OUTPUT))
> +OUTPUT := $(CURDIR)/build
> +RUNNER_DIR := $(CURDIR)
> +else
> +OUTPUT_DIR := $(OUTPUT)

This breaks if you use make from the selftests/sched_ext directory.  AFAICT it
looks like OUTPUT is always set in ../lib.mk, so we always go to the OUTPUT_DIR
:= $(CURDIR) branch. Because of that, running `make clean` will delete the
whole sched_ext selftests directory. Also, did you mean for the first branch to
be:

+OUTPUT_DIR := $(CURDIR)/build

as opposed to:

> +OUTPUT := $(CURDIR)/build

[...]

Thanks,
David

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ