livepatch: introduce shadow variable API
Add exported API for livepatch modules: klp_shadow_get() klp_shadow_alloc() klp_shadow_get_or_alloc() klp_shadow_free() klp_shadow_free_all() that implement "shadow" variables, which allow callers to associate new shadow fields to existing data structures. This is intended to be used by livepatch modules seeking to emulate additions to data structure definitions. See Documentation/livepatch/shadow-vars.txt for a summary of the new shadow variable API, including a few common use cases. See samples/livepatch/livepatch-shadow-* for example modules that demonstrate shadow variables. [jkosina@suse.cz: fix __klp_shadow_get_or_alloc() comment as spotted by Josh] Signed-off-by:Joe Lawrence <joe.lawrence@redhat.com> Acked-by:
Josh Poimboeuf <jpoimboe@redhat.com> Acked-by:
Miroslav Benes <mbenes@suse.cz> Signed-off-by:
Jiri Kosina <jkosina@suse.cz>
Showing
- Documentation/livepatch/shadow-vars.txt 192 additions, 0 deletionsDocumentation/livepatch/shadow-vars.txt
- include/linux/livepatch.h 8 additions, 0 deletionsinclude/linux/livepatch.h
- kernel/livepatch/Makefile 1 addition, 1 deletionkernel/livepatch/Makefile
- kernel/livepatch/shadow.c 277 additions, 0 deletionskernel/livepatch/shadow.c
- samples/Kconfig 2 additions, 3 deletionssamples/Kconfig
- samples/livepatch/Makefile 3 additions, 0 deletionssamples/livepatch/Makefile
- samples/livepatch/livepatch-shadow-fix1.c 173 additions, 0 deletionssamples/livepatch/livepatch-shadow-fix1.c
- samples/livepatch/livepatch-shadow-fix2.c 168 additions, 0 deletionssamples/livepatch/livepatch-shadow-fix2.c
- samples/livepatch/livepatch-shadow-mod.c 224 additions, 0 deletionssamples/livepatch/livepatch-shadow-mod.c
Loading
Please register or sign in to comment