Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2802380rwa; Mon, 22 Aug 2022 14:13:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR58lOZie5xlVvypDlzmAJdoB/i7g3kXItdeoNU0krd1mWsLghPLCZ2wUHc1my1Ia5n+wf3A X-Received: by 2002:a17:907:87b0:b0:738:e618:99ca with SMTP id qv48-20020a17090787b000b00738e61899camr14025781ejc.357.1661202837431; Mon, 22 Aug 2022 14:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661202837; cv=none; d=google.com; s=arc-20160816; b=JJTY0p04CY+E3aIR3ObUE+BTEGPEGWT4Q+ZpqZ32R7Mnb9LSbJaK3+cOwj5lriBl8g v/RIzYrLB7+BlnFzoW1H2Cizqoe3uvMCkb0IvUDT+aC3V2rtiT+aZpwlnEfiGEj6Gn64 dyAXgFiZsunWMRnmDpixCo37VL5Az19ikf8lfZbiEovsZnjBf2OGVSDitbsMjGktCbpC /ngFJJl/XcBrqTKygOPjeU8VHVpdGUf6T3qU9cvmayOjxGAV28K4BaeqekTEpS2+yXHg SCV24ox9NCI/ZeXN9fDLxYNC1+T5A1qq8gW9dD+xmC9bvQwbWANaAVuqzDyZ9qB8mllg z4/Q== 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=CiUQYh3VkiWrk7tILV4WC/5iJ5EWLzTZ3MjP1qEF7c8=; b=w6kMiTAOHKwEK9bZCuWI8V/GMymbgJ098O2JcgS35WAhSMSOY57VrS9NVudZbs0vsC HjsKfYWNdWN0iOPxVCG072+YCigClTUBihWJPwBg6g51H48uzsqjmiup820FrRwKX3lG e7MR3dPA7dQovENgGZMYMm6Mkp17KYd5lcgSI/JmjjbY1t9egYcDgA6sDNsCXkeq7sq3 BeAS+IPy2aQJ24vMFsZFcv1WANTXMJ3kEZxDHpnIceLQnfHzWQMMh5pv/CKUSSJ4z81k iR3vm20uLOGxExRq+ONiwQGx0ryvK47gJTDti8cNc2AR8FHIIdezaLF4xb3GVsuZ4wpH 32xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Hsb8llLc; 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 di16-20020a170906731000b007312b22887asi780586ejc.973.2022.08.22.14.13.32; Mon, 22 Aug 2022 14:13:57 -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=Hsb8llLc; 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 S232256AbiHVUrZ (ORCPT + 99 others); Mon, 22 Aug 2022 16:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236379AbiHVUrS (ORCPT ); Mon, 22 Aug 2022 16:47:18 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3893558E8 for ; Mon, 22 Aug 2022 13:47:16 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id q6-20020a4aa886000000b0044b06d0c453so1527333oom.11 for ; Mon, 22 Aug 2022 13:47:16 -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=CiUQYh3VkiWrk7tILV4WC/5iJ5EWLzTZ3MjP1qEF7c8=; b=Hsb8llLcCL5ye2Z1lqzLqQ5cJaN623wjXgZbZAKSVPUcaGQ4lifDMMvfKYdSBd9dH0 kjK+6CYpgcUhbQwCp6AbH3VLnrFqtgHOeiApzuGxkpLvYQ0bkd8DvTjlqcYrDaC945/R nM3dtwz+EtI8WFzTTDhrNWStQ+Y1BEqOcEhG6ehcdarjul31QtQXTt5HybvYGHtJ7p0h ONu9mpBTlJQXWdRZ5NZTLHtqp2BQS6Ldo/bqOUaHeI6dPKvCFu7s/fsYhI8j9KYixQbo pOgibeL86RlnEusH1XgtmvKa7rrIJSuP7W1DOkt2OG+vsEWTffdHCVkPiFHhwwWj2hqq +9Lw== 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=CiUQYh3VkiWrk7tILV4WC/5iJ5EWLzTZ3MjP1qEF7c8=; b=ctylIY9cQnIKUFLfA/ZYMsTxAaX0qF5FxpvPRBQbMr5MzkrCIMBSEayzN16d7IAAZm wlT9lReXCxcpov+M7jydfINrB9KgVvZ64889FvEJL8MpUIQXcG6IBR8RyG/vqQUkSFuz IwHnXpcYIgEZ3kD2hullK2qdxcOXMdKPHCGcZCtzIAD0IqEQSq0LCGnwb8kgTaHBGhmm jI/G9Yjpt3/M1jujGu458n8ce8rsIyHv1rOsqCE3Jaa+HGhVOcAxv/LhmGFVhQ7n0YCH sv3RirDMuyBf7EqKyNQSfXEVdNnYSSLGaT/2w/lLrDE1gAyOTTT6rO+xJ3FsUgGqQEMk GC6w== X-Gm-Message-State: ACgBeo3J4jGqBmhxa6ZJt5wZJwF/0kDfz0CXdPCpUwkgoZTmDJIA0MME puIBskafMa38XhR5V6/4jOfcEZaWL94pUVPjngB6 X-Received: by 2002:a4a:94a6:0:b0:435:f61e:d7a1 with SMTP id k35-20020a4a94a6000000b00435f61ed7a1mr7144494ooi.82.1661201236122; Mon, 22 Aug 2022 13:47:16 -0700 (PDT) MIME-Version: 1.0 References: <20220817164851.3574140-1-joefradley@google.com> <20220817164851.3574140-3-joefradley@google.com> In-Reply-To: From: Joe Fradley Date: Mon, 22 Aug 2022 13:47:05 -0700 Message-ID: Subject: Re: [PATCH 2/2] kunit: no longer call module_info(test, "Y") for kunit modules To: David Gow 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: text/plain; charset="UTF-8" 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 On Fri, Aug 19, 2022 at 1:34 AM David Gow wrote: > > 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. Great, thank you for the review. > > 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 > >