RFR: 8329823: RISC-V: Need to sync CPU features with related JVM flags

Gui Cao gcao at openjdk.org
Mon Apr 8 08:16:01 UTC 2024


On Sun, 7 Apr 2024 08:53:57 GMT, Gui Cao <gcao 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

@robehn : May I ask if this makes sense to you? Thanks.

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

PR Comment: https://git.openjdk.org/jdk/pull/18668#issuecomment-2042128807


More information about the hotspot-dev mailing list