livepatch/x86: add TIF_PATCH_PENDING thread flag
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 14 Feb 2017 01:42:31 +0000 (19:42 -0600)
committerJiri Kosina <jkosina@suse.cz>
Wed, 8 Mar 2017 08:19:41 +0000 (09:19 +0100)
commitafb94c9e0b413bbdea779192eaca076c43ede031
treedb2daa2ac7965176f149fd0cba58248c960dd10a
parent46c5a0113f843be5c55b1c40dd486538891156d4
livepatch/x86: add TIF_PATCH_PENDING thread flag

Add the TIF_PATCH_PENDING thread flag to enable the new livepatch
per-task consistency model for x86_64.  The bit getting set indicates
the thread has a pending patch which needs to be applied when the thread
exits the kernel.

The bit is placed in the _TIF_ALLWORK_MASK macro, which results in
exit_to_usermode_loop() calling klp_update_patch_state() when it's set.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Acked-by: Ingo Molnar <mingo@kernel.org> # for the x86 changes
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
arch/x86/entry/common.c
arch/x86/include/asm/thread_info.h