Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1356443rwb; Fri, 19 Aug 2022 02:06:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR5XktmMM8Lgsg1/xg/TB4voQo9W9il2TzaWsagp1BkNgnnUOE0o9FH5Xajk4cLkpwVDrt3T X-Received: by 2002:a05:6402:2384:b0:446:4c2d:6530 with SMTP id j4-20020a056402238400b004464c2d6530mr826068eda.401.1660899978703; Fri, 19 Aug 2022 02:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660899978; cv=none; d=google.com; s=arc-20160816; b=MznD9rjeNU2NR8VqnxNWlQSl2Xh2MnA/LNStHsMQcLLfzfUDfXT8RyltyRMFoGuiIv A3OUu3PlhHxQH+3dcW4HlA8gzBlijmgtNELW2Ex6CFsw8V4LOwAYYH8fO5sXFblH079B 9/4XZ6Rmz7xmPe6W4MPdmBZgFQDCwRvATDdTJjA5rWJ7Sfw7QRIhElQEcRiPKau5Ja56 uKpTNSr4YCQDthXWQetWax70TWQIpF4s0xNhULS8JMpJLkqltWXyl0SqKsenUMfuNBKE mYlsoXdjbSDA7Z2h/2qud3EHNZzUajs6UgdBqYxLN4aILRVEKcctr7PWVt3zCg23gJEz /Qpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FIWWrde7a/JqcshJyKxI1HIVfMGJjyPquwX+/hncQxU=; b=hrYRsSB3FyNWjRcA6HlmsAgP6SXuucC6RioJjHTTkmG23QgQ77s+iVrzhvcyObKv+4 YglDJZVkqS48QPybGcQCLTHu6eZ9ZHJUSuVeONkmXwSguAaSY/p3KlOnLEJs8UbJa2LX oWmSzVSXBJpZf5sOPu90FJwoY8Xmy8ScOjVMzLFekz5UI+yDkhdxd/HMuOuOAnpRLo7r IqQyFc/meuVm8O7/iGMSI7h6vBdxBQOF5ZWGFgcgm8E9tths0Z4hMjhqzm2Rxwo1NTm5 iw+OnodpapQeGTjH41i7zNbFuf/7vE3pVj2h7RCOV8N13ROhSGMfYUKS5PHTSKn4rk+X qCXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oFjxsUG3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a1709061cc200b0072fa13ddca0si2091019ejh.229.2022.08.19.02.05.51; Fri, 19 Aug 2022 02:06:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oFjxsUG3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347525AbiHSIhS (ORCPT + 99 others); Fri, 19 Aug 2022 04:37:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347347AbiHSIgu (ORCPT ); Fri, 19 Aug 2022 04:36:50 -0400 Received: from mail-ua1-x932.google.com (mail-ua1-x932.google.com [IPv6:2607:f8b0:4864:20::932]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38D85606A1 for ; Fri, 19 Aug 2022 01:34:43 -0700 (PDT) Received: by mail-ua1-x932.google.com with SMTP id by8so1525504uab.12 for ; Fri, 19 Aug 2022 01:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=FIWWrde7a/JqcshJyKxI1HIVfMGJjyPquwX+/hncQxU=; b=oFjxsUG3a87JQoZd+PORVHqi6PEHnZ5vNlDfRiaD2q/RvCAcsNwsAFtDnPH+pqy7Lm kl7oY5yiVxKrAqaERhg6gDgt5uUYAc3pvLOWJXeeJ51hk0Zh13lenrZ1UZr+g89OQxup kluS81G8bs7+I9B+bxVUGPiBT/hN+yHuNeDtqQuW/Ir/kRpAS6RLZVvILO4luGb+vYdI LosPoa/Co1/EO/Lbzmz2662BGDbIlYlYe6wenJ7w/GQeW7mkd/6pZyAZj9DYM+6A7Uw4 0/uyrCM4F2sVcE6s2a+VLuhOL8xEVcRXFy7aGYq/tZLLV/G2sy+oUDYg5+fTnaJyGXSD 0IYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=FIWWrde7a/JqcshJyKxI1HIVfMGJjyPquwX+/hncQxU=; b=Q2WPUk1OkUEpVca363H6Klm+x/Fx8iRh8hAoBh/cK8RbTTuwa0Yc/Pn7fpm6CfAbsf X2wGvYLjVWHqbhxJ0v7CjjwzPhAYMh1N1JLCbXHlJaTcWoUCA6yACf8MSjCPhvZRkc0L h0i/PwxulEM3FFuZ+WywGIpmK5XJbNxJ7JElp/zNqgfjnIwM2g/DrFU0B72dgLJ02zyq oI8Vexc/n3UESHh5UqVuvt9UzbTAws7xhNtoOZhPaoNMS339BwWNxYIuTkCRhNwsC7bm rvHMWpJb7d9qBizaCmp49bENEXJUerMprcGrw5vDJM4wbIOc+HjMpFCSDoL76SFYiAP+ pJIQ== X-Gm-Message-State: ACgBeo3f4yQhf35i0zSEyuRGDna+hfEgW2kW9Y+sfDzMW8XTAvdpiO3z /Z0g9Bi4Y1Vmlq1pfg2aSGTJrghLVns+K6YMC4oqVQ== X-Received: by 2002:ab0:3b09:0:b0:39a:82bc:88e5 with SMTP id n9-20020ab03b09000000b0039a82bc88e5mr2276360uaw.26.1660898082867; Fri, 19 Aug 2022 01:34:42 -0700 (PDT) MIME-Version: 1.0 References: <20220817164851.3574140-1-joefradley@google.com> <20220817164851.3574140-3-joefradley@google.com> In-Reply-To: <20220817164851.3574140-3-joefradley@google.com> From: David Gow Date: Fri, 19 Aug 2022 16:34:31 +0800 Message-ID: Subject: Re: [PATCH 2/2] kunit: no longer call module_info(test, "Y") for kunit modules To: Joe Fradley Cc: Jonathan Corbet , Brendan Higgins , kernel-team@android.com, "open list:DOCUMENTATION" , Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000404fda05e693f8d3" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 --000000000000404fda05e693f8d3 Content-Type: text/plain; charset="UTF-8" On Thu, Aug 18, 2022 at 12:49 AM Joe Fradley wrote: > > Because KUnit test execution is not a guarantee with the kunit.enable > parameter we want to be careful to only taint the kernel only if an > actual test runs. Calling module_info(test, "Y") for every KUnit module > automatically causes the kernel to be tainted upon module load. Therefore, > we're removing this call and relying on the KUnit framework to taint the > kernel or not. > > Signed-off-by: Joe Fradley > --- Thanks! This definitely fixes an assumption I'd had about KUnit-usage which definitely doesn't hold: that all KUnit tests would be in their own modules (or at least that those modules wouldn't need to be loaded on otherwise production systems). Given this isn't the case for a number of modules (thuderbolt, apparmor, probably soon amdgpu), it makles sense to get rid of this and only taint the kernel when the test is actually run, not just when it's loaded. This could be considered a fix for c272612cb4a2 ("kunit: Taint the kernel when KUnit tests are run"), as it'd already be possible to load, e.g., thunderbolt, but prevent the tests from executing with a filter glob which doesn't match any tests. That possibly shouldn't taint the kernel. Reviewed-by: David Gow Fixes: c272612cb4a2 ("kunit: Taint the kernel when KUnit tests are run") Cheers, -- David > include/kunit/test.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/include/kunit/test.h b/include/kunit/test.h > index c958855681cc..f23d3954aa17 100644 > --- a/include/kunit/test.h > +++ b/include/kunit/test.h > @@ -251,7 +251,6 @@ static inline int kunit_run_all_tests(void) > #endif /* IS_BUILTIN(CONFIG_KUNIT) */ > > #define __kunit_test_suites(unique_array, ...) \ > - MODULE_INFO(test, "Y"); \ > static struct kunit_suite *unique_array[] \ > __aligned(sizeof(struct kunit_suite *)) \ > __used __section(".kunit_test_suites") = { __VA_ARGS__ } > -- > 2.37.1.595.g718a3a8f04-goog > --000000000000404fda05e693f8d3 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPnwYJKoZIhvcNAQcCoIIPkDCCD4wCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg ggz5MIIEtjCCA56gAwIBAgIQeAMYYHb81ngUVR0WyMTzqzANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA3MjgwMDAwMDBaFw0yOTAzMTgwMDAwMDBaMFQxCzAJBgNVBAYT AkJ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