]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - include/linux/livepatch.h
livepatch: Use lists to manage patches, objects and functions
authorJason Baron <jbaron@akamai.com>
Wed, 9 Jan 2019 12:43:24 +0000 (13:43 +0100)
committerJiri Kosina <jkosina@suse.cz>
Fri, 11 Jan 2019 19:51:24 +0000 (20:51 +0100)
commit20e55025958e18e671d92c7adea00c301ac93c43
tree3c2a116fee563aa31fd637a34d28fb6254885568
parent958ef1e39d24d6cb8bf2a7406130a98c9564230f
livepatch: Use lists to manage patches, objects and functions

Currently klp_patch contains a pointer to a statically allocated array of
struct klp_object and struct klp_objects contains a pointer to a statically
allocated array of klp_func. In order to allow for the dynamic allocation
of objects and functions, link klp_patch, klp_object, and klp_func together
via linked lists. This allows us to more easily allocate new objects and
functions, while having the iterator be a simple linked list walk.

The static structures are added to the lists early. It allows to add
the dynamically allocated objects before klp_init_object() and
klp_init_func() calls. Therefore it reduces the further changes
to the code.

This patch does not change the existing behavior.

Signed-off-by: Jason Baron <jbaron@akamai.com>
[pmladek@suse.com: Initialize lists before init calls]
Signed-off-by: Petr Mladek <pmladek@suse.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Jiri Kosina <jikos@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
include/linux/livepatch.h
kernel/livepatch/core.c