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

Gui Cao gcao at openjdk.org
Tue Apr 9 10:44:14 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

This pull request has now been integrated.

Changeset: b9331cd2
Author:    Gui Cao <gcao at openjdk.org>
Committer: Fei Yang <fyang at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/b9331cd25ca88b07ce079405f5e3031cf8c13ea6
Stats:     29 lines in 2 files changed: 18 ins; 2 del; 9 mod

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

Reviewed-by: fyang, rehn

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

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


More information about the hotspot-dev mailing list