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

duke duke at openjdk.org
Fri Aug 2 06:04:09 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.
> 
> The following changes were added to the original patch to avoid build errors:
> 1. Use `enum VM_MODE ` instead of `enum UNALIGNED_ACCESS : int ` to avoid c++ build warnings, this is c++11 feature. build log like this :
> 
> /home/zifeihan/riscv-port-jdk11u/src/hotspot/cpu/riscv/vm_version_riscv.hpp:168:27: warning: scoped enums only available with '-std=c++11' or '-std=gnu++11'
>   168 |   enum UNALIGNED_ACCESS : int {
>       |                           ^~~
> In file included from /home/zifeihan/riscv-port-jdk11u/src/hotspot/share/runtime/vm_version.hpp:29
> 
> 2. Use `NULL` instead of `nullptr ` 
> 
> /home/zifeihan/riscv-port-jdk11u/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp:86:79: error: 'nullptr' was not declared in this scope
>    86 |   int ret = sys_riscv_hwprobe(&query[0], sizeof(query) / sizeof(query[0]), 0, nullptr, 0);
>       |
> 
> 3. Use `#include "memory/allocation.hpp"` instead of `#include "memory/allStatic.hpp" `
> 
> ### 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  ...

This pull request has been closed without being integrated.

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

PR: https://git.openjdk.org/riscv-port-jdk11u/pull/20


More information about the riscv-port-dev mailing list