From nobody Tue Nov 26 16:28:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1706100642; cv=none; d=zohomail.com; s=zohoarc; b=S2a3RAecnWMKwMLQYS6Q52mS7ZQ8cRjhx76RwX2uuzgqpG99YafLNh2iuinp57sNFmeBRKwLnqPXlJdQZ4e5KnNmMFW1Xfm/mA6wnuhQLnbpQNtRW1t5UkarvelE6jHgR4Dye5sGV342skfDSOQRkrAoH2O/4wraZx+BPY4hZY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706100642; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EMtJwTt8pgRsJ9PfuYw0/igYUJt8uPuz+yc6AYmxvGU=; b=bmJeTFUqRhE58Eqchcv5S/Pgoy4kXU22zgXyna2hV7emWOjSOeU1sYAPiCuqdMHRoxqjTFnxn3/hPXu2/6aF9WckNoM3KeCsgwurJC5ZBUuFhIrNrEPfdj5IacyiYB3oXvdjegsOkTewpcoMbicmGeTmv2sVVwNELScd/JVPSBY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706100642355746.049727149751; Wed, 24 Jan 2024 04:50:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSchl-00013R-7C; Wed, 24 Jan 2024 07:50:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSchh-00012k-92 for qemu-devel@nongnu.org; Wed, 24 Jan 2024 07:50:06 -0500 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSchf-0008PI-1r for qemu-devel@nongnu.org; Wed, 24 Jan 2024 07:50:04 -0500 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_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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2604:1380:40e1:4800::1; envelope-from=bjorn@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -58 X-Spam_score: -5.9 X-Spam_bar: ----- X-Spam_report: (-5.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1706100642948100001 Content-Type: text/plain; charset="utf-8" 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<-- 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 =3D true; =20 cpu->cfg.mvendorid =3D THEAD_VENDOR_ID; + cpu->cfg.marchid =3D ((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 --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=3Doff \ -cpu thead-c906 ... Thanks, Bj=C3=B6rn