RFR: 8310656: RISC-V: __builtin___clear_cache can fail silently.

Robbin Ehn rehn at openjdk.org
Tue Jun 27 12:46:05 UTC 2023


On Tue, 27 Jun 2023 12:36:09 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp line 60:
>> 
>>> 58: }
>>> 59: 
>>> 60: bool RiscvFlushIcache::test() {
>> 
>> Why not having all this code in src/hotspot/cpu/riscv/icache_riscv.cpp directly? It seems it's going to be (and it should be) the only user of it.
>
> During boot we want to give the user an informative message of what is wrong and not crash.
> Calling RiscvFlushIcache::flush() brings the vm down hard, so we can't call that.
> So the only options would be to expose the syscall and it's defines, which I don't want to.
> Hence a separate method was done.

Note that reason why I bring down the VM is because if we are executing old instructions, anything can happen.
And it can go unnoticed for very long, by bring the VM down directly the user will not get unwanted consequences and have a chance to do a failover before anything bad happens.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14670#discussion_r1243672261


More information about the hotspot-dev mailing list