Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530AbdG1RZ1 (ORCPT ); Fri, 28 Jul 2017 13:25:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56128 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbdG1RZ0 (ORCPT ); Fri, 28 Jul 2017 13:25:26 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2CEA44D2D7 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.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 Subject: [PATCH v3] livepatch: shadow variables Date: Fri, 28 Jul 2017 13:25:21 -0400 Message-Id: <1501262722-26502-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.30]); Fri, 28 Jul 2017 17:25:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2199 Lines: 64 Hi all, This is v3 of the livepatch shadow variable API. v2 collected a bunch of great feedback on terminology, use cases and concurrency notes which I've tried to incorporate here. Here's a high-level sketch of v2 changes: - Overall - Squash into a one patch, makes for finding terms and code across docs/implementation/example easier - Variable naming: - obj, original data -> obj, parent object - num, numerical description of new data -> id, data identifier - new_data -> data - new_size -> size - Documentation - API summary: s/klp_shadow_detach/klp_shadow_detach_all - describe uses for the data id (versions, class/type, etc) - clarify that shadow data is a copy - fix use-cases - use one upstream commit and steal Petr's example for klp_shadow_get_or_attach() - Implementation - Modify klp_shadow_get_or_attach() to WARN and return NULL if shadow variable already exists - Add klp_shadow_update_or_attach() to update if shadow variable already exists - Sample modules - s/_thread/_work_func - use system workqueue, DECLARE_DELAYED_WORK - use XXX_PERIOD constants - overhaul usage/comments, drop the verbose dmesg logs Joe Lawrence (1): livepatch: introduce shadow variable API Documentation/livepatch/shadow-vars.txt | 217 +++++++++++++++++ include/linux/livepatch.h | 10 + kernel/livepatch/Makefile | 2 +- kernel/livepatch/shadow.c | 383 ++++++++++++++++++++++++++++++ samples/Kconfig | 5 +- samples/livepatch/Makefile | 3 + samples/livepatch/livepatch-shadow-mod.c | 222 +++++++++++++++++ samples/livepatch/livepatch-shadow-fix1.c | 174 ++++++++++++++ samples/livepatch/livepatch-shadow-fix2.c | 167 +++++++++++++ 9 files changed, 1179 insertions(+), 4 deletions(-) create mode 100644 Documentation/livepatch/shadow-vars.txt create mode 100644 kernel/livepatch/shadow.c create mode 100644 samples/livepatch/livepatch-shadow-mod.c create mode 100644 samples/livepatch/livepatch-shadow-fix1.c create mode 100644 samples/livepatch/livepatch-shadow-fix2.c -- 1.8.3.1