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

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


On Tue, 23 Jan 2024 03:47:02 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> 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`.
>
> Verified that this happens after fix for: https://bugs.openjdk.org/browse/JDK-8309258. Note: @robehn

@RealFYang @robehn Thanks for your review!

I'm still waiting for my OCA to pass. Also I'v updated this PR to use `strncmp`.

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

PR Comment: https://git.openjdk.org/jdk/pull/17513#issuecomment-1905688444


More information about the hotspot-runtime-dev mailing list