Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758167AbdHYTKJ (ORCPT ); Fri, 25 Aug 2017 15:10:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50824 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755682AbdHYTKH (ORCPT ); Fri, 25 Aug 2017 15:10:07 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9E5497F6BA Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.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 v4 0/3] livepatch callbacks Date: Fri, 25 Aug 2017 15:09:59 -0400 Message-Id: <1503688202-12121-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.25]); Fri, 25 Aug 2017 19:10:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2497 Lines: 64 v4: - Move callback helpers into core.h - Move klp_pre_patch_callback() and klp_pre_unpatch_callback() invocations into __klp_enable_patch() and __klp_disable_patch() - klp_patch_object() and klp_unpatch_objects() - Do not run pre-unpatch callbacks from here - Add a pre_patch_status member to klp_object so when a pre-patch callback fails, the helpers can skip any post-patch, pre-unpatch, post-unpatch callbacks - klp_module_coming() and klp_module_going() - Do not run post-patch or pre-unpatch callbacks for current klp_transition_patch - Documentation - Add various test cases and provide commentary - Samples - Create two target modules: a simple one and another that invokes a worker function that sleeps for a long time - Added two follow-up patches: - livepatch: move transition "complete" notice into klp_complete_transition() - this pushes the "patching complete" message after the post-patch callbacks - livepatch: add transition notices - these were helpful during debugging of the callback patch. The transaction annotations were also used in the Documentation file tese cases to illustrate the order of operations. Note that these two patches could be standalone, I include them here in this patchset since they affect the content/ordering of kernel logs that were included as part of the Documentation. Joe Lawrence (3): livepatch: add (un)patch callbacks livepatch: move transition "complete" notice into klp_complete_transition() livepatch: add transition notices Documentation/livepatch/callbacks.txt | 595 ++++++++++++++++++++++++ include/linux/livepatch.h | 18 + kernel/livepatch/core.c | 56 ++- kernel/livepatch/core.h | 78 ++++ kernel/livepatch/patch.c | 1 + kernel/livepatch/transition.c | 45 +- samples/livepatch/Makefile | 3 + samples/livepatch/livepatch-callbacks-busymod.c | 72 +++ samples/livepatch/livepatch-callbacks-demo.c | 234 ++++++++++ samples/livepatch/livepatch-callbacks-mod.c | 55 +++ 10 files changed, 1140 insertions(+), 17 deletions(-) create mode 100644 Documentation/livepatch/callbacks.txt create mode 100644 samples/livepatch/livepatch-callbacks-busymod.c create mode 100644 samples/livepatch/livepatch-callbacks-demo.c create mode 100644 samples/livepatch/livepatch-callbacks-mod.c -- 1.8.3.1