mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Sasha Levin <sashal@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	Miroslav Benes <mbenes@suse.cz>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Song Liu <song@kernel.org>,
	Marcos Paulo de Souza <mpdesouza@suse.com>,
	Eva Kurchatova <eva.kurchatova@virtuozzo.com>,
	Yafang Shao <laoar.shao@gmail.com>, Shuah Khan <shuah@kernel.org>,
	live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/4] selftests/livepatch: build the test modules against the kernel in O=
Date: Mon, 23 Nov 2026 15:09:50 +0100	[thread overview]
Message-ID: <awRJLs-Ajbacirg_@pathway.suse.cz> (raw)
In-Reply-To: <20261110161050.2451750-4-sashal@kernel.org>

On Tue 2026-11-10 11:10:49, Sasha Levin wrote:
> Documentation/dev-tools/kselftest.rst describes building the selftests
> for a kernel built in a separate output directory:
> 
>   make O=/tmp/kselftest TARGETS=livepatch kselftest
> 
> The livepatch test modules are not built against the kernel in
> /tmp/kselftest, but against the running kernel, using its devel files
> in /lib/modules/$(uname -r)/build. When those are not installed, the
> modules are silently left out. Only an explicit KDIR=/tmp/kselftest
> builds them for the kernel in /tmp/kselftest.
> 
> When KDIR is not set, use the output directory given with O= or
> KBUILD_OUTPUT if a kernel was built there, then the kernel source tree
> if the kernel was built in it, and only then the running kernel.
> 
> The selftests also pass their O= on to the module build, and the kernel
> Makefile takes it as the kernel build directory instead of KDIR. The
> top-level selftests Makefile passes O= even when it is empty, so on a
> Debian machine with the devel files of the running kernel installed,
> 
>   make -C tools/testing/selftests TARGETS=livepatch
> 
> uses the source part of the devel files as the build directory and
> fails:
> 
>   /usr/src/linux-headers-6.19.13+deb14-common/Makefile:798: /usr/src/linux-headers-6.19.13+deb14-common/include/config/auto.conf: No such file or directory
> 
> Do not pass O= and KBUILD_OUTPUT on to the module build, since KDIR
> already names the kernel build directory.
> 
> Fixes: c4bbe83d27c2 ("livepatch: Move tests from lib/livepatch to selftests/livepatch")
> Signed-off-by: Sasha Levin <sashal@kernel.org>

The patch looks and seems to work reasonably well.

Reviewed-by: Petr Mladek <pmladek@suse.com>
Tested-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

  reply	other threads:[~2026-11-23 14:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 16:10 [PATCH v4 0/4] selftests/livepatch: build and run the tests outside the running kernel Sasha Levin
2026-11-10 16:10 ` [PATCH v4 1/4] selftests/livepatch: skip the tests on kernels without livepatch Sasha Levin
2026-11-23 10:15   ` Petr Mladek
2026-11-10 16:10 ` [PATCH v4 2/4] selftests/livepatch: clean the test modules without a kernel build directory Sasha Levin
2026-11-23 10:23   ` Petr Mladek
2026-11-23 15:44     ` Sasha Levin
2026-11-10 16:10 ` [PATCH v4 3/4] selftests/livepatch: build the test modules against the kernel in O= Sasha Levin
2026-11-23 14:09   ` Petr Mladek [this message]
2026-11-10 16:10 ` [PATCH v4 4/4] selftests/livepatch: run the tests with prebuilt test modules Sasha Levin
2026-11-23 14:10   ` Petr Mladek
2026-11-23 14:16 ` [PATCH v4 0/4] selftests/livepatch: build and run the tests outside the running kernel Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=awRJLs-Ajbacirg_@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=eva.kurchatova@virtuozzo.com \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mpdesouza@suse.com \
    --cc=sashal@kernel.org \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®