On Tue, 22 Apr 2025 16:34:21 GMT, Hamlin Li <m...@openjdk.org> wrote:

>> Vladimir Ivanov has updated the pull request with a new target base due to a 
>> merge or a rebase. The incremental webrev excludes the unrelated changes 
>> brought in by the merge/rebase. The pull request contains 24 additional 
>> commits since the last revision:
>> 
>>  - Merge remote-tracking branch 'origin/master' into vector.math.01.java
>>  - RVV and SVE adjustments
>>  - fix broken merge
>>  - Merge branch 'master' into vector.math.01.java
>>  - Fix debugName handling
>>  - Merge branch 'master' into vector.math.01.java
>>  - RVV and SVE adjustments
>>  - Merge branch 'master' into vector.math.01.java
>>  - Fix windows-aarch64 build failure
>>  - features_string -> cpu_info_string
>>  - ... and 14 more: https://git.openjdk.org/jdk/compare/88f7b422...88eacc48
>
> src/hotspot/share/runtime/abstract_vm_version.cpp line 349:
> 
>> 347:   assert(features_offset <= cpu_info_string_len, "");
>> 348:   if (features_offset < cpu_info_string_len) {
>> 349:     assert(cpu_info_string[features_offset + 0] == ',', "");
> 
> This assert fails on riscv.

A simple fix could be:

diff --git a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp 
b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
index 484a2a645aa..a785dc65c9e 100644
--- a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
+++ b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
@@ -196,25 +196,12 @@ void VM_Version::setup_cpu_available_features() {
 
   _cpu_info_string = os::strdup(buf);
 
-  _features_string = extract_features_string(_cpu_info_string,
-                                             strnlen(_cpu_info_string, 
sizeof(buf)),
-                                             features_offset);
+  _features_string = _cpu_info_string;
 }

> src/hotspot/share/runtime/abstract_vm_version.hpp line 61:
> 
>> 59:   static const char* _features_string;
>> 60: 
>> 61:   static const char* _cpu_info_string;
> 
> Not quite sure the reason to introduce `_cpu_info_string`.
> Seems to me you could just use _features_string, and remove _cpu_info_string 
> and its related code, e.g. `extract_features_string`. Please check the code 
> in `test/lib/jdk/test/whitebox/cpuinfo/CPUInfo.java`

Mayber in `CPUFeatures`, could use the similar code as `CPUInfo` to split the 
cpu string into cpu features?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24462#discussion_r2054485082
PR Review Comment: https://git.openjdk.org/jdk/pull/24462#discussion_r2054697247

Reply via email to