Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4264517rdb; Mon, 11 Dec 2023 13:56:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPal802PtSUn5hsuGJTpeM7t4H7zZqDqaQOWk4XKkFeO+xUDedK9QmJ9w1eaKK8uZ9N0E1 X-Received: by 2002:a05:6a00:4653:b0:6bd:f224:c79e with SMTP id kp19-20020a056a00465300b006bdf224c79emr2976323pfb.11.1702331790586; Mon, 11 Dec 2023 13:56:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702331790; cv=none; d=google.com; s=arc-20160816; b=0dgURWrkHfdwtRhIRHoLZUzqO6sIA53BynKSridkq61I6XSTbL09LyqbroXIlp/RP2 DWueazoyfXN76SUHW32mieiHbqi7fOqotZ24M6kCBo2tX5MvaoRFKKkXKSx7N6S3RP6X NnR8ba4hvojBwICuspIzfm1bQW0HhG3qdWvSaAmDN9gZq6szV4Hy1qWL8bv2bIUSVGh2 m+dI0NJ1jJ7EqgjKS58oTM+R4JWjnj/5TlxOaSIXBa9iSlgPGATzWYm6lTzox3LikIKv 32xspAjNdBcW5ixyv02HYUUPLfgg0ubQM57WSNdSF3xULKEZ2Nq1gNrVDJAYdlaqJtyR Ijgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QWln+CTTERyZ6ImQ/92s4pzeNQeDoALVr1bp+5tWi4A=; fh=dhiNstCuRxlbyfH4Pv9nYwEhR/FBPplS9q6HJXNfqfA=; b=f55ha0xkyVAkNW3Wl+kAab4P2bPPgdzAOPiYd3auEiUbs720yex56jU4lLpKdEJvcZ KPBx+Ebk0rsPuALjnnj36re88LF9DV8ZlX8avf/+yfgLK4Qp0xbPPY3plwSJLssyRJUm L+EGNBQ2wyR4WowrrZn5bnQXTRwcyKwI5eCtUDkZ+S6Xqu6M3iGPduVI4Hr1z9utACtY RCdEGNmBjceU74NfwWmZ/6EFHv9PfpAB7orcXWvI5E1R73u1jTsWES3vJXgp/syQUDLh 3ftMdAPwbWj5GajYx/kb/18Wd00jU3rrjGlmqbnU4d18Ckw56amJckwEkdFWetjJJwKk co4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Bfd6HASy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f31-20020a63555f000000b005c625b9f61esi6453812pgm.779.2023.12.11.13.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 13:56:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Bfd6HASy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6AF3F8058B63; Mon, 11 Dec 2023 13:56:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230073AbjLKV4M (ORCPT + 99 others); Mon, 11 Dec 2023 16:56:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbjLKV4L (ORCPT ); Mon, 11 Dec 2023 16:56:11 -0500 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39CF5C4 for ; Mon, 11 Dec 2023 13:56:17 -0800 (PST) Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-7b37a2e6314so44010939f.1 for ; Mon, 11 Dec 2023 13:56:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1702331776; x=1702936576; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QWln+CTTERyZ6ImQ/92s4pzeNQeDoALVr1bp+5tWi4A=; b=Bfd6HASyVBFKiddbCav9xD13UkpAkC/+RDM0FWcUg5sLMJgju+dAC/5uW9DMlzRKEx IaRADmo3PI4CvyVjdmdkkGI+lnl1kWBBSh5LrhQEmwqSDt6WKVO5EWaBl3Jha6Cd957U opexMuPQFSO+OJP28mwWqnKoTBD65sMshOW9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702331776; x=1702936576; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QWln+CTTERyZ6ImQ/92s4pzeNQeDoALVr1bp+5tWi4A=; b=i9fkXalL4+dOXPvm0WWW4SV9XgY68T8gCxNQQVFV3liULRCyjMqJi7dwJ2wJxgJwA1 U9sQ9duKlP8MaByDaGl2fPXMtHiitDfQyAd7ev0MdM5tdthqq4w9aObupKbREhjzYjvm sXOU8MFANlTrXjPb8lX584xXgC4XURBWknA3FQypkvThx0Ef5i0/bXQ60DChXee28Mrb cPKhv4CenXnlrw6MWpEIA/uI8QrGDYl76SIK2Kfwwikka9izZ8DTo/RodEpB2DKJ8/01 vJbPh3XudO+8DbmZR35q/bbIx+EX7vmxMBWmVFw1sLuDYvdBuKHfb6MvmWKsLol+CGNH lh2w== X-Gm-Message-State: AOJu0YwR24m3ccekjh3Trmn2uHR8Kh4AQNNoEH3H3aEnbDIhdfXF9Fj6 3u3Uv2mWduxZ2t3jgbkX7AFFwQ== X-Received: by 2002:a6b:a0d:0:b0:7b6:f0b4:92aa with SMTP id z13-20020a6b0a0d000000b007b6f0b492aamr8560958ioi.0.1702331776554; Mon, 11 Dec 2023 13:56:16 -0800 (PST) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id l27-20020a02cd9b000000b0046938c12608sm2097774jap.122.2023.12.11.13.56.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Dec 2023 13:56:16 -0800 (PST) Message-ID: <2c4f2771-0557-4b44-9c98-6bd2e6930d2f@linuxfoundation.org> Date: Mon, 11 Dec 2023 14:56:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch Content-Language: en-US To: mpdesouza@suse.com, Joe Lawrence , Miroslav Benes Cc: 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, Shuah Khan References: <20231031-send-lp-kselftests-v3-0-2b1655c2605f@suse.com> <20231031-send-lp-kselftests-v3-2-2b1655c2605f@suse.com> <273a86d6-d220-fdcf-3c2f-70516c519ff9@redhat.com> <57fb9f30afbaddb09def96aac11c45296a59a277.camel@suse.com> From: Shuah Khan In-Reply-To: <57fb9f30afbaddb09def96aac11c45296a59a277.camel@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 11 Dec 2023 13:56:27 -0800 (PST) On 12/7/23 12:19, mpdesouza@suse.com wrote: > On Thu, 2023-12-07 at 10:20 -0500, Joe Lawrence wrote: >> On 12/6/23 10:05, Miroslav Benes wrote: >>> 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. > > That's right: > > $ make -C tools/testing/selftests/livepatch/ > > is indeed the way to build the tests without running them. KDIR will be > set to /lib/modules/$(shell uname -r)/build is empty. > > Yes, I can definitely add documentation about it inside the > tools/testing/selftests/livepatch/README. > How does the default kselftest run work with these changes? make ksefltest - does this still work as it did before this change? thanks, -- Shuah