From nobody Sun Jun 14 17:44:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B7ABC433FE for ; Fri, 13 May 2022 18:10:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383247AbiEMSKo (ORCPT ); Fri, 13 May 2022 14:10:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382893AbiEMSKm (ORCPT ); Fri, 13 May 2022 14:10:42 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A45B53A6A for ; Fri, 13 May 2022 11:10:37 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id r14-20020a25844e000000b00648bdf7491bso7970748ybm.1 for ; Fri, 13 May 2022 11:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=8buMt52MUzaasZ6jsjp6myKL0GeKFoD3/wZybTV/TmM=; b=NF38oozRIFs8X6o8YLo0E1qzhmO1P8ZdEhbOKiFZM5s+oqyb9UIKEzsjx254jTgddB cCCZQjWjOabEb7MN6sw20yDxEKS3hZ1cK1+8dmMxb2TynK2D/EGklgKCZB0C8hCWTFEs KbEuEt35Lg+CuxcKHfg8edkThSXnTpemSzcvgkW75QrOvw2rOTk+XLcVmutMiaTKXZ3c cYCYqooI5/DC69sAbs8jK191LuxXRNffEYm7lPKVEVNXOKd3nMMF/6wQ4s1pVFvuuMpd VNbkWQ9ihpBBhZCsB8rWh+Aig0suWLjflBsOO23hFN67ZV+cnezBIlNP6cQXMWgtDzTY DtvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=8buMt52MUzaasZ6jsjp6myKL0GeKFoD3/wZybTV/TmM=; b=i9AZX8BXCsCMIYq6RRBrZ9YMD9tAaZIgJ5zPlS7hP8eSrCbB1NjDSSc00KyOUZVTQV P93OVUoZH8vnGM2/pq5usyGbcZo9hhzYYCxtQ0TaIFCz3db2ZTwLhzTao/hgg9LzWeEU 8NzSG4A2dnIB3xQydM0LkISyLhtcQzYocQkAF3cydHwQcN91bGESut2F368Ar5kcQzdc MIgWAUSvcN7Ystu45T8z4Ools38vNAxFftOrXNQmXNK+GDjwfjBvybRORsVtkeqCHhQS wQU1vEj2tCuabQxm0+n2K7rgRaqXOSxLerTy1nchJyVVjOPoFerElLZ7JzIfvZOZ/Rwn IWLw== X-Gm-Message-State: AOAM533igvmcRFNilTZztR2XcHD3zm6XyrOIE2zxgYbejN6fAWUB1xH3 43F3hX4sci4jkfXWchoB1WI4Ydm47eqOVQ== X-Google-Smtp-Source: ABdhPJy2h+vw30dO0Bq1irc/WGZWYZ8ZyOuEdHxvG4gOcCyytDX8eDNpVkJYbudcI3v0tCy5QS9tEb8L7UMA2g== X-Received: from dlatypov.svl.corp.google.com ([2620:15c:2cd:202:577a:4fdf:13a8:670]) (user=dlatypov job=sendgmr) by 2002:a25:3157:0:b0:649:b216:bb4e with SMTP id x84-20020a253157000000b00649b216bb4emr6332372ybx.387.1652465436436; Fri, 13 May 2022 11:10:36 -0700 (PDT) Date: Fri, 13 May 2022 11:10:32 -0700 Message-Id: <20220513181032.24484-1-dlatypov@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH v2] kunit: tool: cosmetic: don't specify duplicate kernel cmdline options From: Daniel Latypov To: brendanhiggins@google.com, davidgow@google.com Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, Daniel Latypov Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Context: When using a non-UML arch, kunit.py will boot the test kernel with options like these by default (this is x86_64): > mem=3D1G console=3Dtty kunit_shutdown=3Dhalt console=3DttyS0 kunit_shutdo= wn=3Dreboot The first three options are added unconditionally but are only intended for UML. 1. 'mem=3D1G' is redundant with the '-m 1024' that we hard-code into the qemu commandline. 2. We specify a 'console' for all tools/testing/kunit/qemu_configs/*.py already, so 'console=3Dtty' gets overwritten. 3. For QEMU, we need to use 'reboot', and for UML we need to use 'halt'. If you switch them, kunit.py will hang until the --timeout expires. This patch: Having these duplicate options is a bit noisy. Switch so we only add UML-specific options for UML. I.e. we now get UML: 'mem=3D1G console=3Dtty kunit_shutdown=3Dhalt' (unchanged) x86_64: 'console=3DttyS0 kunit_shutdown=3Dreboot' Side effect: you can't overwrite these options on UML w/ --kernel_arg. But you already couldn't for QEMU (console, kunit_shutdown), and why would you want to? Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins --- v1 -> v2: Remove other UML-specific args from other arches. I.e. also only specify "mem=3D1G and console=3Dtty" for UML. --- tools/testing/kunit/kunit_kernel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kuni= t_kernel.py index 1b9c4922a675..8945640b5063 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -160,6 +160,7 @@ class LinuxSourceTreeOperationsUml(LinuxSourceTreeOpera= tions): def start(self, params: List[str], build_dir: str) -> subprocess.Popen: """Runs the Linux UML binary. Must be named 'linux'.""" linux_bin =3D os.path.join(build_dir, 'linux') + params.extend(['mem=3D1G', 'console=3Dtty', 'kunit_shutdown=3Dhalt']) return subprocess.Popen([linux_bin] + params, stdin=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, @@ -334,7 +335,6 @@ class LinuxSourceTree(object): def run_kernel(self, args=3DNone, build_dir=3D'', filter_glob=3D'', timeo= ut=3DNone) -> Iterator[str]: if not args: args =3D [] - args.extend(['mem=3D1G', 'console=3Dtty', 'kunit_shutdown=3Dhalt']) if filter_glob: args.append('kunit.filter_glob=3D'+filter_glob) =20 base-commit: 9660209d9418f2295d31fea0d32e313e9b2c1200 --=20 2.36.0.550.gb090851708-goog