diff options
author | Joe Lawrence <joe.lawrence@redhat.com> | 2017-10-13 15:08:43 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-10-19 04:09:01 -0400 |
commit | af026796054fb70439e919a925615e61b500ef6b (patch) | |
tree | b8166bee3c59d71ea7802e84a6c8ad7c0957cf11 /kernel/livepatch | |
parent | 6116c3033a761611b1da980ea664c6ddff3eaed6 (diff) |
livepatch: add transition notices
Log a few kernel debug messages at the beginning of the following livepatch
transition functions:
klp_complete_transition()
klp_cancel_transition()
klp_init_transition()
klp_reverse_transition()
Also update the log notice message in klp_start_transition() for similar
verbiage as the above messages.
Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'kernel/livepatch')
-rw-r--r-- | kernel/livepatch/transition.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index 53887f0bca10..56add6327736 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c | |||
@@ -82,6 +82,10 @@ static void klp_complete_transition(void) | |||
82 | unsigned int cpu; | 82 | unsigned int cpu; |
83 | bool immediate_func = false; | 83 | bool immediate_func = false; |
84 | 84 | ||
85 | pr_debug("'%s': completing %s transition\n", | ||
86 | klp_transition_patch->mod->name, | ||
87 | klp_target_state == KLP_PATCHED ? "patching" : "unpatching"); | ||
88 | |||
85 | if (klp_target_state == KLP_UNPATCHED) { | 89 | if (klp_target_state == KLP_UNPATCHED) { |
86 | /* | 90 | /* |
87 | * All tasks have transitioned to KLP_UNPATCHED so we can now | 91 | * All tasks have transitioned to KLP_UNPATCHED so we can now |
@@ -163,6 +167,9 @@ void klp_cancel_transition(void) | |||
163 | if (WARN_ON_ONCE(klp_target_state != KLP_PATCHED)) | 167 | if (WARN_ON_ONCE(klp_target_state != KLP_PATCHED)) |
164 | return; | 168 | return; |
165 | 169 | ||
170 | pr_debug("'%s': canceling patching transition, going to unpatch\n", | ||
171 | klp_transition_patch->mod->name); | ||
172 | |||
166 | klp_target_state = KLP_UNPATCHED; | 173 | klp_target_state = KLP_UNPATCHED; |
167 | klp_complete_transition(); | 174 | klp_complete_transition(); |
168 | } | 175 | } |
@@ -441,7 +448,8 @@ void klp_start_transition(void) | |||
441 | 448 | ||
442 | WARN_ON_ONCE(klp_target_state == KLP_UNDEFINED); | 449 | WARN_ON_ONCE(klp_target_state == KLP_UNDEFINED); |
443 | 450 | ||
444 | pr_notice("'%s': %s...\n", klp_transition_patch->mod->name, | 451 | pr_notice("'%s': starting %s transition\n", |
452 | klp_transition_patch->mod->name, | ||
445 | klp_target_state == KLP_PATCHED ? "patching" : "unpatching"); | 453 | klp_target_state == KLP_PATCHED ? "patching" : "unpatching"); |
446 | 454 | ||
447 | /* | 455 | /* |
@@ -497,6 +505,9 @@ void klp_init_transition(struct klp_patch *patch, int state) | |||
497 | */ | 505 | */ |
498 | klp_target_state = state; | 506 | klp_target_state = state; |
499 | 507 | ||
508 | pr_debug("'%s': initializing %s transition\n", patch->mod->name, | ||
509 | klp_target_state == KLP_PATCHED ? "patching" : "unpatching"); | ||
510 | |||
500 | /* | 511 | /* |
501 | * If the patch can be applied or reverted immediately, skip the | 512 | * If the patch can be applied or reverted immediately, skip the |
502 | * per-task transitions. | 513 | * per-task transitions. |
@@ -562,6 +573,11 @@ void klp_reverse_transition(void) | |||
562 | unsigned int cpu; | 573 | unsigned int cpu; |
563 | struct task_struct *g, *task; | 574 | struct task_struct *g, *task; |
564 | 575 | ||
576 | pr_debug("'%s': reversing transition from %s\n", | ||
577 | klp_transition_patch->mod->name, | ||
578 | klp_target_state == KLP_PATCHED ? "patching to unpatching" : | ||
579 | "unpatching to patching"); | ||
580 | |||
565 | klp_transition_patch->enabled = !klp_transition_patch->enabled; | 581 | klp_transition_patch->enabled = !klp_transition_patch->enabled; |
566 | 582 | ||
567 | klp_target_state = !klp_target_state; | 583 | klp_target_state = !klp_target_state; |