RFR: 8310656: RISC-V: __builtin___clear_cache can fail silently. [v3]

Vladimir Kempik vkempik at openjdk.org
Sun Jul 2 13:42:11 UTC 2023


On Sat, 1 Jul 2023 11:11:15 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> Hi, please consider.
>> 
>> We recently had a bug where user were missing permissions to use this syscall.
>> Which caused crashing on, according to hs_err on things like "addi x11, x24, 0" with SIGILL.
>> If it fails it is even possible to execute valid but 'old' instruction which may not lead to a crash, instead the program misbehaves.
>> 
>> To avoid this mess I suggest that we first test the syscall during vm init and we use it directly.
>> This way we can make sure it never fails.
>> 
>> Tested failing syscall with qemu, tested t1 in qemu, t1 on jh7110 in-progress.
>
> Robbin Ehn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - merge update and nits
>  - Merge branch 'master' into 8310656
>  - added back data barrier
>    
>    Signed-off-by: Robbin Ehn <rehn at rivosinc.com>
>  - 8310656: RISC-V: __builtin___clear_cache can fail silently.

We had an issue with __builtin___clear_cache and clang-compiled jvm linked with libstdc++ ( instead of libc++) where calling __builtin___clear_cache was resulting in the NOP. 
This effectively fixes that case as well.

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

PR Comment: https://git.openjdk.org/jdk/pull/14670#issuecomment-1616664877


More information about the hotspot-dev mailing list