Received: by 10.223.176.5 with SMTP id f5csp1604384wra; Wed, 31 Jan 2018 08:48:58 -0800 (PST) X-Google-Smtp-Source: AH8x226tN7yDyobHneUi2/tYbStuhP+2v7CJS+VPSKu6fcwEJRaqJJWU116kAX7+qTX+1VE5su5S X-Received: by 2002:a17:902:33c1:: with SMTP id b59-v6mr20023454plc.111.1517417337967; Wed, 31 Jan 2018 08:48:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517417337; cv=none; d=google.com; s=arc-20160816; b=qDIwhgpmlGTG5ZZ0MmmuW64end24RiF5cPvvoZXWMj9e/nOKU6h23sD0VApMzWUuQV FJy5RvKPsw6E4xP1EULNF5A101vIexL6DESqZbd5cW3mg2hGKxqBynz6wHu6Bu5GyBQN nxWucrrByUWwMLVNjbZH+CsqwJSpPoR1BHmsTIkPIIEuA1IpXzfXvw2fC5r0Xyy9AjKX 2BF5GoB9VYJ4oiNodhBMyYQV02NGSScvxHgzNCBaNzBMD45ke1JYdq9Ea6D05ZLdcDL+ XtN9uijl9CkabvMwTn3MESUgAhyyNJm+S2SfUDY2KUOCYlq7ZnUSYolst4vD1cbBi8pN lq4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=WYvnUR0sRUlZU2Mv8cgs7+axt/8GOyajf7y9Dhf1vAs=; b=UrG94YYoe5zf4tZHXCndBY8uYJPTUGowLdDdEFDyX2PrS1BFne+JEGSABUF0I6gxGK /J48qb+oGLGpfjE2X1Si1SjxGB7M64XIOm4Gg6f6a+aeJVhx4u+/q9VBgXzyz6f1xNLv BKSkeHEgy0L/+hegm/tPgLBSw3qAooWPaFOq97lBDtSfckQnObUeohmD63KJYW51VIh4 HuWsNmVrDEGzhQZJh9kBHd7m+fGiCxlpUgW9SeOvoZXWnxmGIgCbZcWMqh0iYBcqjgux nHLZ8yCvOP5tM5wwGmdN9xnKFjifMstR++Bw2nRFuMLxKsh1Oo/toVk51R3k96e70Wgo Lnag== 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 t4-v6si4497285plb.415.2018.01.31.08.48.43; Wed, 31 Jan 2018 08:48:57 -0800 (PST) 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 S1753880AbeAaQTR (ORCPT + 99 others); Wed, 31 Jan 2018 11:19:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:44004 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753865AbeAaQTO (ORCPT ); Wed, 31 Jan 2018 11:19:14 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 67BD3ABB1; Wed, 31 Jan 2018 16:19:12 +0000 (UTC) Date: Wed, 31 Jan 2018 17:19:11 +0100 (CET) From: Miroslav Benes To: Petr Mladek cc: jpoimboe@redhat.com, jikos@kernel.org, Jason Baron , jeyu@kernel.org, Evgenii Shatokhin , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: PATCH v6 5/6] livepatch: Support separate list for replaced patches. In-Reply-To: <20180125160203.28959-6-pmladek@suse.com> Message-ID: References: <20180125160203.28959-1-pmladek@suse.com> <20180125160203.28959-6-pmladek@suse.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Jan 2018, Petr Mladek wrote: > From: Jason Baron > > We are going to add a feature called atomic replace. It will allow to > create a patch that would replace all already registered patches. > > The replaced patches will stay registered because they are typically > unregistered by some package uninstall scripts. But we will remove > these patches from @klp_patches list to keep the enabled patch > on the bottom of the stack. Otherwise, we would need to implement > rather complex logic for moving the patches on the stack. Also > it would complicate implementation of the atomic replace feature. > It is not worth it. > > As a result, we will have patches that are registered but that > are not longer usable. Let's get prepared for this and use > a better descriptive name for klp_is_patch_registered() function. > > Also create separate list for the replaced patches and allow to > unregister them. Alternative solution would be to add a flag > into struct klp_patch. Note that patch->kobj.state_initialized > is not safe because it can be cleared outside klp_mutex. > > This patch does not change the existing behavior. Ok, why not. We could also unregister the patches right away and amend the check in klp_unregister_patch() not to return error. Ever. However, this seems better in the end. Miroslav