<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/testing/selftests/livepatch, branch v6.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-01-27T10:41:28Z</updated>
<entry>
<title>selftests: livepatch: handle PRINTK_CALLER in check_result()</title>
<updated>2025-01-27T10:41:28Z</updated>
<author>
<name>Madhavan Srinivasan</name>
<email>maddy@linux.ibm.com</email>
</author>
<published>2025-01-19T16:32:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28aecef5b1015bf6023ddc12b1a67f6678271fcb'/>
<id>urn:sha1:28aecef5b1015bf6023ddc12b1a67f6678271fcb</id>
<content type='text'>
Some arch configs (like ppc64) enable CONFIG_PRINTK_CALLER,
which adds the caller id as part of the dmesg. With recent
util-linux's update 467a5b3192f16 ('dmesg: add caller_id support')
the standard "dmesg" has been enhanced to print PRINTK_CALLER fields.

Due to this, even though the expected vs observed are same,
end testcase results are failed.

 -% insmod test_modules/test_klp_livepatch.ko
 -livepatch: enabling patch 'test_klp_livepatch'
 -livepatch: 'test_klp_livepatch': initializing patching transition
 -livepatch: 'test_klp_livepatch': starting patching transition
 -livepatch: 'test_klp_livepatch': completing patching transition
 -livepatch: 'test_klp_livepatch': patching complete
 -% echo 0 &gt; /sys/kernel/livepatch/test_klp_livepatch/enabled
 -livepatch: 'test_klp_livepatch': initializing unpatching transition
 -livepatch: 'test_klp_livepatch': starting unpatching transition
 -livepatch: 'test_klp_livepatch': completing unpatching transition
 -livepatch: 'test_klp_livepatch': unpatching complete
 -% rmmod test_klp_livepatch
 +[   T3659] % insmod test_modules/test_klp_livepatch.ko
 +[   T3682] livepatch: enabling patch 'test_klp_livepatch'
 +[   T3682] livepatch: 'test_klp_livepatch': initializing patching transition
 +[   T3682] livepatch: 'test_klp_livepatch': starting patching transition
 +[    T826] livepatch: 'test_klp_livepatch': completing patching transition
 +[    T826] livepatch: 'test_klp_livepatch': patching complete
 +[   T3659] % echo 0 &gt; /sys/kernel/livepatch/test_klp_livepatch/enabled
 +[   T3659] livepatch: 'test_klp_livepatch': initializing unpatching transition
 +[   T3659] livepatch: 'test_klp_livepatch': starting unpatching transition
 +[    T789] livepatch: 'test_klp_livepatch': completing unpatching transition
 +[    T789] livepatch: 'test_klp_livepatch': unpatching complete
 +[   T3659] % rmmod test_klp_livepatch

  ERROR: livepatch kselftest(s) failed
 not ok 1 selftests: livepatch: test-livepatch.sh # exit=1

Currently the check_result() handles the "[time]" removal from
the dmesg. Enhance the check to also handle removal of "[Thread Id]"
or "[CPU Id]".

Signed-off-by: Madhavan Srinivasan &lt;maddy@linux.ibm.com&gt;
Acked-by: Miroslav Benes &lt;mbenes@suse.cz&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Tested-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20250119163238.749847-1-maddy@linux.ibm.com
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-6.14/selftests-trivial' into for-linus</title>
<updated>2025-01-20T13:25:01Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2025-01-20T13:25:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=49dcb50d6ce33320c28f572f90a9bb9c33d92042'/>
<id>urn:sha1:49dcb50d6ce33320c28f572f90a9bb9c33d92042</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selftests: livepatch: add test cases of stack_order sysfs interface</title>
<updated>2024-12-09T10:47:21Z</updated>
<author>
<name>Wardenjohn</name>
<email>zhangwarden@gmail.com</email>
</author>
<published>2024-10-24T08:35:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ed2ec63d3faa4a3fda0dbf7cca93a9d0d9793100'/>
<id>urn:sha1:ed2ec63d3faa4a3fda0dbf7cca93a9d0d9793100</id>
<content type='text'>
Add selftest test cases to sysfs attribute 'stack_order'.

Suggested-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Wardenjohn &lt;zhangwarden@gmail.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Tested-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20241024083530.58775-1-zhangwarden@gmail.com
[pmladek@suse.com: Substitute $SYSFS_KLP_DIR]
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>selftests/livepatch: Replace hardcoded module name with variable in test-callbacks.sh</title>
<updated>2024-12-09T10:12:43Z</updated>
<author>
<name>George Guo</name>
<email>guodongtai@kylinos.cn</email>
</author>
<published>2024-11-25T11:28:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=477fb0671feb7b51fed9a803aeafa64d66cf6101'/>
<id>urn:sha1:477fb0671feb7b51fed9a803aeafa64d66cf6101</id>
<content type='text'>
Replaced the hardcoded module name test_klp_callbacks_demo in the
pre_patch_callback log message with the variable $MOD_LIVEPATCH.

Signed-off-by: George Guo &lt;guodongtai@kylinos.cn&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20241125112812.281018-2-dongtai.guo@linux.dev
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>selftests: livepatch: test livepatching a kprobed function</title>
<updated>2024-10-22T15:13:11Z</updated>
<author>
<name>Michael Vetter</name>
<email>mvetter@suse.com</email>
</author>
<published>2024-10-17T20:01:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=62597edf6340191511bdf9a7f64fa315ddc58805'/>
<id>urn:sha1:62597edf6340191511bdf9a7f64fa315ddc58805</id>
<content type='text'>
The test proves that a function that is being kprobed and uses a
post_handler cannot be livepatched.

Only one ftrace_ops with FTRACE_OPS_FL_IPMODIFY set may be registered
to any given function at a time.

Note that the conflicting kprobe could not be created using the
tracefs interface, see Documentation/trace/kprobetrace.rst.
This interface uses only the pre_handler(), see alloc_trace_kprobe().
But FTRACE_OPS_FL_IPMODIFY is used only when the kprobe is using a
post_handler, see arm_kprobe_ftrace().

Signed-off-by: Michael Vetter &lt;mvetter@suse.com&gt;
Reviewed-by: Miroslav Benes &lt;mbenes@suse.cz&gt;
Reviewed-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Tested-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Tested-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20241017200132.21946-4-mvetter@suse.com
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>selftests: livepatch: save and restore kprobe state</title>
<updated>2024-10-22T15:13:11Z</updated>
<author>
<name>Michael Vetter</name>
<email>mvetter@suse.com</email>
</author>
<published>2024-10-17T20:01:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59766286b6e54f8ad334dcef7d2e743b7550df0e'/>
<id>urn:sha1:59766286b6e54f8ad334dcef7d2e743b7550df0e</id>
<content type='text'>
Save the state of /sys/kernel/debug/kprobes/enabled
during setup_config() and restore it during cleanup().

This is in preparation for a future commit that will add a test
that should confirm that we cannot livepatch a kprobed function
if that kprobe has a post handler.

Signed-off-by: Michael Vetter &lt;mvetter@suse.com&gt;
Reviewed-by: Miroslav Benes &lt;mbenes@suse.cz&gt;
Reviewed-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Tested-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Tested-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20241017200132.21946-3-mvetter@suse.com
[pmladek@suse.com: Added few more substitutions in test-syscall.sh]
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR</title>
<updated>2024-10-22T15:12:46Z</updated>
<author>
<name>Michael Vetter</name>
<email>mvetter@suse.com</email>
</author>
<published>2024-10-17T20:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=637c730998b8f440dc5d0c6bae254fbf19143ea4'/>
<id>urn:sha1:637c730998b8f440dc5d0c6bae254fbf19143ea4</id>
<content type='text'>
This naming makes more sense according to the directory structure.
Especially when we later add more paths.

Addtionally replace `/sys/kernel/livepatch` with `$SYSFS_KLP_DIR` in
the livepatch test files.

Signed-off-by: Michael Vetter &lt;mvetter@suse.com&gt;
Reviewed-by: Miroslav Benes &lt;mbenes@suse.cz&gt;
Reviewed-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Tested-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Tested-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20241017200132.21946-2-mvetter@suse.com
[pmladek@suse.com: Fix corrupted substitution]
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>selftests/livepatch: wait for atomic replace to occur</title>
<updated>2024-08-26T12:52:25Z</updated>
<author>
<name>Ryan Sullivan</name>
<email>rysulliv@redhat.com</email>
</author>
<published>2024-08-22T17:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=052f3951640fd96d2e777b3272a925ec6c0c8100'/>
<id>urn:sha1:052f3951640fd96d2e777b3272a925ec6c0c8100</id>
<content type='text'>
On some machines with a large number of CPUs there is a sizable delay
between an atomic replace occurring and when sysfs updates accordingly.
This fix uses 'loop_until' to wait for the atomic replace to unload all
previous livepatches.

Reported-by: CKI Project &lt;cki-project@redhat.com&gt;
Closes: https://datawarehouse.cki-project.org/kcidb/tests/redhat:1413102084-x86_64-kernel_upt_28
Signed-off-by: Ryan Sullivan &lt;rysulliv@redhat.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Acked-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Link: https://lore.kernel.org/r/20240822173122.14760-1-rysulliv@redhat.com
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-6.11/sysfs-patch-replace' into for-linus</title>
<updated>2024-07-23T15:13:10Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2024-07-23T15:13:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ea5377ec49f29baaf50cbffa986a8ae667b7eaff'/>
<id>urn:sha1:ea5377ec49f29baaf50cbffa986a8ae667b7eaff</id>
<content type='text'>
</content>
</entry>
<entry>
<title>selftests/livepatch: Add selftests for "replace" sysfs attribute</title>
<updated>2024-07-02T14:56:18Z</updated>
<author>
<name>Yafang Shao</name>
<email>laoar.shao@gmail.com</email>
</author>
<published>2024-06-25T15:11:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=40f9caa7b171d088b8244db280495402fd416c55'/>
<id>urn:sha1:40f9caa7b171d088b8244db280495402fd416c55</id>
<content type='text'>
Add selftests for both atomic replace and non atomic replace
livepatches. The result is as follows,

  TEST: sysfs test ... ok
  TEST: sysfs test object/patched ... ok
  TEST: sysfs test replace enabled ... ok
  TEST: sysfs test replace disabled ... ok

Suggested-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Signed-off-by: Yafang Shao &lt;laoar.shao@gmail.com&gt;
Tested-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Acked-by: Miroslav Benes &lt;mbenes@suse.cz&gt;
Link: https://lore.kernel.org/r/20240625151123.2750-3-laoar.shao@gmail.com
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
</feed>
