RFR: 8296975: RISC-V: Enable UseRVA20U64 profile by default [v3]
Ludovic Henry
luhenry at openjdk.org
Wed Nov 16 08:20:09 UTC 2022
On Wed, 16 Nov 2022 05:21:52 GMT, Xiaolin Zheng <xlinzheng at openjdk.org> wrote:
>> The main purpose is to turn the option `UseRVC` on by default before JDK20 RDP 1. As per discussions [1], we can enable `UseRVA20U64`[2] by default to fulfill this.
>>
>>
>>> build/linux-riscv64-server-fastdebug/images/jdk/bin/java -XX:+PrintFlagsFinal -version | grep -E "UseRVC|UseRVA20U64"
>> bool UseRVA20U64 = true {ARCH product} {default}
>> bool UseRVC = true {ARCH product} {default}
>> openjdk version "20-internal" 2023-03-21
>> OpenJDK Runtime Environment (fastdebug build 20-internal-adhoc..jdk)
>> OpenJDK 64-Bit Server VM (fastdebug build 20-internal-adhoc..jdk, mixed mode)
>>
>>
>> [1] https://mail.openjdk.org/pipermail/riscv-port-dev/2022-November/000668.html
>> [2] https://github.com/openjdk/jdk/blob/873eccde01895de06e2216f6838d52d07188addd/src/hotspot/cpu/riscv/vm_version_riscv.cpp#L39-L44
>>
>> Thanks,
>> Xiaolin
>
> Xiaolin Zheng has updated the pull request incrementally with one additional commit since the last revision:
>
> minor issue if users specify command line -XX:+UseRVA20U64 and RVC is not supported
Given the RVC is a _mandatory_ extension of `RVA20U64`, but also that `RVA20U64` can imply other extensions ([full list of mandatory extensions](https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc#512-rva20u64-mandatory-extensions)), I wouldn't just disable `RVA20U64` when RVC isn't available, but I would fail completely the JVM. Getting in such case would mean that a hardware is implementing only parts of the __mandatory__ list of extensions for a given profile.
I understand that it puts the approach of this PR in question though, and I'm wondering why we need to enable a whole profile when we are trying to enable only one of the feature (RVC) and we also have feature flag detection for this feature (`_features & CPU_C`). It would just be better IMO to do proper feature detection and use that to enable/disable features, just like other platforms.
-------------
PR: https://git.openjdk.org/jdk/pull/11155
More information about the hotspot-dev
mailing list