From patchwork Wed Jan 24 12:49:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13529219 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5369C46CD2 for ; Wed, 24 Jan 2024 12:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wlO+tUuJq8UkI+pMTvXjD7yNCbFWugDNTlpdqhavMBA=; b=XjGyjlcdNA2dY1 kzOQfxOILPrzejKrf9Vp0PiO/btiZydTA2BrrFHmgpWv15KUXQB9MC8zGJ5Urh6M5WA1+Xw0pjg/h D3DoxI9tQOKMTh8G8SSiUnQiVLrpGeOJooE+37LRD2P7yqIFmUDMgSWgGpOeB57MdjHNvPf1ZCSWv 3ljb0cg4ZqBz3+JnCN3+LWwO8Gznxk9SiigC/BfgAoPIK8ZqQNc+jbFInxKW7DnqMBWe5dc6xUEDt bN8nPwaXSQz+izdVTtjWyT+4u1kaWZEv2+QCrErSZrSnv/NtKHRRqKQUK2RStK779sIzIStOvCZzP I2ovi9ntZjdLOXGDmxeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSche-003LPc-31; Wed, 24 Jan 2024 12:50:02 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSchb-003LOb-32 for linux-riscv@lists.infradead.org; Wed, 24 Jan 2024 12:50:01 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 623D6CE2D9D; Wed, 24 Jan 2024 12:49:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4086CC43399; Wed, 24 Jan 2024 12:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706100594; bh=CaC190ioRAJx6UTsAkbO9nsrMbRdFg40jhaO3cN77kM=; h=From:To:Cc:Subject:Date:From; b=ibWsyqB+erU4RSF24jjw1C6qoMueVhtfU2aXfmsMl2sPhT5TXjRYS49aui/QeAodC AGyUWXWV7bJvS8NET1YMENjcNHdK389PzYErByoMnAVhE2+Qi5U2sTaaAWhEJf6yxw YTxydscV12T4X5A8BNCAj6y4/BF8VLXEf03foJEKSMxII3KcAEOi++Fx1EK2TMdcAR QejhPuNTsWTfPNUbBgwcO8DMSxRbCzel7pM/mQg+OYQevsG4ng/epmnIRBjN+ooEvp OgyhwFV/GLvs6sQFk9mQVl4hZz4cBGlkJF4NiadedDBGio+vf6T1yg2fUSFqQpEsxs lCOeiKkDbEoFQ== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: qemu-devel@nongnu.org, "Daniel Henrique Barboza" , =?utf-8?q?Christoph_?= =?utf-8?q?M=C3=BCllner?= Cc: linux-riscv@lists.infradead.org, "LIU Zhiwei" , "Andrew Jones" , "Alistair Francis" Subject: qemu riscv, thead c906, Linux boot regression Date: Wed, 24 Jan 2024 13:49:51 +0100 Message-ID: <874jf2rj4g.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240124_045000_173086_C8C8AF4A X-CRM114-Status: UNSURE ( 5.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi! I bumped the RISC-V Linux kernel CI to use qemu 8.2.0, and realized that thead c906 didn't boot anymore. Bisection points to commit d6a427e2c0b2 ("target/riscv/cpu.c: restrict 'marchid' value") Reverting that commit, or the hack below solves the boot issue: --8<-- --8<-- I'm unsure what the correct qemu way of adding a default value is, or if c906 should have a proper marchid. Maybe Christoph or Zhiwei can answer? qemu command-line: qemu-system-riscv64 -nodefaults -nographic -machine virt,acpi=off \ -cpu thead-c906 ... Thanks, Björn diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 8cbfc7e781ad..e18596c8a55a 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -505,6 +505,9 @@ static void rv64_thead_c906_cpu_init(Object *obj) cpu->cfg.ext_xtheadsync = true; cpu->cfg.mvendorid = THEAD_VENDOR_ID; + cpu->cfg.marchid = ((QEMU_VERSION_MAJOR << 16) | + (QEMU_VERSION_MINOR << 8) | + (QEMU_VERSION_MICRO)); #ifndef CONFIG_USER_ONLY set_satp_mode_max_supported(cpu, VM_1_10_SV39); #endif