Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5636917pxb; Mon, 28 Mar 2022 15:18:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3IFsHHXJvZoHTh1yHExKoIlBUF9p6RiJGtuPZG6dcYqIDlF7Ab1+rzYKjV1AzucyuSpb6 X-Received: by 2002:a17:902:8d8b:b0:155:f201:16ad with SMTP id v11-20020a1709028d8b00b00155f20116admr13110036plo.150.1648505905834; Mon, 28 Mar 2022 15:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648505905; cv=none; d=google.com; s=arc-20160816; b=hbdPIQKagH8Xb2WKxzPPozIaJgDlStOvK6IyomecdkZ0jwtO4MZE1DbA+XoWJTE0Ci ptPsJx4keE7nbm9srExD82UHIMoTlB5agTUF/Pa54QGyr6xk2wXrJ8X4coiyEuvYCElF f9MiPibQVca79Ni9FUN0qWsR4GZbRSlIt0SqhufAVQPHc2JYVugqVAcpUCD2Bd5z+0qg 5RvSGmrlIRkvBzkzfoPogtlgbilJ7k9coSxTJk2j3BNDo2RoxIR2zWI+kWodl14VIM6S kN4yXMgLHSqRutpFGhreOi1vWyzyf7Xqr/jggpSg3y/v7V6krwyraLp2JSrXYcy91s1j Xv2Q== 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=njbwY8ik3fUgv8jSTsQUgVzLcyId30Q3o3B5sKqRTl0=; b=Vzh30ijHa2T5Vsn/Xux/HgJr1AupgTZkNJImsNDhimubfcKKRpsNNeN5P+AotS9VgN h3IHYIW01jw0qp+DvmyRMHVekPYouNTNrHKCjlz/+FSKvxEcH4KqWPIuv5ISYbua7yJZ vEGREEziJ2gZHCjJDEmRPvoAJjK1al0RobwC2cmcF9IKU1sD2/bLtPgSnE14AFpeXsvS wKL9zTh3M23Boykuzg01vxls8xwohTPtr8HcOQ8LygMYGV+3GlDx+950AbTOfQN2y/2G q34V+ChwRRjJ/gzo9hBkq/ELvsId15YcL2pv6zlgDoywchGte3jQUO4k3uOprIvkPUJk 9YCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AA+hqSjv; 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 n11-20020a170902d2cb00b00153b2d1650asi16810226plc.274.2022.03.28.15.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:18:25 -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=AA+hqSjv; 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 79E311890F2; Mon, 28 Mar 2022 14:35:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244214AbiC1RG5 (ORCPT + 99 others); Mon, 28 Mar 2022 13:06:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239218AbiC1RGz (ORCPT ); Mon, 28 Mar 2022 13:06:55 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 635874B41B for ; Mon, 28 Mar 2022 10:05:13 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id p15so30010412ejc.7 for ; Mon, 28 Mar 2022 10:05:13 -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=njbwY8ik3fUgv8jSTsQUgVzLcyId30Q3o3B5sKqRTl0=; b=AA+hqSjvQkRoJ8cZUyqGfd/7yTL9Ik2iGE1JOIkTTZYzr3XuCg/zVabwzZW507ba8T S/eph8qRKtHs/I1PLGIZJpvcqbGpniKRZmSnwuaYJkRJfWjN86SjnJQ9zkPo750ROQts 4uGZzGt6K3N2PzFrCKrDekKLegSEuYxLyrzp166xLQAmLWXvmEC701TcqiJHwNi5IFau FPmaKWBW1ZtvWtNVaUmAn/xSQ7sNHEV5MSnF9IFMRFMX+tqc8ig4hkvtKTYqSujUZCHW n8A95uLPO33HJA8DK7syVmcBkyNOutnDh0L3/g7aeb1WBPuvNbEzVbAlG4wKCOtPOGkt OY0Q== 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=njbwY8ik3fUgv8jSTsQUgVzLcyId30Q3o3B5sKqRTl0=; b=rwxwMfYvlhUD5B2+Pm+EbwE6sCgBl1QwPn+htL+WPrKecpx5XYMTOFnJWswptMtDXw oWEBdiMJF6uYHmQFqen4hepXuteEW+Iw31WbdYLplQ2Twt8rGVY144BhahW48WJr9rKR /1TZuw3l+A1a18qr/rTM9BlltkwTBP0buatK3gcskS7QNzI5HTwnFuqv3sJ+ILhw0JY6 IGMUZkZeKd+RgFWATUzG0IK+OaA6JbyeFmODaudQxwd+u57mch8+PLkHXSBVImRWrVlu +Cyl1JbGBzJUFfcJEplOJFtJ5BCU1bgcwfxew2pPCoyOzoP1EEFoaIM8Td32ii4LogR0 8tKg== X-Gm-Message-State: AOAM531jTt4j/8eHS+goihBdWvKnln8VpNjJnlnHcJ/x6t9i01XXkbzh q58dHjf2Wq7+9EtAU+BLakO6FxgJuC8c5NYkWeZ2sA== X-Received: by 2002:a17:907:eab:b0:6da:8ec5:d386 with SMTP id ho43-20020a1709070eab00b006da8ec5d386mr28578130ejc.668.1648487111704; Mon, 28 Mar 2022 10:05:11 -0700 (PDT) MIME-Version: 1.0 References: <20220310210210.2124637-1-brendanhiggins@google.com> In-Reply-To: From: Brendan Higgins Date: Mon, 28 Mar 2022 13:04:59 -0400 Message-ID: Subject: Re: [RFC v1] kunit: add support for kunit_suites that reference init code To: Daniel Latypov Cc: Daniel Gutson , David Gow , 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 11:59 AM Daniel Latypov wrote= : > > On Fri, Mar 25, 2022 at 8:26 AM Daniel Gutson > wrote: > > > > On Fri, Mar 11, 2022 at 2:56 PM Daniel Latypov wr= ote: > > > > > > On Fri, Mar 11, 2022 at 4:14 AM Daniel Gutson > > > wrote: > > > > > > > > > > > > > > > > El vie., 11 mar. 2022 4:02 a. m., David Gow e= scribi=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 cal= led > > > >> > kunit_test_init_suite(); this new registration macro allows the > > > >> > registration of kunit_suites that reference functions marked __i= nit and > > > >> > data marked __initdata. > > > >> > > > > >> > Signed-off-by: Brendan Higgins > > > >> > --- > > > >> > > > > >> > This patch is in response to a KUnit user issue[1] in which the = user was > > > >> > attempting to test some init functions; although this is a funct= ional > > > >> > 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 ini= t phase > > > >> > is over; it is for this reason that this patch adds a new regist= ration > > > >> > macro rather than simply modifying the existing macros. > > > >> > > > > >> > [1] https://groups.google.com/g/kunit-dev/c/XDjieRHEneg/m/D0rFCw= VABgAJ > > > >> > > > > >> > --- > > > >> > > > >> I'm a little concerned that this is just removing the warnings, bu= t do > > > >> agree that this is safe enough for the moment. At least the inform= ation > > > >> about which tests need __init is preserved by the use of a differe= nt > > > >> macro. > > > >> > > > >> I guess one day we'll need a second list of 'init' tests or someth= ing... > > > > > > > > > > > > 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-brendanh= iggins@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. It'll probably be 5.19, but it should be applied to Shuah's kunit-next branch end of this week begining of next and then you can use that as a base if you wish.