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

Hamlin Li mli at openjdk.org
Wed Sep 10 09:12:23 UTC 2025


On Wed, 10 Sep 2025 02:06:34 GMT, Dingli Zhang <dzhang at openjdk.org> wrote:

>> Hi,
>> Can you help to review this patch? Thanks!
>> 
>> We can extends RISC-V hwprobe support to include `RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE`.
>> The probed value is recorded in VM_Version::zicboz_block_size and then used to set the global CacheLineSize.
>> This ensures correct usage of the Zicboz extension, as block zeroing instructions operate on cache-line granularity.
>> 
>> FYI: https://docs.kernel.org/arch/riscv/hwprobe.html
>
> Dingli Zhang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Replace CacheLineSize with zicboz_block_size in block zeroing logic

src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp line 91:

> 89: #define   RISCV_HWPROBE_MISALIGNED_UNSUPPORTED  (4 << 0)
> 90: #define   RISCV_HWPROBE_MISALIGNED_MASK         (7 << 0)
> 91: #define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6

better to have a new line.

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

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


More information about the hotspot-dev mailing list