Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1877111imu; Fri, 14 Dec 2018 02:03:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/UKCC0FcQePlTl+FrAkUGzvk/AzBRsycwxuuIrXgq5DQrZqh+Ta3IK2eCDsKneqv2DOma0U X-Received: by 2002:a63:ce08:: with SMTP id y8mr2105158pgf.388.1544781837427; Fri, 14 Dec 2018 02:03:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544781837; cv=none; d=google.com; s=arc-20160816; b=y15WYGXOBA25c1tm0Cjl4aYfBZ/xR8SHHoOXBl+MmSUJA7yxk7OEbN9l9SPicFZBC8 UqwRjpPorjSOhaeW5wdK8qQR8yUdHB9ANWgAmOzf+5th6C30vSNNAC/rfH3Dny5cXKEM P1ZYjd/wBuiRn/bouao2t2GF8TI8m4Re2gmwFxtzQG9Z3THeA8Dz1Z16OSV3rfjNwbjk pfl1CPqwHxmbOQteTvhTzVm0sfRE1ZnwHm2dfqUXOIHesRV1i6dfyXzKAHtH82+hIGPg VEMFBRPG5T0E+SrvGv2MuOMPkzEAUy1dP7oDxMXClf76171xXFEG6e3rF4ndLgFwI/Ts ting== 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; bh=7yBCHvdjWF+2M5aii1ILye+tfUDKpDjtlY4xKIzHhZU=; b=IezmzKglaFrVXF3VudiOqOyLWHo/6NuzL2UyuAzONxhFZ0NZD7na24VBATpcpyIPi1 oXMr5v3Xxf6mtTjSlsQtKF0Q6anBNG+EgYfknEJvzQJWjm5JeKPFO58iYYTFNEBeTeQ2 GwmTQwlBIzQT8Qy8Y087CNZWfROwcAdAKFm1TsKxCcATWTDvJTcnbVPpRd0Myv9VRv1I +x7+EAooyVRhcRsDy5smUVZYGPI454Of6PW7Yu7NKBRqZ0oWPIrwzICUWyLvHdEXPsb3 GMw3ZDIREiQ8mhIxGvJukjlXzXFZzowx71KqBX5jru5MzcbskCC9gy35fKeoqFU9mF60 OcNw== 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 q70si3754806pgq.526.2018.12.14.02.03.42; Fri, 14 Dec 2018 02:03: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 S1729285AbeLNKCf (ORCPT + 99 others); Fri, 14 Dec 2018 05:02:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:49658 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726494AbeLNKCf (ORCPT ); Fri, 14 Dec 2018 05:02:35 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5C594AE4C; Fri, 14 Dec 2018 10:02:33 +0000 (UTC) Date: Fri, 14 Dec 2018 11:02:32 +0100 From: Petr Mladek To: Josh Poimboeuf Cc: Jiri Kosina , Miroslav Benes , Jason Baron , Joe Lawrence , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v14 05/11] livepatch: Simplify API by removing registration step Message-ID: <20181214100232.elyqlnjyhp55acxf@pathway.suse.cz> References: <20181129094431.7801-1-pmladek@suse.com> <20181129094431.7801-6-pmladek@suse.com> <20181213224625.65o77z75u4njocnp@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181213224625.65o77z75u4njocnp@treble> 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 Thu 2018-12-13 16:46:25, Josh Poimboeuf wrote: > Now that we can't re-enable a patch, I wonder if we really need both the > 'patch->enabled' and 'klp_target_state' variables? > > A patch is now always enabled, unless it's in transition, in which case > its 'enabled' state is the same as 'klp_target_state'. > > For example I wonder if we could get rid of 'klp_target_state', since it > should be the same as 'klp_transition_patch->enabled'. There are some catches: 1. klp_update_patch_state() can be called anywhere and anytime. We would add yet another race-sensitive code if we access the flag via a pointer. 2. patch->enabled is bool while klp_target_state is triple state. The argument is that KLP_UNDEFINED helps to catch bugs. > Or alternatively we could get rid of 'patch->enabled', since it should > be the same as > > patch == klp_transition_patch ? klp_target_state : true This might solve the first catch but not the 2nd one. Not to say that it is much harder to read. > Of course this could be a follow-on cleanup patch, which could be done > in the future, so as not to hold up the merging of these patches > anymore. Yes, please. This is controversial, non-trivial, and can wait. Best Regards, Petr