* [PATCH 00/11] klp-build: Fix dependent patches, add selftests
@ 2026-10-17 0:24 Song Liu
2026-10-17 0:24 ` [PATCH 01/11] klp-build: Fix dependent patches in a series Song Liu
` (10 more replies)
0 siblings, 11 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
klp-build fails when a later patch in the series depends on an earlier
one, because it fixes each patch against the original source on its
own. Patch 1 fixes this by combining the patches into a single patch
before adding the #line directives.
So far, testing this step has needed a full kernel build. Patch 2 adds
a --patch-only option, which validates and fixes the patches, prints
the result, and exits without building.
Patches 3-11 use it to add a kselftest target, livepatch/test_klp_build.
Each test builds a small source tree, runs "klp-build --patch-only" on
some patches, and checks the patch it prints. The tests compile
nothing, need no root, and take about a second. To run them:
make -C tools/testing/selftests/livepatch/test_klp_build tests
Song Liu (11):
klp-build: Fix dependent patches in a series
klp-build: Add --patch-only option
selftests/livepatch: Add tests for klp-build's patch handling
selftests/livepatch: Test klp-build with dependent patches
selftests/livepatch: Test klp-build with patches to different
functions
selftests/livepatch: Test klp-build with patches which cancel out
selftests/livepatch: Test klp-build with created and deleted files
selftests/livepatch: Test where klp-build adds #line directives
selftests/livepatch: Test klp-build's rejection of unsupported files
selftests/livepatch: Test klp-build with patches which don't apply
selftests/livepatch: Test klp-build with patches which need offset or
fuzz
scripts/livepatch/klp-build | 121 ++++++++----
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/livepatch/README | 16 ++
.../livepatch/test_klp_build/Makefile | 27 +++
.../livepatch/test_klp_build/functions.sh | 150 +++++++++++++++
.../livepatch/test_klp_build/run-tests.sh | 68 +++++++
.../livepatch/test_klp_build/test-basic.sh | 57 ++++++
.../test_klp_build/test-cancelling-patches.sh | 102 ++++++++++
.../test_klp_build/test-dependent-patches.sh | 72 +++++++
.../test-independent-patches.sh | 124 +++++++++++++
.../test_klp_build/test-line-directives.sh | 175 ++++++++++++++++++
.../test-new-and-deleted-files.sh | 94 ++++++++++
.../test_klp_build/test-offset-and-fuzz.sh | 120 ++++++++++++
.../test_klp_build/test-patch-not-applying.sh | 73 ++++++++
.../test_klp_build/test-unsupported-files.sh | 30 +++
15 files changed, 1189 insertions(+), 41 deletions(-)
create mode 100644 tools/testing/selftests/livepatch/test_klp_build/Makefile
create mode 100644 tools/testing/selftests/livepatch/test_klp_build/functions.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/run-tests.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-basic.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-cancelling-patches.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-independent-patches.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-line-directives.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-new-and-deleted-files.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-offset-and-fuzz.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-patch-not-applying.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-unsupported-files.sh
--
2.53.0-Meta
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 01/11] klp-build: Fix dependent patches in a series
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:24 ` [PATCH 02/11] klp-build: Add --patch-only option Song Liu
` (9 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
fix_patches() refreshes each patch on its own against the original
source: it applies the patch, copies the patched files, and reverts it.
If a later patch in the series depends on an earlier one, it doesn't
apply to the original source, and klp-build fails even though
validate_patches(), which applies the patches in order, accepted the
series:
$ ./scripts/livepatch/klp-build 0001-dummy.patch 0002-Revert-dummy.patch
Validating patch(es)
Building original kernel
Copying original object files
Fixing patch(es)
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored
error: klp-build: .../klp-tmp/tmp.patch did not apply
Refreshing each patch on top of the previous ones wouldn't work either.
fix-patch-lines adds #line directives to each fixed patch, so the next
patch's context wouldn't match. The #line numbers in later patches
would also refer to the intermediate source rather than the original
source, which defeats the purpose of preserving __LINE__.
Instead, apply all the patches in order and diff the result against the
original source to get a single combined patch, then run fix-patch-lines
on that. If the patches have no net effect, fail early with "no changes
detected" instead of building the patched kernel for nothing.
Fixes: 24ebfcd65a87 ("livepatch/klp-build: Introduce klp-build script for generating livepatch modules")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
scripts/livepatch/klp-build | 93 +++++++++++++++++++++----------------
1 file changed, 54 insertions(+), 39 deletions(-)
diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build
index b52a8489d9f6..6cdc36e97c21 100755
--- a/scripts/livepatch/klp-build
+++ b/scripts/livepatch/klp-build
@@ -467,60 +467,75 @@ do_init() {
set_kernelversion
}
-# Refresh the patch hunk headers, specifically the line numbers and counts.
-refresh_patch() {
- local patch="$1"
+# Combine the patches into a single patch against the original source, with
+# refreshed hunk headers. The patches may depend on each other, so they can't
+# be refreshed individually.
+combine_patches() {
+ local outfile="$1"
local tmpdir="$PATCH_TMP_DIR"
- local input_files=()
- local output_files=()
+ local files=()
+ local patch
+ local file
rm -rf "$tmpdir"
- mkdir -p "$tmpdir/a"
- mkdir -p "$tmpdir/b"
+ mkdir -p "$tmpdir"
- # Get all source files affected by the patch
- get_patch_input_files "$patch" | mapfile -t input_files
- get_patch_output_files "$patch" | mapfile -t output_files
+ # Get all source files affected by the patches
+ for patch in "${PATCHES[@]}"; do
+ get_patch_files "$patch"
+ done | sort -u | mapfile -t files
- # Copy orig source files to 'a'
- echo "${input_files[@]}" | xargs cp --parents --target-directory="$tmpdir/a"
+ # Copy orig source files to $tmpdir
+ for file in "${files[@]}"; do
+ if [[ -e "$file" ]]; then
+ cp --parents "$file" "$tmpdir"
+ fi
+ done
- # Copy patched source files to 'b'
- apply_patch "$patch" "--silent"
- echo "${output_files[@]}" | xargs cp --parents --target-directory="$tmpdir/b"
- revert_patch "$patch"
+ # Diff the orig source files against the patched ones in place to make a
+ # clean patch. Use /dev/null for created and deleted files.
+ : > "$outfile"
+ apply_patches "--silent"
+ for file in "${files[@]}"; do
+ local old="$tmpdir/$file"
+ local new="$file"
+ local old_label="a/$file"
+ local new_label="b/$file"
+ local status=0
+
+ if [[ ! -e "$old" ]]; then
+ old=/dev/null
+ old_label=/dev/null
+ fi
+ if [[ ! -e "$new" ]]; then
+ new=/dev/null
+ new_label=/dev/null
+ fi
- # Diff 'a' and 'b' to make a clean patch
- ( cd "$tmpdir" && diff -Nupr a b > "$patch" ) || true
+ diff -up --label "$old_label" --label "$new_label" "$old" "$new" >> "$outfile" || status=$?
+ if (( status > 1 )); then
+ die "diff failed for $file"
+ fi
+ done
+ revert_patches
}
-# Copy the patches to a temporary directory, fix their lines so as not to
-# affect the __LINE__ macro for otherwise unchanged functions further down the
-# file, and update $PATCHES to point to the fixed patches.
+# Combine the patches into a single patch, fix its lines so as not to affect
+# the __LINE__ macro for otherwise unchanged functions further down the file,
+# and update $PATCHES to point to the fixed patch.
fix_patches() {
- local idx
- local i
+ local tmp_patch="$TMP_DIR/tmp.patch"
+ local new_patch="$TMP_DIR/fixed.patch"
rm -f "$TMP_DIR"/*.patch
- idx=0001
- for i in "${!PATCHES[@]}"; do
- local old_patch="${PATCHES[$i]}"
- local tmp_patch="$TMP_DIR/tmp.patch"
- local patch="${PATCHES[$i]}"
- local new_patch
-
- new_patch="$TMP_DIR/$idx-fixed-$(basename "$patch")"
+ combine_patches "$tmp_patch"
+ [[ ! -s "$tmp_patch" ]] && die "no changes detected"
- cp -f "$old_patch" "$tmp_patch"
- refresh_patch "$tmp_patch"
- "$FIX_PATCH_LINES" "$tmp_patch" | recountdiff > "$new_patch"
+ "$FIX_PATCH_LINES" "$tmp_patch" | recountdiff > "$new_patch"
+ PATCHES=("$new_patch")
- PATCHES[i]="$new_patch"
-
- rm -f "$tmp_patch"
- idx=$(printf "%04d" $(( 10#$idx + 1 )))
- done
+ rm -f "$tmp_patch"
}
clean_kernel() {
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 02/11] klp-build: Add --patch-only option
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
2026-10-17 0:24 ` [PATCH 01/11] klp-build: Fix dependent patches in a series Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:24 ` [PATCH 03/11] selftests/livepatch: Add tests for klp-build's patch handling Song Liu
` (8 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
klp-build fixes the input patches before building the patched kernel:
it combines them into a single patch against the original source and
adds #line directives, so that unchanged functions further down a
patched file keep their __LINE__ values. This only happens after the
original kernel has been built, so seeing the result, or testing this
step, takes a full kernel build and --keep-tmp.
Add a --patch-only option which validates and fixes the patches, prints
the fixed patch to stdout, and exits without building. It skips the
.config checks and the kernel version setup, which only matter for
building, so the tree it runs in doesn't need to be configured. It
uses a private tmp dir rather than klp-tmp, which may hold a previous
build that a later --short-circuit run wants to reuse.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
scripts/livepatch/klp-build | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build
index 6cdc36e97c21..295fad62d7b8 100755
--- a/scripts/livepatch/klp-build
+++ b/scripts/livepatch/klp-build
@@ -19,7 +19,7 @@ set -o nounset
# This helps keep execution in pipes so pipefail+ERR trap can catch errors.
shopt -s lastpipe
-unset DEBUG_CLONE DIFF_CHECKSUM SKIP_CLEANUP VERBOSE XTRACE
+unset DEBUG_CLONE DIFF_CHECKSUM PATCH_ONLY SKIP_CLEANUP VERBOSE XTRACE
REPLACE=1
SHORT_CIRCUIT=0
@@ -137,6 +137,7 @@ Options:
Advanced Options:
-d, --debug Show symbol/reloc cloning decisions
+ --patch-only Print the fixed patch(es) and exit without building
-S, --short-circuit=STEP Start at build step (requires prior --keep-tmp)
1|orig Build original kernel (default)
2|patched Build patched kernel
@@ -160,7 +161,7 @@ process_args() {
local patch
short="hfj:o:vdS:T"
- long="help,show-first-changed,jobs:,output:,no-replace,verbose,debug,short-circuit:,keep-tmp"
+ long="help,show-first-changed,jobs:,output:,no-replace,verbose,debug,patch-only,short-circuit:,keep-tmp"
args=$(getopt --options "$short" --longoptions "$long" -- "$@") || {
echo; usage; exit
@@ -202,6 +203,10 @@ process_args() {
keep_tmp=1
shift
;;
+ --patch-only)
+ PATCH_ONLY=1
+ shift
+ ;;
-S | --short-circuit)
[[ ! -d "$TMP_DIR" ]] && die "--short-circuit requires preserved klp-tmp dir"
keep_tmp=1
@@ -238,6 +243,15 @@ process_args() {
KEEP_TMP="$keep_tmp"
PATCHES=("$@")
+ if [[ -v PATCH_ONLY ]]; then
+ (( SHORT_CIRCUIT > 0 )) && die "--patch-only can't be used with --short-circuit"
+
+ # Leave klp-tmp alone, it may hold a previous build
+ TMP_DIR="$(mktemp -d)"
+ PATCH_TMP_DIR="$TMP_DIR/tmp"
+ KEEP_TMP=0
+ fi
+
for patch in "${PATCHES[@]}"; do
[[ -f "$patch" ]] || die "$patch doesn't exist"
done
@@ -462,6 +476,9 @@ do_init() {
[[ -x "$FIX_PATCH_LINES" ]] || die "can't find fix-patch-lines"
command -v recountdiff &>/dev/null || die "recountdiff not found (install patchutils)"
+ # The rest is only needed for building
+ [[ -v PATCH_ONLY ]] && return 0
+
validate_config
set_module_name
set_kernelversion
@@ -910,6 +927,13 @@ build_patch_module() {
process_args "$@"
do_init
+if [[ -v PATCH_ONLY ]]; then
+ validate_patches
+ fix_patches
+ cat "${PATCHES[@]}"
+ exit 0
+fi
+
if (( SHORT_CIRCUIT <= 2 )); then
status "Validating patch(es)"
validate_patches
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 03/11] selftests/livepatch: Add tests for klp-build's patch handling
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
2026-10-17 0:24 ` [PATCH 01/11] klp-build: Fix dependent patches in a series Song Liu
2026-10-17 0:24 ` [PATCH 02/11] klp-build: Add --patch-only option Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:24 ` [PATCH 04/11] selftests/livepatch: Test klp-build with dependent patches Song Liu
` (7 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
Before building the patched kernel, klp-build combines the patches it
is given into a single patch and adds #line directives to it. Mistakes
there break the build, or make klp-build include functions which didn't
change, but testing this step has so far needed a full kernel build.
Add a kselftest target, livepatch/test_klp_build, which runs
"klp-build --patch-only" on patches to a small source tree and checks
the fixed patch it prints. Nothing is compiled, so the tests don't need
a configured kernel, root, or the livepatch test modules.
Each test creates its source files and patches from heredocs, so it is
self-contained. functions.sh provides:
- setup_tree() creates a scratch tree with klp-build linked into
scripts/livepatch/, since klp-build runs from the top of its own tree
- add_file() and add_patch() fill the tree and the patch directory
- run_klp_build() runs klp-build and checks that it left the tree as it
found it
- expect_patch() checks that klp-build succeeded without warnings and
printed the expected patch. Only what the patch changes is compared:
trailing whitespace is ignored, so blank context lines can be written
as empty lines, and so are "diff" lines and timestamps, which depend
on how the patch was generated.
Installed tests don't have the source tree, so klp-build and
fix-patch-lines are installed next to them. The tests skip if gawk,
recountdiff or GNU patch is missing.
kselftest prints several lines for every test. For running the tests
by hand, add run-tests.sh and a "tests" make target, which print one
line per test case, the details of any failure, and the totals.
Start with a test of a single patch, which gets a #line directive after
the lines it adds.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/livepatch/README | 16 ++
.../livepatch/test_klp_build/Makefile | 19 +++
.../livepatch/test_klp_build/functions.sh | 138 ++++++++++++++++++
.../livepatch/test_klp_build/run-tests.sh | 68 +++++++++
.../livepatch/test_klp_build/test-basic.sh | 57 ++++++++
6 files changed, 299 insertions(+)
create mode 100644 tools/testing/selftests/livepatch/test_klp_build/Makefile
create mode 100644 tools/testing/selftests/livepatch/test_klp_build/functions.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/run-tests.sh
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-basic.sh
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 2d960626750e..30d46cb71cbb 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -64,6 +64,7 @@ TARGETS += kvm
TARGETS += landlock
TARGETS += lib
TARGETS += livepatch
+TARGETS += livepatch/test_klp_build
TARGETS += liveupdate
TARGETS += lkdtm
TARGETS += lsm
diff --git a/tools/testing/selftests/livepatch/README b/tools/testing/selftests/livepatch/README
index d2035dd64a2b..47b1a41b9771 100644
--- a/tools/testing/selftests/livepatch/README
+++ b/tools/testing/selftests/livepatch/README
@@ -44,6 +44,22 @@ or
% make kselftest TARGETS=livepatch
+klp-build tests
+---------------
+
+The test_klp_build directory holds tests for how scripts/livepatch/klp-build
+prepares the patches it is given. They don't build a kernel or load any
+modules, so they don't need root, and they are a kselftest target of their
+own:
+
+ % make -C tools/testing/selftests TARGETS=livepatch/test_klp_build run_tests
+
+For one line of output per test case, which is easier to read when running
+them by hand:
+
+ % make -C tools/testing/selftests/livepatch/test_klp_build tests
+
+
Adding tests
------------
diff --git a/tools/testing/selftests/livepatch/test_klp_build/Makefile b/tools/testing/selftests/livepatch/test_klp_build/Makefile
new file mode 100644
index 000000000000..6ebcecc828a1
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/Makefile
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: GPL-2.0
+
+TEST_PROGS := \
+ test-basic.sh
+
+TEST_PROGS_EXTENDED := functions.sh
+
+# Installed tests run without the source tree, so install klp-build too
+TEST_FILES := \
+ ../../../../../scripts/livepatch/klp-build \
+ ../../../../../scripts/livepatch/fix-patch-lines
+
+include ../../lib.mk
+
+# Run the tests by hand, with one line of output per test case
+tests:
+ @./run-tests.sh $(TEST_PROGS)
+
+.PHONY: tests
diff --git a/tools/testing/selftests/livepatch/test_klp_build/functions.sh b/tools/testing/selftests/livepatch/test_klp_build/functions.sh
new file mode 100644
index 000000000000..4e9d4ccfe300
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/functions.sh
@@ -0,0 +1,138 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# Shell functions for the klp-build tests.
+#
+# Each test creates a small source tree, adds some patches, runs
+# "klp-build --patch-only" on them and checks the fixed patch it prints.
+# Nothing gets compiled, so the source files don't need to build.
+
+export LC_ALL=C
+
+# Kselftest framework requirement - SKIP code is 4
+ksft_skip=4
+
+# skip(msg) - testing can't proceed
+# msg - explanation
+function skip() {
+ echo "SKIP: $1" >&2
+ exit $ksft_skip
+}
+
+# die(msg) - game over, man
+# msg - dying words
+function die() {
+ echo "ERROR: $1" >&2
+ exit 1
+}
+
+TEST_DIR="$(cd "$(dirname "$0")" && pwd)"
+
+# Installed tests have copies of the scripts next to them
+if [[ -x "$TEST_DIR/klp-build" ]]; then
+ SCRIPT_DIR="$TEST_DIR"
+else
+ SCRIPT_DIR="$TEST_DIR/../../../../../scripts/livepatch"
+fi
+[[ -x "$SCRIPT_DIR/klp-build" ]] || skip "klp-build not found"
+
+for cmd in gawk recountdiff; do
+ command -v "$cmd" > /dev/null || skip "$cmd not found"
+done
+patch --version 2> /dev/null | grep -q "GNU patch" || skip "GNU patch not found"
+
+# setup_tree() - create an empty source tree for klp-build to run in
+#
+# klp-build has to run from the top of the tree it lives in, so link it into
+# scripts/livepatch/. Patches are kept outside the tree.
+function setup_tree() {
+ WORK_DIR="$(mktemp -d)" || die "mktemp failed"
+ trap 'rm -rf "$WORK_DIR"' EXIT
+
+ TREE="$WORK_DIR/tree"
+ PATCH_DIR="$WORK_DIR/patches"
+
+ mkdir -p "$TREE/scripts/livepatch" "$PATCH_DIR"
+ ln -s "$SCRIPT_DIR/klp-build" "$SCRIPT_DIR/fix-patch-lines" \
+ "$TREE/scripts/livepatch/"
+}
+
+# add_file(path) - add a source file read from stdin to the tree
+# path - path of the file, relative to the top of the tree
+function add_file() {
+ mkdir -p "$TREE/$(dirname "$1")"
+ cat > "$TREE/$1"
+}
+
+# add_patch(name) - add a patch read from stdin
+# name - file name of the patch
+function add_patch() {
+ cat > "$PATCH_DIR/$1"
+}
+
+# start_test(name) - start a test
+# name - what the test checks
+function start_test() {
+ echo -n "TEST: $1 ... "
+}
+
+# not_ok(msg, [file]) - report a failed test and exit
+# msg - what went wrong
+# file - details to show
+function not_ok() {
+ echo -e "not ok\n"
+ echo "$1"
+ [[ $# -gt 1 ]] && cat "$2"
+ echo
+ die "klp-build kselftest(s) failed"
+}
+
+# run_klp_build(patch...) - run "klp-build --patch-only", and check that it
+# leaves the source tree as it found it
+# patch - name of a patch added with add_patch()
+function run_klp_build() {
+ local patches=()
+ local patch
+
+ for patch in "$@"; do
+ patches+=("$PATCH_DIR/$patch")
+ done
+
+ rm -rf "$WORK_DIR/orig"
+ cp -a "$TREE" "$WORK_DIR/orig"
+
+ STATUS=0
+ (cd "$TREE" && ./scripts/livepatch/klp-build --patch-only "${patches[@]}") \
+ > "$WORK_DIR/stdout" 2> "$WORK_DIR/stderr" || STATUS=$?
+
+ diff -ru "$WORK_DIR/orig" "$TREE" > "$WORK_DIR/tree.diff" ||
+ not_ok "klp-build left the source tree modified:" "$WORK_DIR/tree.diff"
+}
+
+# expect_patch() - check that klp-build succeeded without warnings, and printed
+# the patch read from stdin
+#
+# Only what the patch changes is compared. Trailing whitespace is ignored, so
+# blank context lines can be written as empty lines, and so are "diff" lines
+# and timestamps. A file diffed against an epoch timestamp counts as
+# /dev/null.
+function expect_patch() {
+ local expected="$WORK_DIR/expected"
+ local result="$WORK_DIR/result"
+ local normalize=(sed -E
+ -e '/^diff /d'
+ -e 's/^(---|\+\+\+) [^\t]*\t(1969-12-31|1970-01-01) .*/\1 \/dev\/null/'
+ -e 's/^((---|\+\+\+) [^\t]*)\t.*/\1/'
+ -e 's/[[:space:]]*$//')
+
+ [[ $STATUS -eq 0 ]] || not_ok "klp-build failed:" "$WORK_DIR/stderr"
+ [[ -s "$WORK_DIR/stderr" ]] && not_ok "klp-build warned:" "$WORK_DIR/stderr"
+
+ "${normalize[@]}" > "$expected"
+ "${normalize[@]}" "$WORK_DIR/stdout" > "$result"
+
+ diff -u --label expected --label result "$expected" "$result" > "$WORK_DIR/result.diff" ||
+ not_ok "unexpected patch:" "$WORK_DIR/result.diff"
+
+ echo "ok"
+}
diff --git a/tools/testing/selftests/livepatch/test_klp_build/run-tests.sh b/tools/testing/selftests/livepatch/test_klp_build/run-tests.sh
new file mode 100755
index 000000000000..d67770006d7f
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/run-tests.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# Run the klp-build tests with less output than "make run_tests": one line
+# per test case, the details of any failure, and the totals.
+#
+# Usage: run-tests.sh [test-*.sh...]
+
+cd "$(dirname "$0")" || exit 1
+
+tests=("$@")
+[[ ${#tests[@]} -eq 0 ]] && tests=(test-*.sh)
+
+pass=0
+fail=0
+skip=0
+
+echo "TAP version 13"
+
+for test in "${tests[@]}"; do
+ name="${test%.sh}"
+ failed=0
+ cases=0
+ status=0
+
+ out="$(./"$test" 2>&1)" || status=$?
+
+ if [[ $status -eq 4 ]]; then
+ echo "ok - $name # SKIP $(sed -n 's/^SKIP: //p' <<< "$out")"
+ skip=$((skip + 1))
+ continue
+ fi
+
+ while IFS= read -r line; do
+ case "$line" in
+ "TEST: "*" ... ok")
+ line="${line#TEST: }"
+ echo "ok - $name: ${line% ... ok}"
+ pass=$((pass + 1))
+ cases=$((cases + 1))
+ ;;
+ "TEST: "*" ... not ok")
+ line="${line#TEST: }"
+ echo "not ok - $name: ${line% ... not ok}"
+ failed=1
+ cases=$((cases + 1))
+ ;;
+ "ERROR: klp-build kselftest(s) failed" | "")
+ ;;
+ *)
+ [[ $failed -eq 1 ]] && echo "# $line"
+ ;;
+ esac
+ done <<< "$out"
+
+ if [[ $failed -eq 0 && ( $status -ne 0 || $cases -eq 0 ) ]]; then
+ echo "not ok - $name: exited with status $status after $cases test case(s)"
+ sed 's/^/# /' <<< "$out"
+ failed=1
+ fi
+
+ fail=$((fail + failed))
+done
+
+echo "1..$((pass + fail + skip))"
+echo "# pass:$pass fail:$fail skip:$skip"
+
+[[ $fail -eq 0 ]]
diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-basic.sh b/tools/testing/selftests/livepatch/test_klp_build/test-basic.sh
new file mode 100755
index 000000000000..d10d75fc8db5
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/test-basic.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+. "$(dirname "$0")/functions.sh"
+
+setup_tree
+
+add_file drivers/foo/foo.c <<'EOT'
+int foo(int x)
+{
+ if (x < 0)
+ return -1;
+ return x;
+}
+
+int bar(void)
+{
+ return __LINE__;
+}
+EOT
+
+# - a patch which adds lines to foo() gets a #line directive after them, so
+# bar() still sees its original __LINE__
+
+start_test "single patch"
+
+add_patch 0001-foo.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,6 +1,8 @@
+ int foo(int x)
+ {
++ if (!x)
++ return 0;
+ if (x < 0)
+ return -1;
+ return x;
+ }
+EOT
+
+run_klp_build 0001-foo.patch
+
+expect_patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,5 +1,8 @@
+ int foo(int x)
+ {
++ if (!x)
++ return 0;
++#line 3
+ if (x < 0)
+ return -1;
+ return x;
+EOT
+
+exit 0
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 04/11] selftests/livepatch: Test klp-build with dependent patches
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
` (2 preceding siblings ...)
2026-10-17 0:24 ` [PATCH 03/11] selftests/livepatch: Add tests for klp-build's patch handling Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:30 ` sashiko-bot
2026-10-17 0:24 ` [PATCH 05/11] selftests/livepatch: Test klp-build with patches to different functions Song Liu
` (6 subsequent siblings)
10 siblings, 1 reply; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
Add a test where the second patch changes lines added by the first, so
it only applies on top of it. klp-build has to combine the two into a
single patch against the original source, rather than fixing each one
against the original source on its own.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
.../livepatch/test_klp_build/Makefile | 3 +-
.../test_klp_build/test-dependent-patches.sh | 72 +++++++++++++++++++
2 files changed, 74 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/Makefile b/tools/testing/selftests/livepatch/test_klp_build/Makefile
index 6ebcecc828a1..405545c72303 100644
--- a/tools/testing/selftests/livepatch/test_klp_build/Makefile
+++ b/tools/testing/selftests/livepatch/test_klp_build/Makefile
@@ -1,7 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
TEST_PROGS := \
- test-basic.sh
+ test-basic.sh \
+ test-dependent-patches.sh
TEST_PROGS_EXTENDED := functions.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh b/tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh
new file mode 100755
index 000000000000..75b957ac002c
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+. "$(dirname "$0")/functions.sh"
+
+setup_tree
+
+add_file drivers/foo/foo.c <<'EOT'
+int foo(int x)
+{
+ if (x < 0)
+ return -1;
+ return x;
+}
+
+int bar(void)
+{
+ return __LINE__;
+}
+EOT
+
+# - a patch which changes lines added by an earlier patch doesn't apply to the
+# original source on its own, but the combined patch does
+
+start_test "patch which depends on an earlier one"
+
+add_patch 0001-foo.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,6 +1,8 @@
+ int foo(int x)
+ {
++ if (!x)
++ return 0;
+ if (x < 0)
+ return -1;
+ return x;
+ }
+EOT
+
+add_patch 0002-foo-again.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,8 +1,8 @@
+ int foo(int x)
+ {
+ if (!x)
+- return 0;
++ return 1;
+ if (x < 0)
+ return -1;
+ return x;
+ }
+EOT
+
+run_klp_build 0001-foo.patch 0002-foo-again.patch
+
+expect_patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,5 +1,8 @@
+ int foo(int x)
+ {
++ if (!x)
++ return 1;
++#line 3
+ if (x < 0)
+ return -1;
+ return x;
+EOT
+
+exit 0
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 05/11] selftests/livepatch: Test klp-build with patches to different functions
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
` (3 preceding siblings ...)
2026-10-17 0:24 ` [PATCH 04/11] selftests/livepatch: Test klp-build with dependent patches Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:24 ` [PATCH 06/11] selftests/livepatch: Test klp-build with patches which cancel out Song Liu
` (5 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
Add a test where two patches change different functions of the same
file, and the second also changes a header. The patches are combined
into one patch per file, and the #line directives use line numbers from
the original file, even for the function the first patch moved down.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
.../livepatch/test_klp_build/Makefile | 3 +-
.../test-independent-patches.sh | 124 ++++++++++++++++++
2 files changed, 126 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-independent-patches.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/Makefile b/tools/testing/selftests/livepatch/test_klp_build/Makefile
index 405545c72303..536b27767435 100644
--- a/tools/testing/selftests/livepatch/test_klp_build/Makefile
+++ b/tools/testing/selftests/livepatch/test_klp_build/Makefile
@@ -2,7 +2,8 @@
TEST_PROGS := \
test-basic.sh \
- test-dependent-patches.sh
+ test-dependent-patches.sh \
+ test-independent-patches.sh
TEST_PROGS_EXTENDED := functions.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-independent-patches.sh b/tools/testing/selftests/livepatch/test_klp_build/test-independent-patches.sh
new file mode 100755
index 000000000000..f38bad21584b
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/test-independent-patches.sh
@@ -0,0 +1,124 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+. "$(dirname "$0")/functions.sh"
+
+setup_tree
+
+add_file drivers/foo/foo.c <<'EOT'
+int foo(int x)
+{
+ if (x < 0)
+ return -1;
+ return x;
+}
+
+int bar(void)
+{
+ return __LINE__;
+}
+
+int baz(int x)
+{
+ if (x > 100)
+ return 100;
+ return x;
+}
+EOT
+
+add_file include/linux/foo.h <<'EOT'
+#ifndef _LINUX_FOO_H
+#define _LINUX_FOO_H
+
+int foo(int x);
+int bar(void);
+
+#endif
+EOT
+
+# - patches to different parts of a file are combined into one patch, with
+# #line numbers from the original file even where an earlier patch moved
+# the lines down
+
+start_test "patches to different functions of a file"
+
+add_patch 0001-foo.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,6 +1,8 @@
+ int foo(int x)
+ {
++ if (!x)
++ return 0;
+ if (x < 0)
+ return -1;
+ return x;
+ }
+EOT
+
+add_patch 0002-baz.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -14,7 +14,7 @@ int bar(void)
+
+ int baz(int x)
+ {
+- if (x > 100)
+- return 100;
++ if (x > FOO_MAX)
++ return FOO_MAX;
+ return x;
+ }
+--- a/include/linux/foo.h
++++ b/include/linux/foo.h
+@@ -1,6 +1,8 @@
+ #ifndef _LINUX_FOO_H
+ #define _LINUX_FOO_H
+
++#define FOO_MAX 100
++
+ int foo(int x);
+ int bar(void);
+
+EOT
+
+run_klp_build 0001-foo.patch 0002-baz.patch
+
+expect_patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,5 +1,8 @@
+ int foo(int x)
+ {
++ if (!x)
++ return 0;
++#line 3
+ if (x < 0)
+ return -1;
+ return x;
+@@ -12,7 +15,8 @@ int bar(void)
+
+ int baz(int x)
+ {
+- if (x > 100)
+- return 100;
++ if (x > FOO_MAX)
++ return FOO_MAX;
++#line 17
+ return x;
+ }
+--- a/include/linux/foo.h
++++ b/include/linux/foo.h
+@@ -1,6 +1,9 @@
+ #ifndef _LINUX_FOO_H
+ #define _LINUX_FOO_H
+
++#define FOO_MAX 100
++
++#line 4
+ int foo(int x);
+ int bar(void);
+
+EOT
+
+exit 0
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 06/11] selftests/livepatch: Test klp-build with patches which cancel out
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
` (4 preceding siblings ...)
2026-10-17 0:24 ` [PATCH 05/11] selftests/livepatch: Test klp-build with patches to different functions Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:24 ` [PATCH 07/11] selftests/livepatch: Test klp-build with created and deleted files Song Liu
` (4 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
Add a test where a patch is followed by its revert. On their own the
two leave nothing to build, so klp-build fails with "no changes
detected" before building anything. With another patch after them,
only that patch's change is left in the combined patch.
Add expect_error() to functions.sh to check for a failure with a given
error message.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
.../livepatch/test_klp_build/Makefile | 3 +-
.../livepatch/test_klp_build/functions.sh | 12 +++
.../test_klp_build/test-cancelling-patches.sh | 102 ++++++++++++++++++
3 files changed, 116 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-cancelling-patches.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/Makefile b/tools/testing/selftests/livepatch/test_klp_build/Makefile
index 536b27767435..b3191b5c1925 100644
--- a/tools/testing/selftests/livepatch/test_klp_build/Makefile
+++ b/tools/testing/selftests/livepatch/test_klp_build/Makefile
@@ -3,7 +3,8 @@
TEST_PROGS := \
test-basic.sh \
test-dependent-patches.sh \
- test-independent-patches.sh
+ test-independent-patches.sh \
+ test-cancelling-patches.sh
TEST_PROGS_EXTENDED := functions.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/functions.sh b/tools/testing/selftests/livepatch/test_klp_build/functions.sh
index 4e9d4ccfe300..04538efbee5d 100644
--- a/tools/testing/selftests/livepatch/test_klp_build/functions.sh
+++ b/tools/testing/selftests/livepatch/test_klp_build/functions.sh
@@ -136,3 +136,15 @@ function expect_patch() {
echo "ok"
}
+
+# expect_error(msg) - check that klp-build failed with an error message
+# msg - the message, without the "error: klp-build: " prefix
+function expect_error() {
+ [[ $STATUS -ne 0 ]] || not_ok "klp-build succeeded unexpectedly:" "$WORK_DIR/stdout"
+ [[ -s "$WORK_DIR/stdout" ]] && not_ok "klp-build printed a patch:" "$WORK_DIR/stdout"
+
+ grep -qxF "error: klp-build: $1" "$WORK_DIR/stderr" ||
+ not_ok "klp-build didn't fail with \"$1\":" "$WORK_DIR/stderr"
+
+ echo "ok"
+}
diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-cancelling-patches.sh b/tools/testing/selftests/livepatch/test_klp_build/test-cancelling-patches.sh
new file mode 100755
index 000000000000..270ec8dd892f
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/test-cancelling-patches.sh
@@ -0,0 +1,102 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+. "$(dirname "$0")/functions.sh"
+
+setup_tree
+
+add_file drivers/foo/foo.c <<'EOT'
+int foo(int x)
+{
+ if (x < 0)
+ return -1;
+ return x;
+}
+
+int bar(void)
+{
+ return __LINE__;
+}
+
+int baz(int x)
+{
+ if (x > 100)
+ return 100;
+ return x;
+}
+EOT
+
+add_patch 0001-foo.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,6 +1,8 @@
+ int foo(int x)
+ {
++ if (!x)
++ return 0;
+ if (x < 0)
+ return -1;
+ return x;
+ }
+EOT
+
+add_patch 0002-revert-foo.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,8 +1,6 @@
+ int foo(int x)
+ {
+- if (!x)
+- return 0;
+ if (x < 0)
+ return -1;
+ return x;
+ }
+EOT
+
+add_patch 0003-baz.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -12,7 +12,7 @@ int bar(void)
+
+ int baz(int x)
+ {
+- if (x > 100)
+- return 100;
++ if (x > 1000)
++ return 1000;
+ return x;
+ }
+EOT
+
+# - a patch and its revert leave nothing to build
+
+start_test "patch and its revert"
+
+run_klp_build 0001-foo.patch 0002-revert-foo.patch
+
+expect_error "no changes detected"
+
+# - with another patch after them, only that patch's change is left
+
+start_test "patch and its revert, then another patch"
+
+run_klp_build 0001-foo.patch 0002-revert-foo.patch 0003-baz.patch
+
+expect_patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -12,7 +12,8 @@ int bar(void)
+
+ int baz(int x)
+ {
+- if (x > 100)
+- return 100;
++ if (x > 1000)
++ return 1000;
++#line 17
+ return x;
+ }
+EOT
+
+exit 0
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 07/11] selftests/livepatch: Test klp-build with created and deleted files
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
` (5 preceding siblings ...)
2026-10-17 0:24 ` [PATCH 06/11] selftests/livepatch: Test klp-build with patches which cancel out Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:24 ` [PATCH 08/11] selftests/livepatch: Test where klp-build adds #line directives Song Liu
` (3 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
Add a test of patches which create and delete files. Both are diffed
against /dev/null, and the created file gets no #line directive, as it
has no original line numbers to preserve. A file created by one patch
and changed by the next is a new file in the combined patch.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
.../livepatch/test_klp_build/Makefile | 3 +-
.../test-new-and-deleted-files.sh | 94 +++++++++++++++++++
2 files changed, 96 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-new-and-deleted-files.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/Makefile b/tools/testing/selftests/livepatch/test_klp_build/Makefile
index b3191b5c1925..96144f99b1aa 100644
--- a/tools/testing/selftests/livepatch/test_klp_build/Makefile
+++ b/tools/testing/selftests/livepatch/test_klp_build/Makefile
@@ -4,7 +4,8 @@ TEST_PROGS := \
test-basic.sh \
test-dependent-patches.sh \
test-independent-patches.sh \
- test-cancelling-patches.sh
+ test-cancelling-patches.sh \
+ test-new-and-deleted-files.sh
TEST_PROGS_EXTENDED := functions.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-new-and-deleted-files.sh b/tools/testing/selftests/livepatch/test_klp_build/test-new-and-deleted-files.sh
new file mode 100755
index 000000000000..2acec2df98ff
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/test-new-and-deleted-files.sh
@@ -0,0 +1,94 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+. "$(dirname "$0")/functions.sh"
+
+setup_tree
+
+add_file drivers/foo/old.c <<'EOT'
+int old(void)
+{
+ return 0;
+}
+EOT
+
+# - created and deleted files are diffed against /dev/null, and a created
+# file gets no #line directive since it has no original line numbers
+
+start_test "created and deleted files"
+
+add_patch 0001-new-and-old.patch <<'EOT'
+--- /dev/null
++++ b/drivers/foo/new.c
+@@ -0,0 +1,4 @@
++int new(void)
++{
++ return 1;
++}
+--- a/drivers/foo/old.c
++++ /dev/null
+@@ -1,4 +0,0 @@
+-int old(void)
+-{
+- return 0;
+-}
+EOT
+
+run_klp_build 0001-new-and-old.patch
+
+expect_patch <<'EOT'
+--- /dev/null
++++ b/drivers/foo/new.c
+@@ -0,0 +1,4 @@
++int new(void)
++{
++ return 1;
++}
+--- a/drivers/foo/old.c
++++ /dev/null
+@@ -1,4 +0,0 @@
+-int old(void)
+-{
+- return 0;
+-}
+EOT
+
+# - a file created by one patch and changed by the next is a new file in the
+# combined patch
+
+start_test "created file changed by a later patch"
+
+add_patch 0001-new.patch <<'EOT'
+--- /dev/null
++++ b/drivers/foo/new.c
+@@ -0,0 +1,4 @@
++int new(void)
++{
++ return 1;
++}
+EOT
+
+add_patch 0002-new-again.patch <<'EOT'
+--- a/drivers/foo/new.c
++++ b/drivers/foo/new.c
+@@ -1,4 +1,4 @@
+ int new(void)
+ {
+- return 1;
++ return 2;
+ }
+EOT
+
+run_klp_build 0001-new.patch 0002-new-again.patch
+
+expect_patch <<'EOT'
+--- /dev/null
++++ b/drivers/foo/new.c
+@@ -0,0 +1,4 @@
++int new(void)
++{
++ return 2;
++}
+EOT
+
+exit 0
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 08/11] selftests/livepatch: Test where klp-build adds #line directives
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
` (6 preceding siblings ...)
2026-10-17 0:24 ` [PATCH 07/11] selftests/livepatch: Test klp-build with created and deleted files Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:24 ` [PATCH 09/11] selftests/livepatch: Test klp-build's rejection of unsupported files Song Liu
` (2 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
Add a test of where #line directives go:
- each group of changed lines in a hunk gets its own directive
- after removed lines, the directive skips over them
- files other than C sources and headers get none
- lines added at the end of a file get none, as nothing after them
needs renumbering
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
.../livepatch/test_klp_build/Makefile | 3 +-
.../test_klp_build/test-line-directives.sh | 175 ++++++++++++++++++
2 files changed, 177 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-line-directives.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/Makefile b/tools/testing/selftests/livepatch/test_klp_build/Makefile
index 96144f99b1aa..83f4e23460ac 100644
--- a/tools/testing/selftests/livepatch/test_klp_build/Makefile
+++ b/tools/testing/selftests/livepatch/test_klp_build/Makefile
@@ -5,7 +5,8 @@ TEST_PROGS := \
test-dependent-patches.sh \
test-independent-patches.sh \
test-cancelling-patches.sh \
- test-new-and-deleted-files.sh
+ test-new-and-deleted-files.sh \
+ test-line-directives.sh
TEST_PROGS_EXTENDED := functions.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-line-directives.sh b/tools/testing/selftests/livepatch/test_klp_build/test-line-directives.sh
new file mode 100755
index 000000000000..50877393d2c1
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/test-line-directives.sh
@@ -0,0 +1,175 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+. "$(dirname "$0")/functions.sh"
+
+setup_tree
+
+# - each group of changed lines in a hunk gets its own #line directive
+
+start_test "two groups of changes in one hunk"
+
+add_file drivers/foo/groups.c <<'EOT'
+int foo(int x)
+{
+ int y = 0;
+
+ if (x < 0)
+ y = -1;
+ if (x > 100)
+ y = 100;
+ return y;
+}
+EOT
+
+add_patch 0001-groups.patch <<'EOT'
+--- a/drivers/foo/groups.c
++++ b/drivers/foo/groups.c
+@@ -1,9 +1,11 @@
+ int foo(int x)
+ {
+- int y = 0;
++ int y = x;
+
+ if (x < 0)
+ y = -1;
++ else if (!x)
++ y = 1;
+ if (x > 100)
+ y = 100;
+ return y;
+EOT
+
+run_klp_build 0001-groups.patch
+
+expect_patch <<'EOT'
+--- a/drivers/foo/groups.c
++++ b/drivers/foo/groups.c
+@@ -1,9 +1,13 @@
+ int foo(int x)
+ {
+- int y = 0;
++ int y = x;
++#line 4
+
+ if (x < 0)
+ y = -1;
++ else if (!x)
++ y = 1;
++#line 7
+ if (x > 100)
+ y = 100;
+ return y;
+EOT
+
+# - after removed lines, the #line directive skips over them
+
+start_test "removed lines"
+
+add_file drivers/foo/remove.c <<'EOT'
+int foo(int x)
+{
+ if (x < 0)
+ return -1;
+ return x;
+}
+EOT
+
+add_patch 0001-remove.patch <<'EOT'
+--- a/drivers/foo/remove.c
++++ b/drivers/foo/remove.c
+@@ -1,6 +1,4 @@
+ int foo(int x)
+ {
+- if (x < 0)
+- return -1;
+ return x;
+ }
+EOT
+
+run_klp_build 0001-remove.patch
+
+expect_patch <<'EOT'
+--- a/drivers/foo/remove.c
++++ b/drivers/foo/remove.c
+@@ -1,6 +1,5 @@
+ int foo(int x)
+ {
+- if (x < 0)
+- return -1;
++#line 5
+ return x;
+ }
+EOT
+
+# - only C sources and headers get #line directives
+
+start_test "change to a Makefile"
+
+add_file drivers/foo/Makefile <<'EOT'
+obj-y += foo.o
+obj-y += groups.o
+EOT
+
+add_patch 0001-makefile.patch <<'EOT'
+--- a/drivers/foo/Makefile
++++ b/drivers/foo/Makefile
+@@ -1,2 +1,3 @@
+ obj-y += foo.o
++obj-y += new.o
+ obj-y += groups.o
+EOT
+
+run_klp_build 0001-makefile.patch
+
+expect_patch <<'EOT'
+--- a/drivers/foo/Makefile
++++ b/drivers/foo/Makefile
+@@ -1,2 +1,3 @@
+ obj-y += foo.o
++obj-y += new.o
+ obj-y += groups.o
+EOT
+
+# - lines added at the end of a file have nothing after them to renumber
+
+start_test "lines added at the end of a file"
+
+add_file drivers/foo/tail.c <<'EOT'
+int foo(void)
+{
+ return 0;
+}
+EOT
+
+add_patch 0001-tail.patch <<'EOT'
+--- a/drivers/foo/tail.c
++++ b/drivers/foo/tail.c
+@@ -2,3 +2,8 @@ int foo(void)
+ {
+ return 0;
+ }
++
++int bar(void)
++{
++ return 1;
++}
+EOT
+
+run_klp_build 0001-tail.patch
+
+expect_patch <<'EOT'
+--- a/drivers/foo/tail.c
++++ b/drivers/foo/tail.c
+@@ -2,3 +2,8 @@ int foo(void)
+ {
+ return 0;
+ }
++
++int bar(void)
++{
++ return 1;
++}
+EOT
+
+exit 0
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 09/11] selftests/livepatch: Test klp-build's rejection of unsupported files
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
` (7 preceding siblings ...)
2026-10-17 0:24 ` [PATCH 08/11] selftests/livepatch: Test where klp-build adds #line directives Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:24 ` [PATCH 10/11] selftests/livepatch: Test klp-build with patches which don't apply Song Liu
2026-10-17 0:24 ` [PATCH 11/11] selftests/livepatch: Test klp-build with patches which need offset or fuzz Song Liu
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
Add a test that klp-build rejects patches to lib/, the vDSO, real mode
code and assembly files, which it can't build a livepatch for.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
.../livepatch/test_klp_build/Makefile | 3 +-
.../test_klp_build/test-unsupported-files.sh | 30 +++++++++++++++++++
2 files changed, 32 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-unsupported-files.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/Makefile b/tools/testing/selftests/livepatch/test_klp_build/Makefile
index 83f4e23460ac..af8f350226c2 100644
--- a/tools/testing/selftests/livepatch/test_klp_build/Makefile
+++ b/tools/testing/selftests/livepatch/test_klp_build/Makefile
@@ -6,7 +6,8 @@ TEST_PROGS := \
test-independent-patches.sh \
test-cancelling-patches.sh \
test-new-and-deleted-files.sh \
- test-line-directives.sh
+ test-line-directives.sh \
+ test-unsupported-files.sh
TEST_PROGS_EXTENDED := functions.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-unsupported-files.sh b/tools/testing/selftests/livepatch/test_klp_build/test-unsupported-files.sh
new file mode 100755
index 000000000000..968ae80f7128
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/test-unsupported-files.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+. "$(dirname "$0")/functions.sh"
+
+setup_tree
+
+# - patches to lib/, the vDSO, real mode code and assembly are rejected
+
+for file in lib/string.c \
+ arch/x86/entry/vdso/vma.c \
+ arch/x86/realmode/rm/video-mode.c \
+ arch/x86/kernel/head_64.S; do
+
+ start_test "patch to $file"
+
+ add_patch unsupported.patch <<EOT
+--- a/$file
++++ b/$file
+@@ -1 +1 @@
+-int x;
++int y;
+EOT
+
+ run_klp_build unsupported.patch
+
+ expect_error "$PATCH_DIR/unsupported.patch: unsupported patch to $file"
+done
+
+exit 0
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 10/11] selftests/livepatch: Test klp-build with patches which don't apply
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
` (8 preceding siblings ...)
2026-10-17 0:24 ` [PATCH 09/11] selftests/livepatch: Test klp-build's rejection of unsupported files Song Liu
@ 2026-10-17 0:24 ` Song Liu
2026-10-17 0:24 ` [PATCH 11/11] selftests/livepatch: Test klp-build with patches which need offset or fuzz Song Liu
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
Add a test that klp-build rejects a patch which doesn't match the
source, and that when the second patch of a series doesn't apply, the
first one is reverted, leaving the source tree as it was.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
.../livepatch/test_klp_build/Makefile | 3 +-
.../test_klp_build/test-patch-not-applying.sh | 73 +++++++++++++++++++
2 files changed, 75 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-patch-not-applying.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/Makefile b/tools/testing/selftests/livepatch/test_klp_build/Makefile
index af8f350226c2..2513105b3e1c 100644
--- a/tools/testing/selftests/livepatch/test_klp_build/Makefile
+++ b/tools/testing/selftests/livepatch/test_klp_build/Makefile
@@ -7,7 +7,8 @@ TEST_PROGS := \
test-cancelling-patches.sh \
test-new-and-deleted-files.sh \
test-line-directives.sh \
- test-unsupported-files.sh
+ test-unsupported-files.sh \
+ test-patch-not-applying.sh
TEST_PROGS_EXTENDED := functions.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-patch-not-applying.sh b/tools/testing/selftests/livepatch/test_klp_build/test-patch-not-applying.sh
new file mode 100755
index 000000000000..40841086288c
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/test-patch-not-applying.sh
@@ -0,0 +1,73 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+. "$(dirname "$0")/functions.sh"
+
+setup_tree
+
+add_file drivers/foo/foo.c <<'EOT'
+int foo(int x)
+{
+ if (x < 0)
+ return -1;
+ return x;
+}
+EOT
+
+# - a patch which doesn't match the source is rejected
+
+start_test "patch which doesn't apply"
+
+add_patch 0001-bad.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,6 +1,6 @@
+ int foo(int x)
+ {
+- if (x > 0)
++ if (x >= 0)
+ return -1;
+ return x;
+ }
+EOT
+
+run_klp_build 0001-bad.patch
+
+expect_error "$PATCH_DIR/0001-bad.patch did not apply"
+
+# - when a later patch doesn't apply, the earlier ones are reverted
+
+start_test "series whose second patch doesn't apply"
+
+add_patch 0001-foo.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -1,6 +1,8 @@
+ int foo(int x)
+ {
++ if (!x)
++ return 0;
+ if (x < 0)
+ return -1;
+ return x;
+ }
+EOT
+
+add_patch 0002-bad.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -3,6 +3,6 @@
+ if (!x)
+ return 0;
+- if (x > 0)
++ if (x >= 0)
+ return -1;
+ return x;
+ }
+EOT
+
+run_klp_build 0001-foo.patch 0002-bad.patch
+
+expect_error "$PATCH_DIR/0002-bad.patch did not apply"
+
+exit 0
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 11/11] selftests/livepatch: Test klp-build with patches which need offset or fuzz
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
` (9 preceding siblings ...)
2026-10-17 0:24 ` [PATCH 10/11] selftests/livepatch: Test klp-build with patches which don't apply Song Liu
@ 2026-10-17 0:24 ` Song Liu
10 siblings, 0 replies; 13+ messages in thread
From: Song Liu @ 2026-10-17 0:24 UTC (permalink / raw)
To: live-patching, linux-kselftest
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah,
linux-kernel, Song Liu
klp-build accepts patches which apply with an offset or fuzz, and warns
about them. Add a test that both are accepted with a warning, and that
the fixed patch has the line numbers and context of the real source, so
the #line directives refer to the right lines.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@kernel.org>
---
.../livepatch/test_klp_build/Makefile | 3 +-
.../test_klp_build/test-offset-and-fuzz.sh | 120 ++++++++++++++++++
2 files changed, 122 insertions(+), 1 deletion(-)
create mode 100755 tools/testing/selftests/livepatch/test_klp_build/test-offset-and-fuzz.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/Makefile b/tools/testing/selftests/livepatch/test_klp_build/Makefile
index 2513105b3e1c..a62ae5340fa4 100644
--- a/tools/testing/selftests/livepatch/test_klp_build/Makefile
+++ b/tools/testing/selftests/livepatch/test_klp_build/Makefile
@@ -8,7 +8,8 @@ TEST_PROGS := \
test-new-and-deleted-files.sh \
test-line-directives.sh \
test-unsupported-files.sh \
- test-patch-not-applying.sh
+ test-patch-not-applying.sh \
+ test-offset-and-fuzz.sh
TEST_PROGS_EXTENDED := functions.sh
diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-offset-and-fuzz.sh b/tools/testing/selftests/livepatch/test_klp_build/test-offset-and-fuzz.sh
new file mode 100755
index 000000000000..413b39b83431
--- /dev/null
+++ b/tools/testing/selftests/livepatch/test_klp_build/test-offset-and-fuzz.sh
@@ -0,0 +1,120 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+. "$(dirname "$0")/functions.sh"
+
+# expect_warning(msg) - check that klp-build warned, and drop the warning so
+# expect_patch() doesn't complain about it
+# msg - the warning, without the "warning: klp-build: " prefix
+function expect_warning() {
+ local line="warning: klp-build: $1"
+
+ grep -qxF "$line" "$WORK_DIR/stderr" ||
+ not_ok "klp-build didn't warn \"$1\":" "$WORK_DIR/stderr"
+
+ grep -vxF "$line" "$WORK_DIR/stderr" > "$WORK_DIR/stderr.rest"
+ mv "$WORK_DIR/stderr.rest" "$WORK_DIR/stderr"
+}
+
+setup_tree
+
+add_file drivers/foo/foo.c <<'EOT'
+int foo(int x)
+{
+ if (x < 0)
+ return -1;
+ return x;
+}
+
+int bar(void)
+{
+ return __LINE__;
+}
+
+int baz(int x)
+{
+ if (x > 100)
+ return 100;
+ return x;
+}
+EOT
+
+# - a patch made against a source with fewer lines applies at an offset, and
+# the fixed patch has the real line numbers
+
+start_test "patch with an offset"
+
+add_patch 0001-offset.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -9,7 +9,7 @@
+
+ int baz(int x)
+ {
+- if (x > 100)
+- return 100;
++ if (x > 1000)
++ return 1000;
+ return x;
+ }
+EOT
+
+run_klp_build 0001-offset.patch
+
+expect_warning "$PATCH_DIR/0001-offset.patch applied with fuzz"
+expect_patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -12,7 +12,8 @@ int bar(void)
+
+ int baz(int x)
+ {
+- if (x > 100)
+- return 100;
++ if (x > 1000)
++ return 1000;
++#line 17
+ return x;
+ }
+EOT
+
+# - a patch whose context differs from the source applies with fuzz, and the
+# fixed patch has the real context
+
+start_test "patch with fuzz"
+
+add_patch 0001-fuzz.patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -12,7 +12,7 @@
+ /* clamp x */
+ int baz(int x)
+ {
+- if (x > 100)
+- return 100;
++ if (x > 1000)
++ return 1000;
+ return x;
+ }
+EOT
+
+run_klp_build 0001-fuzz.patch
+
+expect_warning "$PATCH_DIR/0001-fuzz.patch applied with fuzz"
+expect_patch <<'EOT'
+--- a/drivers/foo/foo.c
++++ b/drivers/foo/foo.c
+@@ -12,7 +12,8 @@ int bar(void)
+
+ int baz(int x)
+ {
+- if (x > 100)
+- return 100;
++ if (x > 1000)
++ return 1000;
++#line 17
+ return x;
+ }
+EOT
+
+exit 0
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 04/11] selftests/livepatch: Test klp-build with dependent patches
2026-10-17 0:24 ` [PATCH 04/11] selftests/livepatch: Test klp-build with dependent patches Song Liu
@ 2026-10-17 0:30 ` sashiko-bot
0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-10-17 0:30 UTC (permalink / raw)
To: Song Liu, live-patching
Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests/livepatch: test-dependent-patches.sh duplicates test-basic.sh setup
--
commit fc2a73d39b4eb0e68d2bd9630878b28c5feeaab1
Author: Song Liu <song@kernel.org>
selftests/livepatch: Test klp-build with dependent patches
This commit adds a new selftest script, test-dependent-patches.sh, to test
klp-build when a second patch modifies lines added by an earlier patch.
> diff --git a/tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh b/tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh
> new file mode 100755
> index 0000000000000..75b957ac002c0
> --- /dev/null
> +++ b/tools/testing/selftests/livepatch/test_klp_build/test-dependent-patches.sh
> @@ -0,0 +1,72 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +. "$(dirname "$0")/functions.sh"
> +
> +setup_tree
> +
> +add_file drivers/foo/foo.c <<'EOT'
> +int foo(int x)
> +{
> + if (x < 0)
> + return -1;
> + return x;
> +}
> +
> +int bar(void)
> +{
> + return __LINE__;
> +}
> +EOT
> +
> +# - a patch which changes lines added by an earlier patch doesn't apply to the
> +# original source on its own, but the combined patch does
> +
> +start_test "patch which depends on an earlier one"
> +
> +add_patch 0001-foo.patch <<'EOT'
> +--- a/drivers/foo/foo.c
> ++++ b/drivers/foo/foo.c
> +@@ -1,6 +1,8 @@
> + int foo(int x)
> + {
> ++ if (!x)
> ++ return 0;
> + if (x < 0)
> + return -1;
> + return x;
> + }
> +EOT
[Severity: Low]
In tools/testing/selftests/livepatch/test_klp_build/test-basic.sh, the
script already calls setup_tree, creates the identical drivers/foo/foo.c
via add_file, and defines the identical 0001-foo.patch via add_patch.
Since run_klp_build() in functions.sh leaves $TREE unmodified between
invocations and supports running multiple start_test cases sequentially in
a single script, should this dependent-patch test case be added to
test-basic.sh instead of duplicating the setup in a new standalone
test-dependent-patches.sh file?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261017002441.716615-1-song@kernel.org?part=4
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-10-17 0:30 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-17 0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
2026-10-17 0:24 ` [PATCH 01/11] klp-build: Fix dependent patches in a series Song Liu
2026-10-17 0:24 ` [PATCH 02/11] klp-build: Add --patch-only option Song Liu
2026-10-17 0:24 ` [PATCH 03/11] selftests/livepatch: Add tests for klp-build's patch handling Song Liu
2026-10-17 0:24 ` [PATCH 04/11] selftests/livepatch: Test klp-build with dependent patches Song Liu
2026-10-17 0:30 ` sashiko-bot
2026-10-17 0:24 ` [PATCH 05/11] selftests/livepatch: Test klp-build with patches to different functions Song Liu
2026-10-17 0:24 ` [PATCH 06/11] selftests/livepatch: Test klp-build with patches which cancel out Song Liu
2026-10-17 0:24 ` [PATCH 07/11] selftests/livepatch: Test klp-build with created and deleted files Song Liu
2026-10-17 0:24 ` [PATCH 08/11] selftests/livepatch: Test where klp-build adds #line directives Song Liu
2026-10-17 0:24 ` [PATCH 09/11] selftests/livepatch: Test klp-build's rejection of unsupported files Song Liu
2026-10-17 0:24 ` [PATCH 10/11] selftests/livepatch: Test klp-build with patches which don't apply Song Liu
2026-10-17 0:24 ` [PATCH 11/11] selftests/livepatch: Test klp-build with patches which need offset or fuzz Song Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox