Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1037403rdb; Wed, 6 Dec 2023 07:06:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUic6UoC0lW0GKgJux17SfMOiYykOZyXO/Yfbhe4IFtSi0NhYGxjV2FndNAd3QB83Pcx15 X-Received: by 2002:a05:6a20:4b82:b0:18f:97c:4f64 with SMTP id fu2-20020a056a204b8200b0018f097c4f64mr675041pzb.112.1701875163044; Wed, 06 Dec 2023 07:06:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701875163; cv=none; d=google.com; s=arc-20160816; b=rT1a0QEwxxGMdoOr1AoC3JQ0NG9Ksp134C1HWnpdnpyLA0+2AXkCQBLRJybzSxfKHA eeITVkCZVnBfq0OIZs6lody5eXcfm7JMC88obpW5KtKg4BnQPo1Kpz0BuL0UL1wcJFfl zlcTUKHdcRGKLggF8VeS8JXrC0cQsxDkyY7zTPZ2NBESzYOX0AXi2Y3OZQGVM2jCAtGI dmwr4XNRyFNxUtesVHZdEw00InqF7YQkYsKxz8Ak0sI4LO4SwENf8pPtDWj3EuyCRuLi kfcxlJ+/XFO63RkasLHJwnw8W6TTNIy7aIpmQcBP+TCxfduGedJUe0h/JAKi5OBnpDcw XqVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature:dkim-signature; bh=fstuDZ14CDhTICiRMQLamJBK2hLQCM7gMcsouHhAvwM=; fh=IZTAcKnCgni1mi1Td1YhUi6ZpZsiGI6AyL4I7jOQ3AI=; b=qvxFweqFU+YZVLp3ECh853b4pWq//lRLhbrBTq9PgBBNO+l7A06bumMWC/cOYk1OZy vYMVOEPfY64u1JT66B8RyRAwrYti1CBc2ZtsFCYzeQt19uxWvztFu+95PO7srcahT15i XJrz6sX/qfQoWlrewCObUD9zCqHHgDF8a1ihEW+LJRPOVyNuEe5mkM0TllfWW3apypm7 9ByTAFj5+91bsuo45W7r01HaGOkZ1mbDbBvpwAVzBjkg4kB+w1vNDuUJzASxlS91h+AH j24ScFPRo2uNGBl2AI3fSXOsViWlr8/l6+BL009xBiNdk32xbGH+YgguwbWkHzsGtlIi CLMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hOL1GB2J; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id fb40-20020a056a002da800b006ce05b64d14si90664pfb.93.2023.12.06.07.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:06:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hOL1GB2J; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5FD1080B8DF3; Wed, 6 Dec 2023 07:05:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379086AbjLFPF1 (ORCPT + 99 others); Wed, 6 Dec 2023 10:05:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379092AbjLFPFZ (ORCPT ); Wed, 6 Dec 2023 10:05:25 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 584E89A; Wed, 6 Dec 2023 07:05:31 -0800 (PST) Received: from pobox.suse.cz (unknown [10.100.2.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AD63A21E79; Wed, 6 Dec 2023 15:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1701875129; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fstuDZ14CDhTICiRMQLamJBK2hLQCM7gMcsouHhAvwM=; b=hOL1GB2JqM+RxoEgucs2Mtl+ULTAf1pQwKnnG9598uf6Zfr42KnHp9WO3RNYqrYXMHcTOU 8EzJNJsA5uZBa0EdcEgvGDuAIlSJNypjZHq7zlrLJ/BiQb0zYLj9gEtYPqlSPsbNdZB+DZ yjtvbpV3rJ6WUCreof6tVEwsSxTWRwg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1701875129; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fstuDZ14CDhTICiRMQLamJBK2hLQCM7gMcsouHhAvwM=; b=3gIZ75ZflKLKWgKzYBM1YF9Y48YEi9Zx9CWqFeq6zUvczbTdDW86IyTxLNSD3RgAcvK2IN GzAvFvWXGguoJfDw== Date: Wed, 6 Dec 2023 16:05:30 +0100 (CET) From: Miroslav Benes To: Joe Lawrence cc: Marcos Paulo de Souza , Shuah Khan , Jonathan Corbet , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Josh Poimboeuf , Jiri Kosina , Petr Mladek , linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v3 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch In-Reply-To: Message-ID: References: <20231031-send-lp-kselftests-v3-0-2b1655c2605f@suse.com> <20231031-send-lp-kselftests-v3-2-2b1655c2605f@suse.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -3.26 X-Spamd-Result: default: False [-3.26 / 50.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.16)[-0.816]; RCPT_COUNT_TWELVE(0.00)[17]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-3.00)[99.99%] X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 06 Dec 2023 07:05:51 -0800 (PST) On Fri, 1 Dec 2023, Joe Lawrence wrote: > On Tue, Oct 31, 2023 at 06:10:52PM -0300, Marcos Paulo de Souza wrote: > > The modules are being moved from lib/livepatch to > > tools/testing/selftests/livepatch/test_modules. > > > > This code moving will allow writing more complex tests, like for example an > > userspace C code that will call a livepatched kernel function. > > > > The modules are now built as out-of-tree > > modules, but being part of the kernel source means they will be maintained. > > > > Another advantage of the code moving is to be able to easily change, > > debug and rebuild the tests by running make on the selftests/livepatch directory, > > which is not currently possible since the modules on lib/livepatch are > > build and installed using the "modules" target. > > > > The current approach also keeps the ability to execute the tests manually by > > executing the scripts inside selftests/livepatch directory, as it's currently > > supported. If the modules are modified, they needed to be rebuilt before running > > the scripts though. > > > > The modules are built before running the selftests when using the > > kselftest invocations: > > > > make kselftest TARGETS=livepatch > > or > > make -C tools/testing/selftests/livepatch run_tests > > > > Quick question: > > - We have been building with CONFIG_LIVEPATCH_TEST=m to generate the > test modules at kernel build time > > - Our packaging filters out the selftest scripts and supporting modules > from the general kernel RPM package into their subpackages > > - Tests are run as part of CKI or other manual tests by installing the > pre-built packages from the previous step > > > After this patch, we would need to add something like the following to > our kernel build, before packaging: > > $ make KDIR=$(pwd) -C tools/testing/selftests/livepatch/ > ^^^^ > > If this is the correct way to build the test modules for *this* tree and > /lib/modules/$(shell uname -r)/build... it might be useful to document > in the commit message as an alternative use case. So if I understand it correctly, you would like to stick to pre-building the modules (not in-tree but now after the kernel is build using the proposed way), package them and then install everything on a system running the respective kernel. A valid use case in my opinion. My idea is to abandon this way completely, take the selftests and build and run them on the system right away. Both should be doable, hopefully, if we wire it all correctly... and document it. Miroslav