Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp587610ybi; Fri, 21 Jun 2019 04:56:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHgO+L1sed2wkKyLpO0dLFfTSb6g/CHMwKyiqx4fnmvtSr/oLP0jZAfuTfpu/mpd2oDig/ X-Received: by 2002:a17:902:f213:: with SMTP id gn19mr39416378plb.35.1561118165627; Fri, 21 Jun 2019 04:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561118165; cv=none; d=google.com; s=arc-20160816; b=Qqz90Rhz9cZdD4rBlZMlxJUdLLZF3rzQJCGjczXo+vLZ11SZm9JOGyR2/sZ9NhqDcQ jZVCyTr+EhEV3ijzggFKCgUR0S93peqlX2Mvc8bqnLpZJkLWeC0gG/0YrSHUhddnjIRI 5QnFwFmRqnNXB01DgBAUmOEhHnRe0eUFJaII4JWZrb8aPS1vJYce20DQP9+3kxGEFvpL 96WGXUj+N6krEBWkpagt4cAbn68eSnI2es1ZlucOz6wAcwbpyLro9S7oDE9SfZxl+ZyV kmbXEEv0jxLJnIdt7RYnFN9C6qqHln9yEvgwCtHV3x7EP2VJqLxqRz+24TJ3L0x0wjnU YKsg== 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=HQgFPhG+U1/AcpMVoFptJpWvZ2JcfFFG2+QAVmMFQvo=; b=TwKL8Dai8E9+Rf1XhTU0CvZN4ss1EZD9W28qDRRVV6woc2xiRYdMPlaaF5+/404tLJ 6s8OqIm5K2FjjDwJ/PWT5Gg2g0wxeRTNnhO0cSEG8aoUDQo27PW3pStK218v5wliKgOO EzX2g7bfObrs4vQ77ipw+doWEXgSZ6g+BOnR7zbSvn9u/NeVY1QZVNC0q+08dRooHAnC avljVbiA/4ETxxZYRC9I2AqaA8gAZgKYZIYhHtrMh0MH5xDo+qdcOfWYpENSyUDZupwL fzf54HkqRk3/PM4Xz4n77b8LYI++SX4utxQ+NyqY8bJldcWbps993D/LODDplRSLH/Vn k2OQ== 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 z142si2676348pfc.128.2019.06.21.04.55.47; Fri, 21 Jun 2019 04:56:05 -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 S1726431AbfFULyQ (ORCPT + 99 others); Fri, 21 Jun 2019 07:54:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:48672 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726309AbfFULyP (ORCPT ); Fri, 21 Jun 2019 07:54:15 -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 ADF81AED9; Fri, 21 Jun 2019 11:54:14 +0000 (UTC) Date: Fri, 21 Jun 2019 13:54:13 +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 5/5] livepatch: Selftests of the API for tracking system state changes In-Reply-To: <20190611135627.15556-6-pmladek@suse.com> Message-ID: References: <20190611135627.15556-1-pmladek@suse.com> <20190611135627.15556-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 > diff --git a/lib/livepatch/test_klp_state.c b/lib/livepatch/test_klp_state.c > new file mode 100644 > index 000000000000..c43dc2f2e01d > --- /dev/null > +++ b/lib/livepatch/test_klp_state.c > @@ -0,0 +1,161 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (C) 2019 SUSE > + > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > + > +#include > +#include > +#include > +#include > + > +#define CONSOLE_LOGLEVEL_STATE 1 > +/* Version 1 does not support migration. */ > +#define CONSOLE_LOGLEVEL_STATE_VERSION 1 [...] > +static struct klp_state states[] = { > + { > + .id = CONSOLE_LOGLEVEL_STATE, > + .version = 1, s/1/CONSOLE_LOGLEVEL_STATE_VERSION/ Miroslav