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

Thomas Stuefe stuefe at openjdk.org
Sat Jul 1 08:04:55 UTC 2023


On Fri, 30 Jun 2023 08:51:16 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.
>
> Pushed small update.

@robehn Thanks for the thorough explanation!
 
> So I feel more comfortable with the VM explicit emitting this syscall, so everyone can see exactly what we are doing.

I agree, rather do the real thing explicitly than use - and then have to second-guess - a wrapper.

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

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


More information about the hotspot-dev mailing list