RFR: 8295282: Use Zicboz/cbo.zero to zero-out memory on RISC-V [v11]
Ludovic Henry
luhenry at openjdk.org
Mon Oct 24 09:26:47 UTC 2022
On Mon, 24 Oct 2022 09:13:09 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> We can already do auto-detection via `/proc/cpuinfo`. I agree it's not the best way nor the most stable way, and I can only assume there will be a better way, but there is already a way.
>>
>> I'll remove this `CacheLineSize` flag for now and we'll revisit later.
>
>> We can already do auto-detection via `/proc/cpuinfo`. I agree it's not the best way nor the most stable way, and I can only assume there will be a better way, but there is already a way.
>
> I think I mean extensions like 'Zba', 'Zbb', etc here.
> Are you sure those could be detected from `/proc/cpuinfo`?
> I am assuming that only works for extensions contained in RV64GCV (IMAFDCV).
This is a sample of `/proc/cpuinfo` on a QEMU:
processor : 0
hart : 30
isa : rv64imafdcvh_zicsr_zifencei_zihintpause_zba_zbb_zbc_zbs_sstc
mmu : sv48
You can `strstr` (or some alternative of it) on the `isa` string for the extension you want. That `isa` string comes from the kernel at https://github.com/torvalds/linux/blob/master/arch/riscv/kernel/cpu.c#L141-L146. The obvious problem at the moment is that not all extensions have been added here which is why we will want a better detection mechanism. However, on custom kernels, you can have most of the extensions you want.
-------------
PR: https://git.openjdk.org/jdk/pull/10718
More information about the hotspot-dev
mailing list