Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2185915pxb; Fri, 25 Mar 2022 12:37:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpAY7U603pvj4gBRTore5Ytbb/uE78JbBeKPR4be5SQ7iBhVI87vduaMnsvzRFZ6Zlq5rB X-Received: by 2002:a65:4c82:0:b0:380:3aee:6948 with SMTP id m2-20020a654c82000000b003803aee6948mr866279pgt.527.1648237043021; Fri, 25 Mar 2022 12:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648237043; cv=none; d=google.com; s=arc-20160816; b=PjI/gF0VE4kEuis1KIwD304KjDmufNv5HauxzFznc9c2R9MH6wKQ7nRAWsS3OlAtUg /QHdOAwTN3EqrzqHOPuwdnSoG+phAyGATGzMJgjRucwsB9PqbW3Pb+8TJvDoPRHpIXCt 4h2YLiyxybZ2YbRMIArW+g5kV8nS0kWtwQiW6SGHy81HLZFz62EvWh49HMMJkSEi+LOi 9hILy6H/DCYhxVasuQnSjBgLc17S/IQ+m6RAt4EJJRPWlQbUugRh+PHLmnKrJXVV+z1G bmmsEODsSfuv062K09iCHrTTlItzTiWpyy4rzAZmDVvYIYQZAotV1lfLzWS7IVSP4e8w y6vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gpN67V582CHPbxBisa52Dy5g6J1ZXtdjpLk4FW2ME/o=; b=rHfc6HG5QeS3+Gk7X4JI/m0zYlBOy+4dk07SOJp92DZQ3t1VHea8cp0i5ifJnnEdQp AGx5uxEPgY2t9oVgfT1Zlp8ghRHlhfoooVIFRdKCxx9aG5uluIxTw/cOUB3Hrt4Ltlm/ op9uA2Fveq3wOZR71bhyL3km6Mi5X8tR23a5zPW8jE0kD5e4mSqcOdGygQzbquByXwe/ WDWwE44uZMpXitCXY6m5VU3kwKrHZAv/wmVr5xN3ZK08qyTGC8yh6dcoCbOkW5i4tWlC ja9fmM0JXnqXAfe4S9ZZ4XYKqTF7jE53ezqBX58z1WXfoi0O3Nb9Xxw+6Uu6PCOobwIV r/Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=byDSm1Y9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i9-20020a636d09000000b003816043f12fsi3175985pgc.804.2022.03.25.12.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:37:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=byDSm1Y9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA90326A950; Fri, 25 Mar 2022 11:28:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376598AbiCYQBT (ORCPT + 99 others); Fri, 25 Mar 2022 12:01:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359620AbiCYQBS (ORCPT ); Fri, 25 Mar 2022 12:01:18 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31ECD56C33 for ; Fri, 25 Mar 2022 08:59:44 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id p15so16242449ejc.7 for ; Fri, 25 Mar 2022 08:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=gpN67V582CHPbxBisa52Dy5g6J1ZXtdjpLk4FW2ME/o=; b=byDSm1Y9M94+/23XfW4CSXNRNpB3EVQ/hh6wSv97dbsfkupUHpMNs/0fy3COOblPsw 9jurThzgOfjszJCkEWcujnKotl4/C0LsGBAKrf9PV43QZKcpaVKQuW6elDzogr7tiAct y98JiYANAmSLW62nfBYjYwAwT+hcYqG9rNH20MIive+C3A2e49vLhjhmSl9ajqRx/GG7 lL1CSntp4OL08PTobCrorSEa84QrRGXk5raq0o0S+rkyVB8FJWgz9PeMxEZQbvWoAC3L NrsYLdfiGBaPgJZWGg0h67TNUJf5OEUBTX1JY36dOJoeY1sMteP7DMK132fD2fXbRt4k Pvig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gpN67V582CHPbxBisa52Dy5g6J1ZXtdjpLk4FW2ME/o=; b=c+6WD+shDGS7yDnMU9wWtM1czvoBXydHUsgyzEEW2zYlQDXSzkwwzk4r95+HgZBjsn PP65mhi8AANtopz/shqN7ngJk/V2WBSagfqVHRZXPmQGfWhHoHvpmPB1QEiR3QFKsHVb ha0BR8+ssrjdNe2igAhN3IWBskVKuxiPp2mgymvctpl7iuiqh6LGhZhUUHpU2UYvHlDT 6BF9/oCV7OpuFo0rrVUeBuqAd4Nmw6BcebebouNYj0fQtevSQG50BMJiZcWXDBdPZ3hv SPCjkpmYBJDg/ySHJLBEOV0f4hHbORrxDYvd8CBkLgaXFzB/y85jbVlEb1YBp/lf5B1o 6UCw== X-Gm-Message-State: AOAM532WZHPEfq12BhZWgdkE1rZJLr1CotSKijlT2/oKCLEsvAVbQuzB 5doxedEYn68kcn9Mm4m9VZtAMU0iaiJOMPp3FQNLQA== X-Received: by 2002:a17:907:1c06:b0:6df:b257:cbb3 with SMTP id nc6-20020a1709071c0600b006dfb257cbb3mr12064857ejc.631.1648223982439; Fri, 25 Mar 2022 08:59:42 -0700 (PDT) MIME-Version: 1.0 References: <20220310210210.2124637-1-brendanhiggins@google.com> In-Reply-To: From: Daniel Latypov Date: Fri, 25 Mar 2022 10:59:31 -0500 Message-ID: Subject: Re: [RFC v1] kunit: add support for kunit_suites that reference init code To: Daniel Gutson Cc: David Gow , Brendan Higgins , shuah@kernel.org, Martin Fernandez , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel , Kees Cook , Richard Hughes Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 25, 2022 at 8:26 AM Daniel Gutson wrote: > > On Fri, Mar 11, 2022 at 2:56 PM Daniel Latypov wrot= e: > > > > On Fri, Mar 11, 2022 at 4:14 AM Daniel Gutson > > wrote: > > > > > > > > > > > > El vie., 11 mar. 2022 4:02 a. m., David Gow esc= ribi=C3=B3: > > >> > > >> On Thu, Mar 10, 2022 at 01:02:10PM -0800, Brendan Higgins wrote: > > >> > Add support for a new kind of kunit_suite registration macro calle= d > > >> > kunit_test_init_suite(); this new registration macro allows the > > >> > registration of kunit_suites that reference functions marked __ini= t and > > >> > data marked __initdata. > > >> > > > >> > Signed-off-by: Brendan Higgins > > >> > --- > > >> > > > >> > This patch is in response to a KUnit user issue[1] in which the us= er was > > >> > attempting to test some init functions; although this is a functio= nal > > >> > solution as long as KUnit tests only run during the init phase, we= will > > >> > need to do more work if we ever allow tests to run after the init = phase > > >> > is over; it is for this reason that this patch adds a new registra= tion > > >> > macro rather than simply modifying the existing macros. > > >> > > > >> > [1] https://groups.google.com/g/kunit-dev/c/XDjieRHEneg/m/D0rFCwVA= BgAJ > > >> > > > >> > --- > > >> > > >> I'm a little concerned that this is just removing the warnings, but = do > > >> agree that this is safe enough for the moment. At least the informat= ion > > >> about which tests need __init is preserved by the use of a different > > >> macro. > > >> > > >> I guess one day we'll need a second list of 'init' tests or somethin= g... > > > > > > > > > Hi, could you please detail about this? Why a second list? > > > > > > > I assume this is referring to a future where we want to run tests > > _after_ the init phase. > > In that case, we'd need to be able to separately register tests that > > run during and those that run after. > > (Or we could have one list and just tag each suite as init/post-init. > > If we ever had >2 "phases" where we run tests, this might be the more > > scalable option) > > > > Is it likely we'd have tests run after? > > Not in the near future, I don't think. But it could be asked for. > > > > For context, here's where built-in KUnit tests currently run: > > https://elixir.bootlin.com/linux/v5.17-rc7/source/init/main.c#L1615 > > That'd probably become kunit_run_init_tests() and then we'd have > > another kunit_run_post_init_tests() called later, or something. > > Hi folks, any update on this? I'm adding Richard Hughes since we > need this for fwupd/LVFS, so he can provide more context. v1 of the patch was posted here: https://lore.kernel.org/linux-kselftest/20220311072859.2174624-1-brendanhig= gins@google.com/ It has the requisite Reviewed-by's and no one has complained about it. So we're now waiting for that to get picked up into Shuah's tree and into Linus' for 5.18 (possibly) or 5.19.