Received: by 10.213.65.68 with SMTP id h4csp299812imn; Fri, 23 Mar 2018 05:04:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELswyNEgRNqhT8H3WQWmWnikH96TDAvmsSyDX5ynB/6nUv3EuTreSYFDDnMlZqCrVsXwCwNQ X-Received: by 10.101.82.10 with SMTP id o10mr2086435pgp.271.1521806644072; Fri, 23 Mar 2018 05:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521806644; cv=none; d=google.com; s=arc-20160816; b=hKrDHaQpnO1eQPj5nQYOseSA5ZUkBUkSIa7O8Sf3O72tE1spC89H4dzhPyAi1TOJsJ cK/v0I1d71h2fQ2Y1+kxWL8oR+jpdu181esVCyFqGH91qAZ+CLaYGvxfMcHpqodJGVjM VzH73mP4kOtsWtk+4PdECDI5BslUue7geb47CJw4RVx7XfeURcdZJ4+QoRRYL7sr/OZ1 yxjmfiQwJLRC9dIMdgEhJ9Lz35wHS3PwICfEYT2m0etYic5JfGSYdnQozRbjh48YucQg iWvSPVhOGliul7DX1gEj7PFLbLtlfN6e+GOoO+2MKsFjJMJwgcgOoebB7xwnt1uwiJx0 BAHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=hrQTpRXaiDHEXBXMNfMvT1xspuYXRqDKuxg7rqFRRtA=; b=RXM2xoN1Lh5pHNjeUj3jr9ExqpgTUfjyVwGdsTYX+OqC5MAic5PcElcIgQdZrv1Rhm 6Ep6ZIclZcf5dUowpewdIfPsBKBz47F4eOYwVqO3WrqLV1jB+dhPkY5QEBNdY92bXbWq T42dctb2zYhz6EGUZlCQJ9idcpVvOMY+VtEDOcEnBXx5bb/rMVfkOfQmU+h02q3KoczS m121N60yCkD32Boq07ys94emsmGuYr1xUWzPQIiZZHiCZ5EyrKuaofrKvgaA2C9oOVkY 4gSUl3i2DZ25KTqys2YcnmuQ6nnXuybjpJ13oyxjiTYPdGZVQx79XSEKjB/aSWlravGi JN/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si8602797plw.587.2018.03.23.05.03.49; Fri, 23 Mar 2018 05:04:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753903AbeCWMAs (ORCPT + 99 others); Fri, 23 Mar 2018 08:00:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:39530 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586AbeCWMAp (ORCPT ); Fri, 23 Mar 2018 08:00:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7571DAEA4; Fri, 23 Mar 2018 12:00:43 +0000 (UTC) From: Petr Mladek To: Jiri Kosina , Josh Poimboeuf , Miroslav Benes Cc: Jason Baron , Joe Lawrence , Jessica Yu , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH 0/8] livepatch: Atomic replace feature Date: Fri, 23 Mar 2018 13:00:20 +0100 Message-Id: <20180323120028.31451-1-pmladek@suse.com> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The atomic replace allows to create cumulative patches. They are useful when you maintain many livepatches and want to remove one that is lower on the stack. In addition it is very useful when more patches touch the same function and there are dependencies between them. This version is heavily refactored and cleaned based on feedback from Josh. There are actually only three functional changes. It still passes the first draft of the selfttest from Joe that can be found at https://lkml.kernel.org/r/1520881024-29386-1-git-send-email-joe.lawrence@redhat.com Changes against v10: + Bug fixes and functional changes: + Handle Nops in klp_ftrace_handled() to avoid infinite loop [Mirek] + Really add dynamically allocated klp_object into the list [Petr] + Clear patch->replace when transition finishes [Josh] + Refactoring and clean up [Josh]: + Replace enum types with bools + Avoid using ERR_PTR + Remove too paranoid warnings + Distinguish registered patches by a flag instead of a list + Squash some functions + Update comments, documentation, and commit messages + Squashed and split patches to do more controversial changes later Changes against v9: + Fixed check of valid NOPs for already loaded objects, regression introduced in v9 [Joe, Mirek] + Allow to replace even disabled patches [Evgenii] Changes against v8: + Fixed handling of statically defined struct klp_object with empty array of functions [Joe, Mirek] + Removed redundant func->new_func assignment for NOPs [Mirek] + Improved some wording [Mirek] Changes against v7: + Fixed handling of NOPs for not-yet-loaded modules + Made klp_replaced_patches list static [Mirek] + Made klp_free_object() public later [Mirek] + Fixed several reported typos [Mirek, Joe] + Updated documentation according to the feedback [Joe] + Added some Acks [Mirek] Changes against v6: + used list_move when disabling replaced patches [Jason] + renamed KLP_FUNC_ORIGINAL -> KLP_FUNC_STATIC [Mirek] + used klp_is_func_type() in klp_unpatch_object() [Mirek] + moved static definition of klp_get_or_add_object() [Mirek] + updated comment about synchronization in forced mode [Mirek] + added user documentation + fixed several typos Jason Baron (3): livepatch: Use lists to manage patches, objects and functions livepatch: Add atomic replace livepatch: Remove replaced patches from the stack Petr Mladek (5): livepatch: Free only structures with initialized kobject livepatch: Add an extra flag to distinguish registered patches livepatch: Remove Nop structures when unused livepatch: Allow to replace even disabled patches livepatch: Atomic replace and cumulative patches documentation Documentation/livepatch/cumulative-patches.txt | 105 ++++++++ include/linux/livepatch.h | 33 ++- kernel/livepatch/core.c | 355 ++++++++++++++++++++++--- kernel/livepatch/core.h | 4 + kernel/livepatch/patch.c | 39 ++- kernel/livepatch/patch.h | 1 + kernel/livepatch/transition.c | 27 ++ 7 files changed, 519 insertions(+), 45 deletions(-) create mode 100644 Documentation/livepatch/cumulative-patches.txt -- 2.13.6