GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.kernel.org — System State Changes — The Linux Kernel documentation System State Changes¶Some users are really reluctant to reboot a system. This brings the need to provide more livepatches and maintain some compatibility between them. Maintaining more livepatches is much easier with cumulative livepatches. Each new livepatch completely replaces any older one. It can keep, add, and even remove fixes. And it is typically safe to replace any version of the livepatch with any other one thanks to the atomic replace feature. The problems might come with shadow variables and callbacks. They might change the system behavior or state so that it is no longer safe to go back and use an older livepatch or the original kernel code. Also any new livepatch must be able to detect what changes have already been done by the already installed livepatches. This is where the livepatch system state tracking gets useful. It allows to:
1. Livepatch system state API¶The state of the system might get modified either by several livepatch callbacks or by the newly used code. Also it must be possible to find changes done by already installed livepatches. Each modified state is described by struct klp_state, see include/linux/livepatch.h. Each livepatch defines an array of struct klp_states. They mention all states that the livepatch modifies. The livepatch author must define the following two fields for each struct klp_state:
The state can be manipulated using two functions:
2. Livepatch compatibility¶The system state version is used to prevent loading incompatible livepatches. The check is done when the livepatch is enabled. The rules are:
3. Supported scenarios¶Livepatches have their life-cycle and the same is true for the system state changes. Every compatible livepatch has to support the following scenarios:
4. Expected usage¶System states are usually modified by livepatch callbacks. The expected role of each callback is as follows: pre_patch()
post_patch()
pre_unpatch()
post_unpatch()
Note pre_unpatch() typically does symmetric operations to post_patch(). Except that it is called only when the livepatch is being disabled. Therefore it does not need to care about any previously installed livepatch. post_unpatch() typically does symmetric operations to pre_patch(). It might be called also during the transition reverse. Therefore it has to handle the state of the previously installed livepatches. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |