livepatch: separate enabled and patched states
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 14 Feb 2017 01:42:35 +0000 (19:42 -0600)
committerJiri Kosina <jkosina@suse.cz>
Wed, 8 Mar 2017 08:23:16 +0000 (09:23 +0100)
commit0dade9f374f1c15f9b43ab01ab75a3b459bba5f6
tree2ce5e295256b7be0a39df16284d8800baacac1bb
parent2f09ca60a56dd9c217d32d68340e1b08cbbe1ace
livepatch: separate enabled and patched states

Once we have a consistency model, patches and their objects will be
enabled and disabled at different times.  For example, when a patch is
disabled, its loaded objects' funcs can remain registered with ftrace
indefinitely until the unpatching operation is complete and they're no
longer in use.

It's less confusing if we give them different names: patches can be
enabled or disabled; objects (and their funcs) can be patched or
unpatched:

- Enabled means that a patch is logically enabled (but not necessarily
  fully applied).

- Patched means that an object's funcs are registered with ftrace and
  added to the klp_ops func stack.

Also, since these states are binary, represent them with booleans
instead of ints.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
include/linux/livepatch.h
kernel/livepatch/core.c