Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISCV64 build fails to start in Qemu #940

Closed
tresf opened this issue Nov 4, 2023 · 1 comment
Closed

RISCV64 build fails to start in Qemu #940

tresf opened this issue Nov 4, 2023 · 1 comment

Comments

@tresf
Copy link

tresf commented Nov 4, 2023

Question

Running the nightly build of OpenJDK 21 fails to start in Qemu using the virt machine type.

  • /usr/lib/jvm/java-11-openjdk-riscv64/bin/java --version (Zero VM)
  • 🚫 /usr/lib/jvm/java-17-openjdk-riscv64/bin/java --version "Unsupported satp mode"
  • 🚫 /usr/lib/jvm/java-21-openjdk-riscv64/bin/java --version "fatal / java.lang.System.registerNatives()"
  • 🚫 ~/temurin/jdk-21.0.1+12/bin/java --version "fatal / java.lang.System.registerNatives()"

Logs: https://gist.github.com/tresf/3c9672633fe664b9dd170f2983cea566

  • Are there instructions sets missing from virt that OpenJDK 21 for RISCV64 is expecting? If so, should I switch to a different machine type? (See "Board-specific documentation" below)
  • Is this issue related to library or dependency?
  • This same issue occurs running the fizzed binaries here, does this suggest I'm doing something wrong? https://github.com/fizzed/nitro

Qemu offers several hardware emulations, quoting:

Board-specific documentation

  • Unfortunately many of the RISC-V boards QEMU supports are currently undocumented; you can get a complete list by running qemu-system-riscv64 --machine help, or qemu-system-riscv32 --machine help.
    • Microchip PolarFire SoC Icicle Kit (microchip-icicle-kit)
    • Shakti C Reference Platform (shakti_c)
    • SiFive HiFive Unleashed (sifive_u)
    • ‘virt’ Generic Virtual Platform (virt)

Context

Java version:

OpenJDK21U-jdk_riscv64_linux_hotspot_ea_21-0-1-12.tar.gz

Your operating system and platform:

uname -a

Linux debian 6.1.0-1-riscv64 #1 SMP Debian 6.1.4-1 (2023-01-07) riscv64 GNU/Linux

/etc/os-release

PRETTY_NAME="Debian GNU/Linux trixie/sid"
NAME="Debian GNU/Linux"
VERSION_CODENAME=trixie
...

Linking #664

@tresf
Copy link
Author

tresf commented Nov 4, 2023

Installing OpenJDK 17 actually gave a usable error and I was able to fix this:

Unsupported satp mode: sv57. Only satp modes up to sv48 are supported for now.

According to this mailing list thread, fixing this requires compiling Qemu, but fortunately newer Qemu versions were patched to allow a new flag:

qemu-system-riscv64 \
...
- -cpu rv64 \
+ -cpu rv64,sv57=off \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant