Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3774417rwa; Tue, 23 Aug 2022 09:54:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR5kIPjUIh7hbFHCXu6rnVXDg9V2Cb44b2XNj00x2z+07iavdZoq1FN92fTZTS7fd5u+5vST X-Received: by 2002:a63:3684:0:b0:429:f162:78dd with SMTP id d126-20020a633684000000b00429f16278ddmr21611264pga.473.1661273689761; Tue, 23 Aug 2022 09:54:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661273689; cv=none; d=google.com; s=arc-20160816; b=zDSY9MtZEG/3oc/KHKFvbuNmz41uFGNZEGKmlsOdP5gAk5VCry+fcvaCCoDc45GycA gG8zcpkq/i2bPBgMJgqVeJBc4NDvZgO9K1V/Wgi0n1ztDiRlLRyzUUHiUJS60YQqVTLG j7JKbjUj+6EpKorNANT5O+7TBfVqYS33KkEgNhXXwXPVt1jillB2tkANT+8ygpacwQ5Q I+mlEnYT6fe5dJuvnoeFZaFkTkHfYdYIYADmNp40pe2rrNYoBaiGcSLj0nMzDwhNB4Gg DZGChM9OFbhznal3IB11JvmYcuWOhc94p79RYKRRzuX974OoDKTnSRr7lVpGj2WInRT7 2R/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=Ul98iQY/HuNJwvvDH45A7W6rxdc5WeO56lIkJhUkB2U=; b=x62W263ZVGTMlpFcitftOYMEq/k9j5bQ0otcrO29I2yDvrDnLNCYuwI7QZpFNCXO9N mwVUVj8ogp/lUfxK2oguMNgbmSVgePPZdS6iSokYOp3NFrYBWJ4AnHnXoP8cHSQ8Cj+5 DtTQ4DbSx0VBQnU5aQC+k7YaQ62vfjNVNV7sm+cbSzF51gTQA6Arb7UpW1wfZeyBA3Xm SFNHbI2Rbe4nYCYo6G1CPsAq3nOP8514rFdEfKH5o5EX91d9TUGeYb89cREU226ttDp5 WPYm0jkAQYSpZoMFO6JUIHTnybYoATtxO6EOSJis1NWebIaMt/lhlcBNLdjPpFGV1MWc WN6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=a9BqvzhJ; 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 127-20020a630185000000b00422bfd57ffesi15318472pgb.591.2022.08.23.09.54.34; Tue, 23 Aug 2022 09:54:49 -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=a9BqvzhJ; 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 S245379AbiHWQra (ORCPT + 99 others); Tue, 23 Aug 2022 12:47:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344105AbiHWQqq (ORCPT ); Tue, 23 Aug 2022 12:46:46 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D722DAB4DA for ; Tue, 23 Aug 2022 07:25:00 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id k16-20020a635a50000000b0042986056df6so6159627pgm.2 for ; Tue, 23 Aug 2022 07:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc; bh=Ul98iQY/HuNJwvvDH45A7W6rxdc5WeO56lIkJhUkB2U=; b=a9BqvzhJK02ElPHh15v40k1SLA6RzCr91KtZX7oGrY24F6PwR2YgW3mNMcvDjZ+0/R 9ir8JyR8mb/UfiTxrJDW64eUkGNMV0CzKdfTV+BC/GzN0jd/jDOmGZpIcPtWWV9dYa3t 39lpJDXM1zzcZEtvJw2ymAprkPGleI3WZI6yTWswgOES8uvoH2M0Y+D77euf7pttSPEa INXjy57p3NOhd7N33W3WI4k0o0CYsYuqhQuo3oZg0uMq3VgC6sKNfmun7xVvKHLxEV7E ABGB1hsaIhBTsaVfJGziwy6xhtPXwvS0vPjjA0ZSGQb42b1kmGxbtCYEh+57HgEhopjZ YRPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc; bh=Ul98iQY/HuNJwvvDH45A7W6rxdc5WeO56lIkJhUkB2U=; b=juMMwsGuSmQD0aQCWU5dRfthlwZw1u+J0I4KfTgMXXiGVj2/cd/bbtbVyFdR/R9P3y S6haBPkHcYHGpXjXCxYsGOYqH4qFtiOhmIfNQvD0F+9lKxoM/3PYqJM4ETu3zANGjRh+ vNhGJmo8LlSru8MxUAoxVMI/F5nQp6hCdLCH3mSe1wYy2whVilPy/uQgOiA/yGmVrEzN vDxNURFQUcxDR70FstmRsq5NTV0incEbWBZMzP4P8hMoib+aj9bMdiAHGaMKU0xUpTbf FY8aYx8/CyR4D8sqTgVJHCowdWmk76HhRp0ueH7kIp3KU9yHo0xy4PBu8rVeG+JExnAf rKcQ== X-Gm-Message-State: ACgBeo2AKThPnaZF3uTX91DdgTc05PnEqyHv8oH7GWG45nExl1YqhYBZ DDONnvMY3+KEaOztXvDWyCjl1iaBCeLb0t0= X-Received: from joefradley-custom-96.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:831]) (user=joefradley job=sendgmr) by 2002:a17:90a:55:b0:1f7:4513:8cac with SMTP id 21-20020a17090a005500b001f745138cacmr3476051pjb.93.1661264700397; Tue, 23 Aug 2022 07:25:00 -0700 (PDT) Date: Tue, 23 Aug 2022 07:24:53 -0700 Message-Id: <20220823142456.3977086-1-joefradley@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH v2 0/2] kunit: add boot time parameter to enable KUnit From: Joe Fradley To: Jonathan Corbet , Brendan Higgins , David Gow Cc: Joe Fradley , kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_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 v2: - Added enable check in executor.c to prevent wrong error output from kunit_tool.py when run against a KUnit disabled kernel - kunit_tool.py now passes kunit.enable=1 - Flipped around logic of new config to KUNIT_DEFAULT_ENABLED - Now load modules containing tests but not executing them - Various message/description text clean up There are some use cases where the kernel binary is desired to be the same for both production and testing. This poses a problem for users of KUnit as built-in tests will automatically run at startup and test modules can still be loaded leaving the kernel in an unsafe state. There is a "test" taint flag that gets set if a test runs but nothing to prevent the execution. This patch adds the kunit.enable module parameter that will need to be set to true in addition to KUNIT being enabled for KUnit tests to run. The default value is true giving backwards compatibility. However, for the production+testing use case the new config option KUNIT_DEFAULT_ENABLED can be set to N requiring the tester to opt-in by passing kunit.enable=1 to the kernel. Joe Fradley (2): kunit: add kunit.enable to enable/disable KUnit test kunit: no longer call module_info(test, "Y") for kunit modules .../admin-guide/kernel-parameters.txt | 6 +++++ include/kunit/test.h | 3 ++- lib/kunit/Kconfig | 11 +++++++++ lib/kunit/executor.c | 4 ++++ lib/kunit/test.c | 24 +++++++++++++++++++ tools/testing/kunit/kunit_kernel.py | 1 + 6 files changed, 48 insertions(+), 1 deletion(-) -- 2.37.1.595.g718a3a8f04-goog