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

Robbin Ehn rehn at openjdk.org
Mon Jun 19 17:13:15 UTC 2023


> Hi, please consider.
> 
> Linux kernel 6.4 will come with the new syscall https://docs.kernel.org/riscv/hwprobe.html to determine CPU and features.
> RV cpus features/capabilities can vastly differ and it is not feasible for users to manually enable the correct feature set.
> Today the VM uses the ELF aux vector and cpuinfo to gather some information about CPU capabilities.
> 
> Currently features are track with a bit field, this is insufficient.
> There are many capabilities and these can have values attached to them.
> CPU features should also be possible to turn if we can determine vendor (hwprobe).
> 
> This patchs adds the syscall, uses the syscall in combination with the aux and cpuinfo to enable features by default.
> If there is a vendor specific path it calls that in addition.
> Then we build the feature string(and bit field) and update flags accordingly.
> 
> Tested t1 and hwprobe with:
> https://lore.kernel.org/qemu-devel/7f8d733df6e9b6151e9efb843d55441348805e70.camel@rivosinc.com/

Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:

  removed q and zbc from rivos common features

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/14445/files
  - new: https://git.openjdk.org/jdk/pull/14445/files/55f2462c..32e3f756

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=14445&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14445&range=06-07

  Stats: 2 lines in 1 file changed: 0 ins; 2 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/14445.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14445/head:pull/14445

PR: https://git.openjdk.org/jdk/pull/14445


More information about the hotspot-dev mailing list