RFR: 8367137: RISC-V: Detect Zicboz block size via hwprobe [v2]

Dingli Zhang dzhang at openjdk.org
Tue Sep 9 08:26:46 UTC 2025


On Tue, 9 Sep 2025 06:55:03 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Dingli Zhang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix typo
>
> src/hotspot/cpu/riscv/vm_version_riscv.cpp line 184:
> 
>> 182:   }
>> 183: 
>> 184:   if (UseZicboz) {
> 
> I don't think it's safe to turn on `UseBlockZeroing` without knowing the actual cache block size.
> So we might want to add check for that here. Maybe change this if condition into something like:
> 
> if (UseZicboz && (UseZic64b || zicboz_block_size.enabled())) {

Fixed.

> src/hotspot/cpu/riscv/vm_version_riscv.cpp line 187:
> 
>> 185:     if (zicboz_block_size.enabled()) {
>> 186:       assert(UseZic64b ? zicboz_block_size.value() == 64 : true, "Zicboz block size should be 64 when UseZic64b is true");
>> 187:       assert(is_power_of_2(zicboz_block_size.value()), "CacheLineSize must be a power of 2");
> 
> Can we merge the two assertions into one? Like:
> `assert(UseZic64b ? zicboz_block_size.value() == 64 : is_power_of_2(zicboz_block_size.value()), "Sanity");`

Thanks! Fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27155#discussion_r2332476372
PR Review Comment: https://git.openjdk.org/jdk/pull/27155#discussion_r2332476152


More information about the hotspot-dev mailing list