RFR: 8309258: RISC-V: Add riscv_hwprobe syscall [v6]

Robbin Ehn rehn at openjdk.org
Mon Jun 19 07:52:10 UTC 2023


On Mon, 19 Jun 2023 07:07:39 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   rivos mvendorid was not proper encoded.
>
> src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp line 196:
> 
>> 194:         if (strncmp(buf, "uarch", sizeof "uarch" - 1) == 0) {
>> 195:           ret = os::strdup(p + 2);
>> 196:           ret[strcspn(p, "\n")] = '\0';
> 
> This line was triggering some NMT corruption errors when running tier1 test on unmatched board. I think this should be: `ret[strcspn(ret, "\n")] = '\0';`.

Since ret is identical to 'p' (but larger), the number of chars is identical.
I don't have a system which return uarch in cpuinfo, and I have not seen one, so I can't test this path.
What are you testing on?


rehn at rv:~/source/gdb/binutils-gdb$ uname -a ; grep -i "uarch|mmu" /proc/cpuinfo  | uniq 
Linux rv 6.2.0-19-generic #19.1-Ubuntu SMP Fri Mar 31 12:41:53 UTC 2023 riscv64 riscv64 riscv64 GNU/Linux
mmu		: sv48



I don't mind pushing your suggested change, but I fail to understand how that can fix something :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14445#discussion_r1233658652


More information about the hotspot-dev mailing list