RFR: 8332689: RISC-V: Use load instead of trampolines [v7]

Robbin Ehn rehn at openjdk.org
Fri Jun 7 11:59:17 UTC 2024


On Fri, 7 Jun 2024 11:52:21 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/relocInfo_riscv.cpp line 84:
>> 
>>> 82:   if (NativeCall::is_at(addr())) {
>>> 83:     NativeCall* nc = nativeCall_at(addr());
>>> 84:     if (nc->reloc_set_destination(x)) {
>> 
>> Seems there is a subtle difference here. Previously, there is a cache invalidation operation in `NativeCall::set_destination_mt_safe` [1] which is called by this `Relocation::pd_set_call_destination`.
>> Now it's gone with this change: it's not there even in `NativeShortCall::reloc_set_destination`.
>> Is that intended? 
>> 
>> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/nativeInst_riscv.cpp#L96
>
> Yes, we do an cache flush for the entire memory after all relocations are done.
> 
> void CodeBuffer::copy_code_to(CodeBlob* dest_blob) {
> ...
>   relocate_code_to(&dest); // reloc done here
> ....
>   // Flush generated code
>   ICache::invalidate_range(dest_blob->code_begin(), dest_blob->code_size());
> }
> 
> 
> As we need todo this for the entire method I can't find a reason why reloc would need it?

I.e. only in mt_safe case we need an invidual cache flush, if instructions where changed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19453#discussion_r1631094069


More information about the hotspot-dev mailing list