Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp982946iob; Fri, 13 May 2022 18:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0+c3O9iQUFet3eexNbGuR0J36zfDqv9WY1OujoP5hKhmDHxjTL9zrz58yCNvkML6XJHen X-Received: by 2002:adf:ce84:0:b0:20a:e076:30ff with SMTP id r4-20020adfce84000000b0020ae07630ffmr5884334wrn.361.1652491930215; Fri, 13 May 2022 18:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652491930; cv=none; d=google.com; s=arc-20160816; b=YEWNE/eXDMvFyVBMU9q+18eKtqmX1tSytMHxKIIMieMzm3svyr5J23R3BvF3Mjj9Hn 1LMBCPMuLKYbWhV7ywiIdvXwPZVKRi220wfSFUDqs3cJlYPvqyVzNmV0UeWvj03NE92U nAzw8zEM8pum/VCGl+kItoLR8vQIcw2XI8kjcAmOwz/V61q1aDCcuF7yzacyiRHzPq3N aZ78Ko2csl0ua+5siTQPbDZ8dWcFRG8oi5dYxwH/+SJrDUA88fpJKXW/1zPN2PhDgk34 g6ci7AibksNU2WFALVLKwr/xNjmJ3V/cXdR+aTpSUsImvwxK8er7zSEYA5JpueYgT7nw 0/kw== 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=8buMt52MUzaasZ6jsjp6myKL0GeKFoD3/wZybTV/TmM=; b=QxhR0WJ8ANjttOTwYvyiO5DaBw6GePzN4RDAEmUVV8omKzYp7aJGLGJzd0mF1+qXkp gmQiXBodLQ3IeC5eh9WDoOsv3upJGfTzrW0c6ueZnJxzgf5/nXobl5/xQoyzusO/9VOp Snrl6ownZvF2F7KF3K+0fmApM45CcTE849MMN2mvDgX6KqILLYkErRT4OxbMMRDnG6Ps jA1TMrtpSph3cFG/tuNXYl7jLyl5q0izMjJHdQMujrnOAUz1yygD8ZyijivPwWjLzR2F btO0uCX/cBfB4gFFYdG3AZ0clpeIBzb87DpmHlnaKapu9JDa2oPz3Rh04W1NhcJDD5WU l1Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=NF38oozR; 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 o15-20020a05600002cf00b0020cf2aa5a77si3656918wry.74.2022.05.13.18.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:32:10 -0700 (PDT) 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=NF38oozR; 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 BDDE53FF603; Fri, 13 May 2022 16:59:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383243AbiEMSKo (ORCPT + 99 others); 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-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 Content-Type: text/plain; charset="UTF-8" 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 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=1G console=tty kunit_shutdown=halt console=ttyS0 kunit_shutdown=reboot The first three options are added unconditionally but are only intended for UML. 1. 'mem=1G' 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=tty' 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=1G console=tty kunit_shutdown=halt' (unchanged) x86_64: 'console=ttyS0 kunit_shutdown=reboot' 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 --- v1 -> v2: Remove other UML-specific args from other arches. I.e. also only specify "mem=1G and console=tty" 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/kunit_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(LinuxSourceTreeOperations): def start(self, params: List[str], build_dir: str) -> subprocess.Popen: """Runs the Linux UML binary. Must be named 'linux'.""" linux_bin = os.path.join(build_dir, 'linux') + params.extend(['mem=1G', 'console=tty', 'kunit_shutdown=halt']) return subprocess.Popen([linux_bin] + params, stdin=subprocess.PIPE, stdout=subprocess.PIPE, @@ -334,7 +335,6 @@ class LinuxSourceTree(object): def run_kernel(self, args=None, build_dir='', filter_glob='', timeout=None) -> Iterator[str]: if not args: args = [] - args.extend(['mem=1G', 'console=tty', 'kunit_shutdown=halt']) if filter_glob: args.append('kunit.filter_glob='+filter_glob) base-commit: 9660209d9418f2295d31fea0d32e313e9b2c1200 -- 2.36.0.550.gb090851708-goog