RFR: 8284196: RISC-V: Detect supported ISA extensions over cpuinfo [v2]

Fei Yang fyang at openjdk.org
Wed Feb 8 01:25:48 UTC 2023


On Tue, 7 Feb 2023 18:36:53 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:

>> Unlike RVC, there is still no hardware that supports those extensions. I think we should do more testing and evaluation on real hardware before enabling them by default.
>> The old code may crash with sigill when users enable unsupported extensions through command line since there is no mechanism to detect multi-letter extensions. With this patch, we could complain `not supported on this CPU`  warning and continue running the program.
>
> QEMU has good enough support to do functional testing. For performance testing, I agree it would be ideal to have proper hardware to test, but even then it's not guaranteed that a performance-minded extension would _actually_ be faster on all given hardwares. For example the original AVX-512 which led to thermal throttling.
> 
> So IMO as long as it's functional, we should want to enable it. We otherwise run the risk of "what about"-ing it until we can never enable it.
> 
> Happy to heard others' opinions as well!

That's a good question. I am thinking that at least the user could enable use of specific ISA extensions on the JVM command line if it turns out to be profitable on their hardware platforms. It should be safe for them to do as this PR adds the necessary detection of availability of those ISA extensions. Previous working experience on other CPU platforms show that it's might be risky in respect of performance for the JVM to auto-enable all those [1][2]: the performance numbers might vary on different vendors. So I guess one possibility is that we might want some vendor-specific control like we do other CPU platforms [3]. But I hope some ISA extensions like bitmanip could be generally profitable across all venders so that the JVM could auto-enable those extension. But that needs more testing on real hardwares to prove. That said, we could at least move JVM options corresponding to those extensions out of the EXPERIMENTAL group for now once they are fully tested in QEMU system, but that
 's another new issue.

[1] https://bugs.openjdk.org/browse/JDK-8292894
[2] https://bugs.openjdk.org/browse/JDK-8295698
[3] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp#L132

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

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


More information about the hotspot-dev mailing list