Lines Matching +full:target +full:- +full:module
1 // SPDX-License-Identifier: GPL-2.0-or-later
7 * livepatch-callbacks-demo.c - (un)patching callbacks livepatch demo
11 * -------
17 * -----
19 * Step 1 - load the simple module
21 * insmod samples/livepatch/livepatch-callbacks-mod.ko
24 * Step 2 - load the demonstration livepatch (with callbacks)
26 * insmod samples/livepatch/livepatch-callbacks-demo.ko
29 * Step 3 - cleanup
36 * and patching operations for both vmlinux and module targets.
38 * NOTE: swap the insmod order of livepatch-callbacks-mod.ko and
39 * livepatch-callbacks-demo.ko to observe what happens when a
40 * target module is loaded after a livepatch with callbacks.
42 * NOTE: 'pre_patch_ret' is a module parameter that sets the pre-patch
43 * callback return status. Try setting up a non-zero status
44 * such as -19 (-ENODEV):
47 * insmod samples/livepatch/livepatch-callbacks-demo.ko
49 * # Setup next pre-patch callback to return -ENODEV
50 * echo -19 > /sys/module/livepatch_callbacks_demo/parameters/pre_patch_ret
52 * # Module loader refuses to load the target module
53 * insmod samples/livepatch/livepatch-callbacks-mod.ko
54 …* insmod: ERROR: could not insert module samples/livepatch/livepatch-callbacks-mod.ko: No su…
56 * NOTE: There is a second target module,
57 * livepatch-callbacks-busymod.ko, available for experimenting
58 * with livepatch (un)patch callbacks. This module contains
59 * a 'sleep_secs' parameter that parks the module on one of the
60 * functions that the livepatch demo module wants to patch.
61 * Modifying this value and tweaking the order of module loads can
64 * # Load a target module, let it park on 'busymod_work_func' for
66 * insmod samples/livepatch/livepatch-callbacks-busymod.ko sleep_secs=30
69 * insmod samples/livepatch/livepatch-callbacks-demo.ko
71 * # ... then load and unload another target module while the
73 * insmod samples/livepatch/livepatch-callbacks-mod.ko
74 * rmmod samples/livepatch/livepatch-callbacks-mod.ko
78 * rmmod samples/livepatch/livepatch-callbacks-demo.ko
83 #include <linux/module.h>
100 if (obj->mod) in callback_info()
101 pr_info("%s: %s -> %s\n", callback, obj->mod->name, in callback_info()
102 module_state[obj->mod->state]); in callback_info()