Skip to content

livepatch: new API to track system state changes

Petr Mladek live-patching lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 2 repliesIn review
  2. v35 patches 6 repliesSuperseded
  3. v25 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC5 patches14 repliesSuperseded

Changes in v4 from the cover letter

+ selftests compilation error [kbuild test robot]
+ fix copyright in selftests [Joe]
+ used macros for the module names in selftests [Joe]
+ allow zero state version [Josh]
+ slightly refactor the code for checking state version [Josh]
+ fix few typos reported by checkpatch.pl [Petr]
+ added Acks [Joe]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5livepatch: Keep replaced patches until post_patch callback is calledkernel/livepatch/core.c kernel/livepatch/core.h kernel/livepatch/transition.c+35 -180 replies
2/5livepatch: Basic API to track system state changesinclude/linux/livepatch.h kernel/livepatch/Makefile kernel/livepatch/state.c+99 -10 replies
3/5livepatch: Allow to distinguish different version of system state changesinclude/linux/livepatch.h kernel/livepatch/core.c kernel/livepatch/state.c +1 more+55 -00 replies
4/5livepatch: Documentation of the new API for tracking system state changesDocumentation/livepatch/index.rst Documentation/livepatch/system-state.rst+168 -00 replies
5/5livepatch: Selftests of the API for tracking system state changeslib/livepatch/Makefile lib/livepatch/test_klp_state.c lib/livepatch/test_klp_state2.c +3 more+544 -20 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMiroslav BenesJosh Poimboeuf
SeriesA-b
1/5A-b
2/5A-b
3/5A-b
4/5A-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/5] livepatch: new API to track system state changes

Hi,

this is another piece in the puzzle that helps to maintain more livepatches.

Especially pre/post (un)patch callbacks might change a system state. Any newly installed livepatch has to somehow deal with system state modifications done be already installed livepatches.

This patchset provides a simple and generic API that helps to keep and pass information between the livepatches. It is also usable to prevent loading incompatible livepatches.

Changes since v3:

+ selftests compilation error [kbuild test robot]
+ fix copyright in selftests [Joe]
+ used macros for the module names in selftests [Joe]
+ allow zero state version [Josh]
+ slightly refactor the code for checking state version [Josh]
+ fix few typos reported by checkpatch.pl [Petr]
+ added Acks [Joe]

Changes since v2:

+ Typo fixes [Miroslav]
+ Move the documentation at the end of the list [Miroslav]
+ Add Miroslav's acks

Changes since v1:

+ Use "unsigned long" instead of "int" for "state.id" [Nicolai]
+ Use "unsigned int" instead of "int" for "state.version [Petr]
+ Include "state.h" to avoid warning about non-static func [Miroslav]
+ Simplify logic in klp_is_state_compatible() [Miroslav]
+ Document how livepatches should handle the state [Nicolai]
+ Fix some typos, formulation, module metadata [Joe, Miroslav]

Petr Mladek (5):
livepatch: Keep replaced patches until post_patch callback is called
livepatch: Basic API to track system state changes
livepatch: Allow to distinguish different version of system state
changes
livepatch: Documentation of the new API for tracking system state
changes
livepatch: Selftests of the API for tracking system state changes

 Documentation/livepatch/index.rst               |   1 +
 Documentation/livepatch/system-state.rst        | 167 +++++++++++++++++++++
 include/linux/livepatch.h                       |  17 +++
 kernel/livepatch/Makefile                       |   2 +-
 kernel/livepatch/core.c                         |  44 ++++--
 kernel/livepatch/core.h                         |   5 +-
 kernel/livepatch/state.c                        | 119 +++++++++++++++
 kernel/livepatch/state.h                        |   9 ++
 kernel/livepatch/transition.c                   |  12 +-
 lib/livepatch/Makefile                          |   5 +-
 lib/livepatch/test_klp_state.c                  | 162 ++++++++++++++++++++
 lib/livepatch/test_klp_state2.c                 | 191 ++++++++++++++++++++++++
 lib/livepatch/test_klp_state3.c                 |   5 +
 tools/testing/selftests/livepatch/Makefile      |   3 +-
 tools/testing/selftests/livepatch/test-state.sh | 180 ++++++++++++++++++++++
 15 files changed, 901 insertions(+), 21 deletions(-)
 create mode 100644 Documentation/livepatch/system-state.rst
 create mode 100644 kernel/livepatch/state.c
 create mode 100644 kernel/livepatch/state.h
 create mode 100644 lib/livepatch/test_klp_state.c
 create mode 100644 lib/livepatch/test_klp_state2.c
 create mode 100644 lib/livepatch/test_klp_state3.c
 create mode 100755 tools/testing/selftests/livepatch/test-state.sh
Signature · 1 line
2.16.4