RFR: 8328306: AArch64: MacOS lazy JIT "write xor execute" switching [v2]

Bernhard Urban-Forster burban at openjdk.org
Tue Aug 12 08:34:15 UTC 2025


On Tue, 12 Aug 2025 07:54:38 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp line 265:
>> 
>>> 263:     // is called by the signal handler at arbitrary point of
>>> 264:     // execution.
>>> 265:     ThreadWXEnable wx(WXWrite, thread);
>> 
>> Having this done by default is a bit scary.   How about adding a flag to enable it e.g. with `-XX:+WXHealing` and error out here if not enabled, with a helpful message that mentions the option to enable WX healing?
>
>> Having this done by default is a bit scary. 
> 
> It's not new, it's just been moved a bit later.
> 
>> How about adding a flag to enable it e.g. with `-XX:+WXHealing` and error out here if not enabled, with a helpful message that mentions the option to enable WX healing?
> 
> It's not really connected with healing.

Sorry, my comment was meant for the block handling `SIGBUS`. 

I guess the argument why it's safer than e.g. the previous approach in https://github.com/openjdk/jdk/pull/18762/files#diff-9dcc5bcf908e2f8eb00b2c2837d667687a7540936d8f538ee1ea14e31ad50b40, is that the transition is only done if the WX state is already "armed".  Sounds okay to have this on by default, so disregard my initial comment.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26562#discussion_r2269107697


More information about the hotspot-dev mailing list