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

Robbin Ehn rehn at openjdk.org
Wed Jan 24 23:54:36 UTC 2024


On Mon, 22 Jan 2024 08:39:28 GMT, MaxXing <duke 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`.

Ah, thanks! (you need to fix the OCA: https://openjdk.org/contribute/)

I asked for a bunch of extensions in hwprobe and got allmost all.
I forgot about this one, I'll ask for it to be included in hwprobe.
Another approach seems to be to use mmap + hint.

Maybe use strncmp(vm_mode, 4, "svXX").

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

Marked as reviewed by rehn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17513#pullrequestreview-1838034077


More information about the hotspot-runtime-dev mailing list