RFR: 8295282: Use Zicboz/cbo.zero to zero-out memory on RISC-V [v6]

Ludovic Henry luhenry at openjdk.org
Fri Oct 21 13:56:51 UTC 2022


On Fri, 21 Oct 2022 12:11:28 GMT, Vladimir Kempik <vkempik at openjdk.org> wrote:

>> That was done to answer https://github.com/openjdk/jdk/pull/10718#discussion_r996410678. Ideally it would be detected at runtime. However, I don't know of any API in RISC-V or Linux to get that information.
>
> This could be an answer to the issue - https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc#rva22-profiles 
> 
> The following mandatory feature was further restricted in RVA22U64:
> ....
> Zic64b Cache blocks must be 64 bytes in size, naturally aligned in the address space.
> 
> Note | While the general RISC-V specifications are agnostic to cache block size, selecting a common cache block size simplifies the specification and use of the following cache-block extensions within the application processor profile. Software does not have to query a discovery mechanism and/or provide dynamic dispatch to the appropriate code. We choose 64 bytes at it is effectively an industry standard. Implementations may use longer cache blocks to reduce tag cost provided they use 64-byte sub-blocks to remain compatible. Implementations may use shorter cache blocks provided they sequence cache operations across the multiple cache blocks comprising a 64-byte block to remain compatible.
> 
> We can already create a flag: e.g. -XX:+UseRVA22U64BASE which will activate Zba, Zbb, Zicbom and set cache block size to 64-bytes

I'll add a check like the following:

if (!UseZic64b) {
  if (FLAG_IS_DEFAULT(UseZicboz)) {
    FLAG_SET_DEFAULT(UseZicboz, false);
  }
}

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

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


More information about the hotspot-dev mailing list