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

Robbin Ehn rehn at openjdk.org
Tue Jun 27 14:18:04 UTC 2023


On Tue, 27 Jun 2023 13:06:02 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:

>> 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.
>
> I'm fine with another method, I mean what's the need for a different class and file?

First this is linux/riscv specific. If someone added another os they need to implement this also.
Secondly, there is a theoretical other use-case, if the cpu lacks ifence we can add a method using SYS_RISCV_FLUSH_ICACHE_LOCAL to get the effect.
Now we are using ifence yet, but it was a thought that entered my mind.

On that, note that this syscall is very expensive and we emit it a lot while we have 'code churn'.

So we need to move icache_riscv to linux_riscv and then we could combine them.

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

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


More information about the hotspot-dev mailing list