Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751462AbdILJ3Y (ORCPT ); Tue, 12 Sep 2017 05:29:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:34982 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751337AbdILJ3W (ORCPT ); Tue, 12 Sep 2017 05:29:22 -0400 Date: Tue, 12 Sep 2017 11:29:20 +0200 (CEST) From: Miroslav Benes To: Joe Lawrence cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Poimboeuf , Jessica Yu , Jiri Kosina , Petr Mladek , Chris J Arges Subject: Re: [PATCH v5 3/3] livepatch: add transition notices In-Reply-To: <1504191233-2642-4-git-send-email-joe.lawrence@redhat.com> Message-ID: References: <1504191233-2642-1-git-send-email-joe.lawrence@redhat.com> <1504191233-2642-4-git-send-email-joe.lawrence@redhat.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1729 Lines: 51 On Thu, 31 Aug 2017, Joe Lawrence wrote: > 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 > Signed-off-by: Joe Lawrence > --- > kernel/livepatch/transition.c | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c > index 53887f0bca10..3d44a3cf27be 100644 > --- a/kernel/livepatch/transition.c > +++ b/kernel/livepatch/transition.c > @@ -82,6 +82,10 @@ static void klp_complete_transition(void) > unsigned int cpu; > bool immediate_func = false; > > + pr_debug("'%s': completing %s transition\n", > + klp_transition_patch->mod->name, > + klp_target_state == KLP_PATCHED ? "patching" : "unpatching"); The only downside here is that you can get a message about starting patching transition and then a message about completing unpatching transition, because the patching failed and klp_cancel_transition() was called. I think we can live with that, because there would be a message from klp_cancel_transition() as well and hopefully no one would be confused. > @@ -163,6 +167,9 @@ void klp_cancel_transition(void) > if (WARN_ON_ONCE(klp_target_state != KLP_PATCHED)) > return; > > + pr_debug("'%s': canceling transition, unpatching\n", > + klp_transition_patch->mod->name); > + This one. Acked-by: Miroslav Benes Miroslav