From patchwork Mon May 29 12:56:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 100248 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1500310vqr; Mon, 29 May 2023 06:09:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ujPPx+fBtPuQ+x3rkzWc85Dp6fgGsvOhn2j+63ty7uYUClewiNvG0p/7fzRgX5egoCn5J X-Received: by 2002:a17:90a:7021:b0:250:7d1f:938b with SMTP id f30-20020a17090a702100b002507d1f938bmr11463782pjk.23.1685365754412; Mon, 29 May 2023 06:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685365754; cv=none; d=google.com; s=arc-20160816; b=sLCy+vJpvT+RKf+D9xDYT2fSp5I6kuIFy17HK4ItnoMzqV440YJHryreCDWKsWwHWa iOIoceLvObFzCxrSax12SrFgirqEOMb6FZFl0LhavCQKdhd+wyDhuwrqRoAWvheBQTo4 H7udC84GP+qiVqLGNGhQgaMdn6eVcfYjT9Och6Axrtu7RFhhsmGpbDxaqz+9yJWmUNSb IJrGVG0eJSGYSRW14dgIyS2RVTrEZVKCXCZkH7qdCvrwCqHId6TcXnm6+t8cHFSwWXfq WzsnjoIF4nc5Y1r9+fROZ1JPVIWKsiCaDolgWK9VJeYdoIVhY0Rc3Mtta877eWvaR6Ao l3+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=+aoTJQ6N9TsD/FyYX7ahqvEGfpVfkCtlZyNhVSuGnGU=; b=gLNga/LO4B3GbSO/wT6LgUbIgEPgidn7Gg0VdfDEP9kWMfhTxsb5TE9XAA5WS7zDVO CzZUBxU0jJeI67PIC2GARAXoQFj7PN1KYyYElZxYObm3dCLbtR8a2JVZkwcuE5NibNLA me6+OsJZ3AOSLM1kGgdfHbVymi2M9kVyMX4wwmZ+wNtlrxRG7T0ZWRfbY8TF7/eEFNfy FoOmMaF955RHQdhT66GBASzlT3v0zIX8Mq2weS6K45Kk5mIhVO/qJAvmiQR694YfPvRz mHj7R5FyZoHu8VI5L2dBYmhKO6YpgA9OGh7IPL1krsB6iQJeX4IZNKacVIMq7XxoTtfk +APg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oe5-20020a17090b394500b00246f8b06125si12898364pjb.108.2023.05.29.06.08.59; Mon, 29 May 2023 06:09:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229641AbjE2M4h (ORCPT + 99 others); Mon, 29 May 2023 08:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbjE2M4f (ORCPT ); Mon, 29 May 2023 08:56:35 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CDC4DC; Mon, 29 May 2023 05:56:33 -0700 (PDT) X-QQ-mid: bizesmtp70t1685364975tgu8b8nk Received: from linux-lab-host.localdomain ( [119.123.130.80]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 29 May 2023 20:56:14 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: FVl8EHhfVR783a8W9cyjlbwbl8mKgDbq7E9fTAhEP/OvspzBBX5yVruB4eMmw ghv1uWTKdn3WWnfuPirBiJXTDIoLu4+zRicOyy51cEaBDTfX/44GdqG2l5NZILUSeeU6y/V 4nd0bq9QznBIvumYMoPS1IJhTI+h4UZjFJzTkhfnat3GT8dXP6j4ZHLsH7N5xuCxnlR5i+N tViOrP/UytFGRtN5fuWrvTNRAFCFO9vcJkY0hSLR7kWLQqHQlgwIb2njMNj3g9mx/Q3VaKx Wne2knqx3TEbzRHOxPzAikzLPgS8dOE0aAI7qSy+aUfJaB6ijw98ePU52ffTHXNfn+5d2J7 imguZhQn65iyk9XF7fsKZRTLg+vA5KqQtHQty4xBuie5vmK5jd7+JzpqmkwnnSYkYZa6DZl HTaaZ9JP8dI= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 561798749906670459 From: Zhangjin Wu To: w@1wt.eu Cc: arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de, conor@kernel.org Subject: [PATCH v2 2/7] selftests/nolibc: allow specify extra arguments for qemu Date: Mon, 29 May 2023 20:56:08 +0800 Message-Id: <209c75f2c15992e95bca4f6c2f96ef7f23ab3fcc.1685362482.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767234081555078070?= X-GMAIL-MSGID: =?utf-8?q?1767234081555078070?= The opensbi package from Ubuntu 20.04 only provides rv64 firmwares: $ dpkg -S opensbi | grep -E "fw_.*bin|fw_.*elf" | uniq opensbi: /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_dynamic.bin opensbi: /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.bin opensbi: /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_dynamic.elf opensbi: /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf To run this nolibc test for rv32, users must build opensbi or download a prebuilt one from qemu repository: https://gitlab.com/qemu-project/qemu/-/blob/master/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin And then use -bios to tell qemu use it to avoid such failure: $ qemu-system-riscv32 -display none -no-reboot -kernel /path/to/arch/riscv/boot/Image -serial stdio -M virt -append "console=ttyS0 panic=-1" qemu-system-riscv32: Unable to load the RISC-V firmware "opensbi-riscv32-generic-fw_dynamic.bin" To run from makefile, QEMU_ARGS_EXTRA is added to allow pass extra arguments like -bios: $ make run QEMU_ARGS_EXTRA="-bios /path/to/opensbi-riscv32-generic-fw_dynamic.bin" ... Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 47c3c89092e4..44088535682e 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -64,7 +64,7 @@ QEMU_ARGS_mips = -M malta -append "panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_riscv = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_s390 = -M s390-ccw-virtio -m 1G -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)" QEMU_ARGS_loongarch = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" -QEMU_ARGS = $(QEMU_ARGS_$(ARCH)) +QEMU_ARGS = $(QEMU_ARGS_$(ARCH)) $(QEMU_ARGS_EXTRA) # OUTPUT is only set when run from the main makefile, otherwise # it defaults to this nolibc directory.