13–15 Nov 2023
America/New_York timezone

Moving livepatching module building to kselftests

15 Nov 2023, 12:00
30m
"James River Salon B" (Omni Richmond Hotel)

"James River Salon B"

Omni Richmond Hotel

83
Live Patching MC Live Patching MC

Speaker

Marcos de Souza (SUSE)

Description

The kernel livepatching subsystem has a number of tests that reside in the kernel. There are kernel modules and scripts that are placed in different locations. The kernel livepatch modules are stored in lib/livepatch, while the scripts to load the modules and run tests are stored in tools/testing/kselftests. The test modules are currently only compiled when CONFIG_TEST_LIVEPATCH is enabled, making it difficult to use the same tests on systems which do not have the option enabled.

The current approach of compiling the test modules when the kernel modules are being built prevents us to create more dynamic tests, based on code templates. Such code would allow us to create and compile modules "on the fly", allowing some out-of-tree[1] livepatch tests to be adapted and submitted upstream. This could work by moving the modules from lib/livepatch to tools/testing/selftests/livepatch, allowing to use the "gen_tar" target to create a tarball containing both modules and test scripts. The obstacle to this idea is a policy on kselftests to only contain userspace code.

The proposed idea poses some challenges in how we see kselftests, and which code should be placed within it, on the other hand, it gives us the tools to merge more tests and make the system more robust and reliable. Such a move can even motivate other teams to submit their livepatch tests if support for a more dynamic test infrastructure is added.

[1] https://github.com/SUSE/qa_test_klp/

Primary author

Presentation materials

Diamond Sponsors
Platinum Sponsor
Gold Sponsors
Silver Sponsors
Catchbox Sponsor
Livestream Sponsors
T-Shirt Sponsor
Conference Services Provided by