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

Robbin Ehn rehn at openjdk.org
Wed Jun 14 09:04:59 UTC 2023


On Wed, 14 Jun 2023 07:25:08 GMT, Fei Yang <fyang at openjdk.org> wrote:

> Thanks for the work. Two comments after a cursory look.

Thanks!

> src/hotspot/cpu/riscv/vm_version_riscv.hpp line 110:
> 
>> 108:   // mvendorid Manufactory JEDEC
>> 109:   // marchid   Manufactory prop.
>> 110:   // mimpid    Manufactory prop.
> 
> I think the code comments for marchid and mimpid could be improved.

Ok, I'll fix something!

> src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp line 212:
> 
>> 210: }
>> 211: 
>> 212: void VM_Version::rivos_features() {
> 
> It looks to me not safe to only check vendor ID when enabling those features. It's possible for a vendor to have different CPU models equipped different RISC-V extensions. So it's more reasonable to add check for `marchid` & `mimpid` here which helps distinguish Architecture ID & Implementaion ID of the CPU.

Yes, correct.
The idea was that the vendor can add these checks in it's specific path.
For us enabling these basic features are fine, since they are common to march/mimpid, hence we do not yet need to check these.

Hope that explains it.

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

PR Comment: https://git.openjdk.org/jdk/pull/14445#issuecomment-1590788217
PR Review Comment: https://git.openjdk.org/jdk/pull/14445#discussion_r1229265092
PR Review Comment: https://git.openjdk.org/jdk/pull/14445#discussion_r1229264665


More information about the hotspot-dev mailing list