RFR: 8333245: RISC-V: UseRVV option can't be enabled after JDK-8316859

Gui Cao gcao at openjdk.org
Fri May 31 05:55:01 UTC 2024


On Thu, 30 May 2024 13:50:03 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> Because some dev boards only support RVV version 0.7, In [JDK-8316859](https://bugs.openjdk.org/browse/JDK-8316859) we masked the use of HWCAP to probe for RVV extensions, and in the meantime, we can use hwprobe to probe for V extensions in Linux kernel 6.5 and above. But recently we got Banana Pi BPI-F3 board (has RVV1.0), but his kernel is 6.1.15, so the V extensions detected by HWCAP are masked. And we get the warning: `RVV is not supported on this CPU` when we enable UseRVV with the command, and we can't enable UseRVV correctly.
>> 
>> Without Patch:
>> 
>> zifeihan at bananapif3:~/jre/jdk/bin$ ./java -XX:+PrintFlagsFinal -XX:+UseRVV -version | grep UseRVV
>> OpenJDK 64-Bit Server VM warning: RVV is not supported on this CPU
>>      bool UseRVV                                   = false                                {ARCH product} {command line}
>>      bool UseRVVForBigIntegerShiftIntrinsics       = false                                {ARCH product} {default}
>> openjdk version "23-internal" 2024-09-17
>> OpenJDK Runtime Environment (build 23-internal-adhoc.zifeihan.jdk)
>> OpenJDK 64-Bit Server VM (build 23-internal-adhoc.zifeihan.jdk, mixed mode)
>> 
>> 
>> With Patch:
>> 
>> zifeihan at bananapif3:~/jre/jdk/bin$ ./java -XX:+PrintFlagsFinal -XX:+UseRVV -version | grep UseRVV
>>      bool UseRVV                                   = true                                 {ARCH product} {command line}
>>      bool UseRVVForBigIntegerShiftIntrinsics       = true                                 {ARCH product} {default}
>> openjdk version "23-internal" 2024-09-17
>> OpenJDK Runtime Environment (build 23-internal-adhoc.zifeihan.jdk)
>> OpenJDK 64-Bit Server VM (build 23-internal-adhoc.zifeihan.jdk, mixed mode)
>
> Another suggestion, it seem like you can ge the triplet mvendorid/marchid/mimpid from /proc/cpuinfo.
> So if we can grab those from VM_Version::os_uarch_additional_features() when available and no hwprobe.
> We can set those 3, and in VM_Version::vendor_features() check if this is BananPie.
> With big warning that kernel do not support vector let user run with vector ?
> 
> So that way THEAD is unaffected.
> 
> From random internet user:
> 
> bananapif3:~$ cat /proc/cpuinfo
> processor : 0
> hart : 0
> model name : Spacemit(R) X60
> isa : rv64imafdcv_sscofpmf_sstc_svpbmt_zicbom_zicboz_zicbop_zihintpause
> mmu : sv39
> mvendorid : 0x710
> marchid : 0x8000000058000001
> mimpid : 0x1000000049772200

@robehn @RealFYang : Thanks for the review. I'm so sorry, I think I missed the fact that kernel support for Vector extension is only available since 6.5. I agree that that UseRVV option should only be turned on if kernel support for is guaranteed first, so I think this issue can be closed.

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

PR Comment: https://git.openjdk.org/jdk/pull/19472#issuecomment-2141278959


More information about the hotspot-dev mailing list