qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* qemu riscv, thead c906, Linux boot regression
@ 2024-01-24 12:49 Björn Töpel
  2024-01-24 13:13 ` Conor Dooley
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Björn Töpel @ 2024-01-24 12:49 UTC (permalink / raw)
  To: qemu-devel, Daniel Henrique Barboza, Christoph Müllner
  Cc: linux-riscv, LIU Zhiwei, Andrew Jones, Alistair Francis

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 = 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
--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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-01-25  9:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 12:49 qemu riscv, thead c906, Linux boot regression Björn Töpel
2024-01-24 13:13 ` Conor Dooley
2024-01-24 13:27   ` Björn Töpel
2024-01-24 13:49     ` Conor Dooley
2024-01-24 13:38 ` Daniel Henrique Barboza
2024-01-24 19:26   ` Björn Töpel
2024-01-24 20:02     ` Daniel Henrique Barboza
2024-01-25  8:48       ` Björn Töpel
2024-01-25  9:13 ` LIU Zhiwei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).