Received: by 10.213.65.68 with SMTP id h4csp3735098imn; Tue, 10 Apr 2018 04:00:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+NYHTdQ8xDuaDwmCjnTob0NIx/RQIdYeyJ7zK777VreKgOjwYFbdfT5ZJI+PC7AaoHDIfq X-Received: by 10.99.163.9 with SMTP id s9mr27808513pge.187.1523358029571; Tue, 10 Apr 2018 04:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523358029; cv=none; d=google.com; s=arc-20160816; b=ZeCYxrgPQkgjBeqn3Jcqz7YNZ2BYCMjCi1HWODq+cY+RfRwddVGh9BLjAhXFBLIFny XbyE30JFQF4gbUJKxJC/wKYivb6p/v47Jqm8nKpWpRAQVlaoIyD/io0TnAcb3/c7Yh0r mjtBPXjC+Wk9s3OfanCrph259icSfG+LuWMtM4zdboGa/QPgmjPWf+Btywj2tCMPeJBw 9Cw799IltEhfvI2Wi2JJivaTpODNFe+XKrJVs4oEW/iK5M40YuKvUadbOHV8LrI2xYLR S2rTwlrEIHWCLg8kNjmaS2JCOG2br4B2++VH7WZuwKW1OiG6aZoAsqdzo7VlFBa4g0VF AaZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=7vR7jH8JRAT1pn+30n0YrUdZsB9n0duFo6mr+KF3BZk=; b=utq0HUEHlCZmguWYy5KsbOgglWngUO2A6w6w0mUGeYduu+/DwQNRzz5JbvD94n04tw C4iFKbs9u47W6wM6Q+rEso+fI9GOFhSoCE2JWI7AtBXZhNomcGq5xQi7vdVCURZxOWdY qUucwej12SbATJ0Ell8ufDWZp/bf68mKfLagnyIM1HSOOyOOGFIn9E7AbBeKYC7k9SmS PQIS2D7dNAAiYrP1D8hiI7FfBMU0ioI2gDHG/ZSUXx0ghiQ6yD6OyHjA2HNdNbNJZFGW eIIIg5E9XuGRaZK6Q3bDkMcJpGr1r7gsgeuycdb8WZLXdpRf+e0SDd56wwzM6MgsskNV gpmA== 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 bj1-v6si2340765plb.690.2018.04.10.03.59.52; Tue, 10 Apr 2018 04:00:29 -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 S1752956AbeDJK4b (ORCPT + 99 others); Tue, 10 Apr 2018 06:56:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:59629 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752927AbeDJK41 (ORCPT ); Tue, 10 Apr 2018 06:56:27 -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 E57BAAEF9; Tue, 10 Apr 2018 10:56:25 +0000 (UTC) Date: Tue, 10 Apr 2018 12:56:25 +0200 From: Petr Mladek To: Miroslav Benes Cc: Jiri Kosina , Josh Poimboeuf , Jason Baron , Joe Lawrence , Jessica Yu , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/8] livepatch: Add an extra flag to distinguish registered patches Message-ID: <20180410105625.4o4ozkpmanevytnh@pathway.suse.cz> References: <20180323120028.31451-1-pmladek@suse.com> <20180323120028.31451-5-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 2018-04-09 16:02:15, Miroslav Benes wrote: > On Fri, 23 Mar 2018, Petr Mladek wrote: > > > The initial implementation of the atomic replace feature keeps the replaced > > patches on the stack. But people would like to remove the replaced patches > > from different reasons that will be described in the following patch. > > > > This patch is just a small preparation step. We will need to keep > > the replaced patches registered even when they are not longer on the stack. > > In my opinion it could be easier for a review to squash the patch into the > next one. OK, I'll squash them. > > diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h > > index f28af280f9e0..d6e6d8176995 100644 > > --- a/include/linux/livepatch.h > > +++ b/include/linux/livepatch.h > > @@ -378,7 +383,7 @@ int klp_disable_patch(struct klp_patch *patch) > > > > mutex_lock(&klp_mutex); > > > > - if (!klp_is_patch_registered(patch)) { > > + if (!patch->registered) { > > I don't see any actual problem, but I'd feel safer if we preserve > klp_is_patch_on_stack() even somewhere in disable path. It is strictly needed in klp_enable_patch() which will be better visible if I squash it with the next patch. The use in klp_disable_patch() is optional. I do not have problems to add it there though. If Josh does not see it as too paranoid, I'll add it. Best Regards, Petr