Received: by 2002:ac2:48a3:0:0:0:0:0 with SMTP id u3csp552987lfg; Fri, 11 Mar 2022 13:03:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxG2SCcZRfXXwK9X+GSNALXuugqk3tOC3E4e43jwcoO4w/jrw5pE9/tR7YmI08b3SODjhFm X-Received: by 2002:a17:90b:3117:b0:1bf:70e7:2543 with SMTP id gc23-20020a17090b311700b001bf70e72543mr12722163pjb.37.1647032621044; Fri, 11 Mar 2022 13:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647032621; cv=none; d=google.com; s=arc-20160816; b=k1bXivloRgRuXWLodilpXetH75Ka1e+y3BD8cpV7CVa2PzjC5Y218m8gBWqUTYX7XR apAbFDP3ZfK9zyZ9m8lgiw/8k9kY1aj3McIkBBUr2lzU1LoMJjFeKiqy8TD+aShpQjvU OH86/SroloPBw/91LYWihAYdWvGWJ9lsBa7WZmDGjmLRV/SwEZ8AqdPZ0v8IAhEmNQop NeeDmtU4ocI4HR3fUswSNpDMC3/EUqIVt8mnDbxPuPmaX9XagJbOxzjVfLLu8Y6GCmDI CZvWlhk/txX5pdj2hgsZhMS311K+aLzuBQH8SZqOzMEhtkCzr3UlSs0YUn5ZJeZ/sylu bVJw== 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=6uqrZCjfvTCf0vt8DbhYIoNyBdrnrfGnyWV6ShUB2vU=; b=TFkw6nGt2eEoTyrPzv1Jfi+q+pDWPmrNm151iW8lf/EkBArOk323s9eCcDwi7ZHZdM DIMDfKKF/LsaGelPOA4AkO2EJXuocjhy2M1SN8OYYbjcFrj4b3Lq5geBtsgBNE65LCYA 1d4XgXlNAaqSPYou0/q7+MvBb08E2nChC7FgBkoZhneybp1OsKRImDSStgbY8dY6h6n3 G25ErSGWAW7boR4n1h9fZFOfs1Yxo7iEeX848WKNG7V4ssFji4GsNwUapEsqDO8c9nDC GyVWmRccr9xjDva8a34kQqN7U2q7qR32EHAdgBv8AOj5vb/MoFV0Qt61FSQwv5QdQLTr K4KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Np8v8rOa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h6-20020a170902704600b0014fa4ebad07si8276729plt.83.2022.03.11.13.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:03:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Np8v8rOa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 153A3159E92; Fri, 11 Mar 2022 12:49:16 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349507AbiCKR5j (ORCPT + 99 others); Fri, 11 Mar 2022 12:57:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233755AbiCKR5i (ORCPT ); Fri, 11 Mar 2022 12:57:38 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B2DB1C1ED6 for ; Fri, 11 Mar 2022 09:56:34 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id r29so2651111edc.0 for ; Fri, 11 Mar 2022 09:56:34 -0800 (PST) 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=6uqrZCjfvTCf0vt8DbhYIoNyBdrnrfGnyWV6ShUB2vU=; b=Np8v8rOaTexwZ9CowsixK98xvDVR/E2HeNEE9G8HenWAgLG2yemAxpgvVci5J5M9E/ ww2D8EpkdwkrLH/I0vWWh9u7qyWvZ4VZaOSsPpHkxHjzl2SNgKnjo/HqG83j30EfsRFV PD3gWWPF3jC2guzLSofGcoOW71gHVlrFct9bgSM6bGnCNsPr1FSNzwngi/ElmXVsS9AG JQq1PLSXqweRV+CbnOgPPQllnqthJEE3BHdv4zqiCfrzRk7z2K5hyu6MUYHRMoNNXeqe XdUc3gi649tmmAnRsMMVQzCJvADluc2wizuISjw8kNhajMhuJQpWa9hsWmwVPWyAC0p0 4m/Q== 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=6uqrZCjfvTCf0vt8DbhYIoNyBdrnrfGnyWV6ShUB2vU=; b=19i787BwJeEQFgc5Ws5TVOcCDApDLHE0rusXFilHE71kmXTzCe9KdyPWafBmj8fZXH G+BBgVRDgnITp7cDXU9lURq+S/An7AAAWbTrY0EXK5YOuybkAmyQUjCgsPJAfhyJTezY 8krGK2w7z8rENwwbG0g+8DkMGShsgJBN4Ex03prpjEBZ1ml162LjRUflXsSn5MPjFwFC G439lk7tzzE/ogEp9mqTQBzG1xi111djrGZb8GtahkBd0iFs+wT5kUzfeSo0j1RhRNIq Ej4Q+EXxS0Jay5ozW52CzacDINQuibAwqJ9eiuRY4goJAap5G2KbZsnswbPJX2v3PtmW 4gvw== X-Gm-Message-State: AOAM531Vmji0ZJHN0sly/KFaG0W8suLpIbFwsQue7mPgZH3hlfgD3Dw9 xYVKZ7LkBpZ/VQyEyublfw0xB8NbMLAflgDUeSH2FQ== X-Received: by 2002:a05:6402:3490:b0:416:8b97:b1f7 with SMTP id v16-20020a056402349000b004168b97b1f7mr9808627edc.36.1647021392341; Fri, 11 Mar 2022 09:56:32 -0800 (PST) MIME-Version: 1.0 References: <20220310210210.2124637-1-brendanhiggins@google.com> In-Reply-To: From: Daniel Latypov Date: Fri, 11 Mar 2022 11:56:20 -0600 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 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 11, 2022 at 4:14 AM Daniel Gutson wrote: > > > > El vie., 11 mar. 2022 4:02 a. m., David Gow escribi= =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 called >> > kunit_test_init_suite(); this new registration macro allows the >> > registration of kunit_suites that reference functions marked __init an= d >> > data marked __initdata. >> > >> > Signed-off-by: Brendan Higgins >> > --- >> > >> > This patch is in response to a KUnit user issue[1] in which the user w= as >> > attempting to test some init functions; although this is a functional >> > solution as long as KUnit tests only run during the init phase, we wil= l >> > need to do more work if we ever allow tests to run after the init phas= e >> > is over; it is for this reason that this patch adds a new registration >> > macro rather than simply modifying the existing macros. >> > >> > [1] https://groups.google.com/g/kunit-dev/c/XDjieRHEneg/m/D0rFCwVABgAJ >> > >> > --- >> >> 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 information >> 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 something... > > > 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.