From: Shuah Khan <skhan@linuxfoundation.org>
To: mpdesouza@suse.com, Joe Lawrence <joe.lawrence@redhat.com>,
Miroslav Benes <mbenes@suse.cz>
Cc: Shuah Khan <shuah@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Jiri Kosina <jikos@kernel.org>, Petr Mladek <pmladek@suse.com>,
linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
live-patching@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v3 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch
Date: Mon, 11 Dec 2023 14:56:15 -0700 [thread overview]
Message-ID: <2c4f2771-0557-4b44-9c98-6bd2e6930d2f@linuxfoundation.org> (raw)
In-Reply-To: <57fb9f30afbaddb09def96aac11c45296a59a277.camel@suse.com>
On 12/7/23 12:19, mpdesouza@suse.com wrote:
> On Thu, 2023-12-07 at 10:20 -0500, Joe Lawrence wrote:
>> On 12/6/23 10:05, Miroslav Benes wrote:
>>> On Fri, 1 Dec 2023, Joe Lawrence wrote:
>>>
>>>> On Tue, Oct 31, 2023 at 06:10:52PM -0300, Marcos Paulo de Souza
>>>> wrote:
>>>>> The modules are being moved from lib/livepatch to
>>>>> tools/testing/selftests/livepatch/test_modules.
>>>>>
>>>>> This code moving will allow writing more complex tests, like
>>>>> for example an
>>>>> userspace C code that will call a livepatched kernel function.
>>>>>
>>>>> The modules are now built as out-of-tree
>>>>> modules, but being part of the kernel source means they will be
>>>>> maintained.
>>>>>
>>>>> Another advantage of the code moving is to be able to easily
>>>>> change,
>>>>> debug and rebuild the tests by running make on the
>>>>> selftests/livepatch directory,
>>>>> which is not currently possible since the modules on
>>>>> lib/livepatch are
>>>>> build and installed using the "modules" target.
>>>>>
>>>>> The current approach also keeps the ability to execute the
>>>>> tests manually by
>>>>> executing the scripts inside selftests/livepatch directory, as
>>>>> it's currently
>>>>> supported. If the modules are modified, they needed to be
>>>>> rebuilt before running
>>>>> the scripts though.
>>>>>
>>>>> The modules are built before running the selftests when using
>>>>> the
>>>>> kselftest invocations:
>>>>>
>>>>> make kselftest TARGETS=livepatch
>>>>> or
>>>>> make -C tools/testing/selftests/livepatch run_tests
>>>>>
>>>>
>>>> Quick question:
>>>>
>>>> - We have been building with CONFIG_LIVEPATCH_TEST=m to generate
>>>> the
>>>> test modules at kernel build time
>>>>
>>>> - Our packaging filters out the selftest scripts and supporting
>>>> modules
>>>> from the general kernel RPM package into their subpackages
>>>>
>>>> - Tests are run as part of CKI or other manual tests by
>>>> installing the
>>>> pre-built packages from the previous step
>>>>
>>>>
>>>> After this patch, we would need to add something like the
>>>> following to
>>>> our kernel build, before packaging:
>>>>
>>>> $ make KDIR=$(pwd) -C tools/testing/selftests/livepatch/
>>>> ^^^^
>>>>
>>>> If this is the correct way to build the test modules for *this*
>>>> tree and
>>>> /lib/modules/$(shell uname -r)/build... it might be useful to
>>>> document
>>>> in the commit message as an alternative use case.
>
> That's right:
>
> $ make -C tools/testing/selftests/livepatch/
>
> is indeed the way to build the tests without running them. KDIR will be
> set to /lib/modules/$(shell uname -r)/build is empty.
>
> Yes, I can definitely add documentation about it inside the
> tools/testing/selftests/livepatch/README.
>
How does the default kselftest run work with these changes?
make ksefltest - does this still work as it did before this change?
thanks,
-- Shuah
next prev parent reply other threads:[~2023-12-11 21:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 21:10 [PATCH v3 0/3] livepatch: Move modules to selftests and add a new test Marcos Paulo de Souza
2023-10-31 21:10 ` [PATCH v3 1/3] kselftests: lib.mk: Add TEST_GEN_MODS_DIR variable Marcos Paulo de Souza
2023-10-31 21:10 ` [PATCH v3 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch Marcos Paulo de Souza
2023-12-01 15:27 ` Joe Lawrence
2023-12-06 15:05 ` Miroslav Benes
2023-12-07 15:20 ` Joe Lawrence
2023-12-07 19:19 ` mpdesouza
2023-12-11 21:56 ` Shuah Khan [this message]
2023-12-12 2:01 ` Marcos Paulo de Souza
2023-12-08 8:06 ` Miroslav Benes
2023-12-08 12:43 ` Petr Mladek
2023-10-31 21:10 ` [PATCH v3 3/3] selftests: livepatch: Test livepatching a heavily called syscall Marcos Paulo de Souza
2023-11-30 23:24 ` Shuah Khan
2023-12-01 13:13 ` Marcos Paulo de Souza
2023-12-01 16:38 ` Shuah Khan
2023-12-05 12:52 ` mpdesouza
2023-12-05 15:39 ` Shuah Khan
2023-12-06 14:39 ` Miroslav Benes
2023-12-11 21:53 ` Shuah Khan
2023-12-15 20:36 ` Joe Lawrence
2023-12-18 20:47 ` Shuah Khan
2023-12-20 11:33 ` Marcos Paulo de Souza
2023-11-30 13:42 ` [PATCH v3 0/3] livepatch: Move modules to selftests and add a new test Marcos Paulo de Souza
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=2c4f2771-0557-4b44-9c98-6bd2e6930d2f@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=corbet@lwn.net \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=mpdesouza@suse.com \
--cc=pmladek@suse.com \
--cc=shuah@kernel.org \
--cc=svens@linux.ibm.com \
/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