Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752252AbdHHTgO (ORCPT ); Tue, 8 Aug 2017 15:36:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56500 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752145AbdHHTgM (ORCPT ); Tue, 8 Aug 2017 15:36:12 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 421012FFC41 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=joe.lawrence@redhat.com From: Joe Lawrence To: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Josh Poimboeuf , Jessica Yu , Jiri Kosina , Miroslav Benes , Petr Mladek , Chris J Arges Subject: [PATCH v2 0/1] add (un)patch callbacks Date: Tue, 8 Aug 2017 15:36:06 -0400 Message-Id: <1502220967-21410-1-git-send-email-joe.lawrence@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 08 Aug 2017 19:36:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1570 Lines: 41 Hi folks, This is v2 of the livepatch (un)patch hook/notifier/callback/etc code. The documentation is still a little rough, but I wanted to post up the code for feedback before getting too far in revising it. This implements the pre and post handlers as Josh suggested. See summary of related changes below... v2: - s/hooks/callbacks/g - implemented pre-(un)patch and post-(un)patch callbacks - pre-patch and pre-unpatch callbacks run from callers of klp_patch_object() and klp_unpatch_object() - post-patch and post-unpatch callbacks run from klp_complete_transition() and klp_module_coming/going() - reduce callbacks from a list to a single per-klp_object instance - revamp the sample callback demo - revamp documentation Feedback appreciated as always. Joe Lawrence (1): livepatch: add (un)patch callbacks Documentation/livepatch/callbacks.txt | 75 +++++++++++ include/linux/livepatch.h | 38 ++++++ kernel/livepatch/core.c | 30 ++++- kernel/livepatch/patch.c | 5 +- kernel/livepatch/transition.c | 19 ++- samples/livepatch/Makefile | 2 + samples/livepatch/livepatch-callbacks-demo.c | 180 +++++++++++++++++++++++++++ samples/livepatch/livepatch-callbacks-mod.c | 53 ++++++++ 8 files changed, 393 insertions(+), 9 deletions(-) create mode 100644 Documentation/livepatch/callbacks.txt create mode 100644 samples/livepatch/livepatch-callbacks-demo.c create mode 100644 samples/livepatch/livepatch-callbacks-mod.c -- 1.8.3.1