]> xenbits.xensource.com Git - xen.git/commit
livepatch: Add support for apply|revert action replacement hooks
authorPawel Wieczorkiewicz <wipawel@amazon.de>
Tue, 26 Nov 2019 10:07:54 +0000 (10:07 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 13 Dec 2019 14:45:32 +0000 (14:45 +0000)
commitef87efee9d38b61624f25c1a056d386a70ba99aa
tree097482ea50166bef05d9741a981a90b8cdc1c332
parent8313c864fa95074c2176f19af711b7e13bf20504
livepatch: Add support for apply|revert action replacement hooks

By default, in the quiescing zone, a livepatch payload is applied with
apply_payload() and reverted with revert_payload() functions. Both of
the functions receive the payload struct pointer as a parameter. The
functions are also a place where standard 'load' and 'unload' module
hooks are executed.

To increase livepatching system's agility and provide more flexible
long-term livepatch solution, allow to overwrite the default apply
and revert action functions with hook-like supplied alternatives.
The alternative functions are optional and the default functions are
used by default.

Since the alternative functions have direct access to the livepatch
payload structure, they can better control context of the 'load' and
'unload' hooks execution as well as exact instructions replacement
workflows. They can be also easily extended to support extra features
in the future.

To simplify the alternative function generation move code responsible
for payload and livepatch region registration outside of the function.
That way it is guaranteed that the registration step occurs even for
newly supplied functions.

Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Petre Eftime <epetre@amazon.com>
Reviewed-by: Martin Pohlack <mpohlack@amazon.com>
Reviewed-by: Norbert Manthey <nmanthey@amazon.com>
Reviewed-by: Andra-Irina Paraschiv <andraprs@amazon.com>
Reviewed-by: Bjoern Doebel <doebel@amazon.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
docs/misc/livepatch.pandoc
xen/common/livepatch.c
xen/include/xen/livepatch_payload.h
xen/test/livepatch/Makefile
xen/test/livepatch/xen_action_hooks.c [new file with mode: 0644]