Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp563096ybi; Fri, 21 Jun 2019 04:28:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzHQhFEMeO5JlMgCx/EdG28NcSAfhtQ4kAcaMlnD1qN9tPb34pKOKDTNVo3UgcEpWG3GPR X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr6070230pjd.72.1561116500478; Fri, 21 Jun 2019 04:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561116500; cv=none; d=google.com; s=arc-20160816; b=BzTLCltuTYT0+FZslgGKnvweGC4CYl6hZBndKBMLkp0lgjSGjq1+f5vI3a8E1k+yIz iZHT11feCPLi1hU7rHb29LT9tYXFEtTIG+L2Jbl1Y/Oxc2RhKPndSNU7BHxj9MpKIyI1 xpQhxZISMIxdD2zMPQgS9YDxLHe+ZCRGdjcrADhXrR2gKII3iwwPD9b/5zvHW8F9BHXC IP63G3sisGHxuPzk1wg6NglgbJnMcPheQ+4n9BbaqM505yjoZd/ohXokqN4rWw+CZzAi vW2QFuQ2y/n8coRIDNCDmK6BXbR3Br06OpAMXcFhft4LPAN4XQk0r1AHR6MJ93t6iCg1 entA== 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; bh=M4UNnu+5J0fKyGbfHIqeHt7KveYcrlb6Bm+xKSmioig=; b=xOYSvZ/0PHBAh8AFkXyqrjJ5uRLh1xMWgc6wHnobHSDQJBeOtQzNAhVRU87t1XRLa0 Wi2For1qmQuYUg5iuBTTQ5IL1wLkxb9mdLnWB/XxpgsaokCVxCYKfF4J7LbeUZGRpFp6 +dSO34ifau9aWwugWuibIzeFcW+SVr9HNv0ZdoaDyYjTw1mHg7+hmKQZly4KqgTJxL11 GVRoGgmdrgpO/do+6+QxKmkHLMSpwMAmXRadkcTtB7/DA4mmBoeH7E5fnPCuFh9BNbr/ NBkfD6gS4M92k0hts5GiadIkOSroB149fPI+w0rY1Jm2r50LZtGPAkTO7qvFIaronILQ Y6Vg== 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 m45si2739626pje.39.2019.06.21.04.28.04; Fri, 21 Jun 2019 04:28:20 -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 S1726438AbfFUL2A (ORCPT + 99 others); Fri, 21 Jun 2019 07:28:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:42284 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726232AbfFUL2A (ORCPT ); Fri, 21 Jun 2019 07:28:00 -0400 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 D351FAF8A; Fri, 21 Jun 2019 11:27:58 +0000 (UTC) Date: Fri, 21 Jun 2019 13:27:58 +0200 (CEST) From: Miroslav Benes To: Petr Mladek cc: Jiri Kosina , Josh Poimboeuf , Joe Lawrence , Kamalesh Babulal , Nicolai Stange , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC 3/5] livepatch: Allow to distinguish different version of system state changes In-Reply-To: <20190611135627.15556-4-pmladek@suse.com> Message-ID: References: <20190611135627.15556-1-pmladek@suse.com> <20190611135627.15556-4-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 > +/* Check if the patch is able to deal with the given system state. */ > +static bool klp_is_state_compatible(struct klp_patch *patch, > + struct klp_state *state) > +{ > + struct klp_state *new_state; > + > + new_state = klp_get_state(patch, state->id); > + > + if (new_state) > + return new_state->version < state->version ? false : true; return new_state->version >= state->version; ? > + /* Cumulative livepatch must handle all already modified states. */ > + return patch->replace ? false : true; return !patch->replace; ? > + * Check if the new livepatch will not break the existing system states. > + * Cumulative patches must handle all already modified states. > + * Non-cumulative patches can touch already modified states. > + */ > +bool klp_is_patch_compatible(struct klp_patch *patch) make C=1 kernel/livepatch/state.o kernel/livepatch/state.c:107:6: warning: symbol 'klp_is_patch_compatible' was not declared. Should it be static? #include "state.h" in state.c would solve it. Miroslav