RFR: 8324280: RISC-V: Incorrect implementation in VM_Version::parse_satp_mode

MaxXing duke at openjdk.org
Wed Jan 24 23:54:35 UTC 2024


Currently, method `VM_Version::os_uarch_additional_features` uses `fgets` to read the contents of `/proc/cpuinfo`, then calls `parse_satp_mode` with a string with the leading "mmu" and whitespaces removed, like ": sv39\n". However, `parse_satp_mode` compares this string directly to "sv39", which always fails and returns `VM_MBARE`.

-------------

Commit messages:
 - Update for `strncmp`.
 - 8324280: RISC-V: Incorrect implementation in VM_Version::parse_satp_mode

Changes: https://git.openjdk.org/jdk/pull/17513/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17513&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8324280
  Stats: 5 lines in 1 file changed: 0 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/17513.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17513/head:pull/17513

PR: https://git.openjdk.org/jdk/pull/17513


More information about the hotspot-runtime-dev mailing list