From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757770AbcH2PXd (ORCPT ); Mon, 29 Aug 2016 11:23:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:51287 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757421AbcH2PXc (ORCPT ); Mon, 29 Aug 2016 11:23:32 -0400 Date: Mon, 29 Aug 2016 17:23:30 +0200 From: Petr Mladek To: Chris J Arges Cc: live-patching@vger.kernel.org, Josh Poimboeuf , Jessica Yu , Jiri Kosina , Miroslav Benes , linux-kernel@vger.kernel.org Subject: Re: [PATCH] livepatch: add load/unload hooks to objects Message-ID: <20160829152330.GN4866@pathway.suse.cz> References: <1472237448-22270-1-git-send-email-chris.j.arges@canonical.com> <1472237448-22270-2-git-send-email-chris.j.arges@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1472237448-22270-2-git-send-email-chris.j.arges@canonical.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2016-08-26 13:50:27, Chris J Arges wrote: > It can be useful to execute hook functions whenever a livepatch is applied > or unapplied to a particular object. Currently this is possible by writing > logic in the __init function of the livepatch kernel module. However to > handle executing functions when a module loads requires an additional > module notifier to be set up with the correct priority. > > By using load/unload hooks we can execute these functions using the > existing livepatch notifier infrastructure and ensure consistent ordering > of notifications. > > The load hook executes right before enabling functions, and the unload hook > executes right after disabling functions. Could you please provide an example(s), what these hooks will be useful for? The callbacks will still need to be implemented in the patch module. If they are generally useful, it would make sense to implement them in the livepatch code directly, so they get more review and are shared. Best Regards, Petr