[riscv-port-jdk11u:riscv-port] RFR: 8309258: RISC-V: Add riscv_hwprobe syscall

Fei Yang fyang at openjdk.org
Wed Apr 10 07:21:12 UTC 2024


On Wed, 10 Apr 2024 05:19:34 GMT, Gui Cao <gcao at openjdk.org> wrote:

> Hi, 
> Please help review this backport to riscv-port-jdk11u.
> Backport of [8309258](https://bugs.openjdk.org/browse/JDK-8309258), [8315206](https://bugs.openjdk.org/browse/JDK-8315206), [8316859](https://bugs.openjdk.org/browse/JDK-8316859), [8324280](https://bugs.openjdk.org/browse/JDK-8324280), [8315652](https://bugs.openjdk.org/browse/JDK-8315652)
> 
> Since [8315195](https://bugs.openjdk.org/browse/JDK-8315195) hasn't been backported yet, the RVV,Zba,Zbb extension hasn't been turned on automatically yet.
> 
> This backport adds the syscall, uses the syscall in combination with the aux and cpuinfo to enable features by default.
> 
> ### Testing on SOPHON SG2042
> 
> $ ./java -XX:+UnlockExperimentalVMOptions -XX:+PrintFlagsFinal -version | grep Use
>      bool UseRVC                                   = true                            {ARCH experimental} {default}
>      bool UseRVV                                   = false                           {ARCH experimental} {default}
>      bool UseZba                                   = false                           {ARCH experimental} {default}
>      bool UseZbb                                   = false                           {ARCH experimental} {default}
> 
> test/lib/sun/hotspot/cpuinfo/CPUInfo.java  log like this:
> 
> ----------System.out:(13/2767)----------
> WB.getCPUFeatures(): "qemu rv64 i m a f d c"
> CPUInfo.getFeatures(): [qemu, rv64, i, m, a, f, d, c]
> 
> 
> ### Testing on qemu-system
> 
> $ ./java -XX:+UnlockExperimentalVMOptions -XX:+PrintFlagsFinal -version | grep Use
>      bool UseRVC                                   = true                            {ARCH experimental} {default}
>      bool UseRVV                                   = false                           {ARCH experimental} {default}
>      bool UseZba                                   = false                           {ARCH experimental} {default}
>      bool UseZbb                                   = false                           {ARCH experimental} {default}
> 
> test/lib/sun/hotspot/cpuinfo/CPUInfo.java  log like this:
> 
> ----------System.out:(13/2290)----------
> WB.getCPUFeatures(): "rv64 i m a f d c"
> CPUInfo.getFeatures(): [rv64, i, m, a, f, d, c]
> 
> 
> ### Testing 
> - [x] Run tier1 tests on SOPHON SG2042 (release)

I see the original commit of https://bugs.openjdk.org/browse/JDK-8309258 touches `UseZbs` which is not there in this repo yet. So I think you should backport https://bugs.openjdk.org/browse/JDK-8297715 first.

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

PR Comment: https://git.openjdk.org/riscv-port-jdk11u/pull/20#issuecomment-2046697547


More information about the riscv-port-dev mailing list