RFR: 8329823: RISC-V: Need to sync CPU features with related JVM flags
Gui Cao
gcao at openjdk.org
Tue Apr 9 09:36:10 UTC 2024
On Mon, 8 Apr 2024 07:55:00 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> Hi, As described by [8329823](https://bugs.openjdk.org/browse/JDK-8329823), currently, "features" string is not accurate in that the RISC-V CPU features/extensions which are disabled by user on the command are still added. We need to synchronize these features with related JVM flags so that "features" string can reflect actual usable CPU features.
>>
>>
>> ### Testing
>> - [x] Run tier1 tests on SOPHON SG2042 (release)
>>
>> Results without specifying any jvm flags(After applying this patch)
>>
>>
>> $ /home/zifeihan/jtreg/bin/jtreg -jdk:/home/zifeihan/jre/jdk /home/zifeihan/jdk/test/lib-test/jdk/test/whitebox/CPUInfoTest.java
>>
>> ----------System.out:(4/178)----------
>> WB.getCPUFeatures(): "rv64 i m a f d c v zba zbb zbs zvkn"
>> CPUInfo.getAdditionalCPUInfo(): ""
>> CPUInfo.getFeatures(): [rv64, i, m, a, f, d, c, v, zba, zbb, zbs, zvkn]
>> TEST PASSED
>>
>>
>> Results with specifying `-XX:-UseZba`(After applying this patch)
>>
>>
>> $ /home/zifeihan/jtreg/bin/jtreg -javaoption:-XX:-UseZba -jdk:/home/zifeihan/jre/jdk /home/zifeihan/jdk/test/lib-test/jdk/test/whitebox/CPUInfoTest.java
>>
>> ----------System.out:(4/158)----------
>> ----------System.out:(4/169)----------
>> WB.getCPUFeatures(): "rv64 i m a f d c v zbb zbs zvkn"
>> CPUInfo.getAdditionalCPUInfo(): ""
>> CPUInfo.getFeatures(): [rv64, i, m, a, f, d, c, v, zbb, zbs, zvkn]
>> TEST PASSED
>>
>>
>> Results with specifying `-XX:+UseZba`(After applying this patch)
>>
>>
>> $ /home/zifeihan/jtreg/bin/jtreg -javaoption:-XX:+UseZba -jdk:/home/zifeihan/jre/jdk /home/zifeihan/jdk/test/lib-test/jdk/test/whitebox/CPUInfoTest.java
>>
>> ----------System.out:(4/178)----------
>> WB.getCPUFeatures(): "rv64 i m a f d c v zba zbb zbs zvkn"
>> CPUInfo.getAdditionalCPUInfo(): ""
>> CPUInfo.getFeatures(): [rv64, i, m, a, f, d, c, v, zba, zbb, zbs, zvkn]
>> TEST PASSED
>
> Looks reasonable to me.
@RealFYang @robehn : Thanks for the review.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18668#issuecomment-2044563705
More information about the hotspot-dev
mailing list