RFR: 8369685: RISC-V: refactor code related to RVFeatureValue::enabled [v2]
Hamlin Li
mli at openjdk.org
Wed Oct 15 08:42:09 UTC 2025
On Wed, 15 Oct 2025 06:07:38 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/vm_version_riscv.cpp line 201:
>>
>>> 199: if (UseZicboz && zicboz_block_size.enabled()) {
>>> 200: assert(is_power_of_2(zicboz_block_size.value()) &&
>>> 201: zicboz_block_size.value() > 0, "Sanity");
>>
>> Note the previous discussion about why we need this `> 0` check [1].
>> @robehn mentions that the kernel seems to have a bug: if it can't retrive those value it will return 0 as value for those.
>>
>> So maybe simply do:
>>
>> if (UseZicboz && zicboz_block_size.value() > 0) {
>> assert(is_power_of_2(zicboz_block_size.value()), "Sanity");
>> ......
>>
>>
>> [1] https://github.com/openjdk/jdk/pull/27155#issuecomment-3270608461
>
> Yes, it seems like we need to check these for a non 0 value.
OK, will fix.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27771#discussion_r2431639081
More information about the hotspot-dev
mailing list