[PATCH v4 0/3] livepatch callbacks

From: Joe Lawrence
Date: Fri Aug 25 2017 - 15:10:14 EST


v4:

- Move callback helpers into core.h

- Move klp_pre_patch_callback() and klp_pre_unpatch_callback()
invocations into __klp_enable_patch() and __klp_disable_patch()

- klp_patch_object() and klp_unpatch_objects()
- Do not run pre-unpatch callbacks from here

- Add a pre_patch_status member to klp_object so when a pre-patch
callback fails, the helpers can skip any post-patch, pre-unpatch,
post-unpatch callbacks

- klp_module_coming() and klp_module_going()
- Do not run post-patch or pre-unpatch callbacks for current
klp_transition_patch

- Documentation
- Add various test cases and provide commentary

- Samples
- Create two target modules: a simple one and another that invokes a
worker function that sleeps for a long time

- Added two follow-up patches:

- livepatch: move transition "complete" notice into
klp_complete_transition() - this pushes the "patching complete" message
after the post-patch callbacks

- livepatch: add transition notices - these were helpful during
debugging of the callback patch. The transaction annotations were
also used in the Documentation file tese cases to illustrate the
order of operations.

Note that these two patches could be standalone, I include them here
in this patchset since they affect the content/ordering of kernel logs
that were included as part of the Documentation.

Joe Lawrence (3):
livepatch: add (un)patch callbacks
livepatch: move transition "complete" notice into
klp_complete_transition()
livepatch: add transition notices

Documentation/livepatch/callbacks.txt | 595 ++++++++++++++++++++++++
include/linux/livepatch.h | 18 +
kernel/livepatch/core.c | 56 ++-
kernel/livepatch/core.h | 78 ++++
kernel/livepatch/patch.c | 1 +
kernel/livepatch/transition.c | 45 +-
samples/livepatch/Makefile | 3 +
samples/livepatch/livepatch-callbacks-busymod.c | 72 +++
samples/livepatch/livepatch-callbacks-demo.c | 234 ++++++++++
samples/livepatch/livepatch-callbacks-mod.c | 55 +++
10 files changed, 1140 insertions(+), 17 deletions(-)
create mode 100644 Documentation/livepatch/callbacks.txt
create mode 100644 samples/livepatch/livepatch-callbacks-busymod.c
create mode 100644 samples/livepatch/livepatch-callbacks-demo.c
create mode 100644 samples/livepatch/livepatch-callbacks-mod.c

--
1.8.3.1