RFR: 8330171: Lazy W^X switch implementation

Bernhard Urban-Forster burban at openjdk.org
Mon Apr 15 08:35:42 UTC 2024


On Fri, 12 Apr 2024 14:40:05 GMT, Sergey Nazarkin <snazarki at openjdk.org> wrote:

> An alternative for preemptively switching the W^X thread mode on macOS with an AArch64 CPU. This implementation triggers the switch in response to the SIGBUS signal if the *si_addr* belongs to the CodeCache area. With this approach, it is now feasible to eliminate all WX guards and avoid potentially costly operations. However, no significant improvement or degradation in performance has been observed.  Additionally, considering the issue with AsyncGetCallTrace, the patched JVM has been successfully operated with [asgct_bottom](https://github.com/parttimenerd/asgct_bottom) and [async-profiler](https://github.com/async-profiler/async-profiler). 
> 
> Additional testing:
> - [x] MacOS AArch64 server fastdebug *gtets*
> - [ ] MacOS AArch64 server fastdebug *jtreg:hotspot:tier4*
> - [ ] Benchmarking
> 
> @apangin and @parttimenerd could you please check the patch on your scenarios??

I agree that this PR effectively removes the whole idea behind JIT_MAP and thus is a bad idea security wise.  Still it has some value.

@snazarkin do you have numbers on how many transitions are done with your PR vs. the current state when running the same program?  That would give us a lower bound on the amount of transitions needed and define a goal for future improvements in that area.

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

PR Comment: https://git.openjdk.org/jdk/pull/18762#issuecomment-2056182560


More information about the shenandoah-dev mailing list