Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-24 Thread Stuart Monteith
On Tue, 23 Apr 2024 15:11:10 GMT, Andrew Haley wrote: >> What about granting `WXWrite` only if the current thread is in >> `_thread_in_vm`? >> That would be more restrictive and roughly equivalent how it currently >> works. Likely there are some places then that should be granted `WXWrite` >>

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-23 Thread Andrew Haley
On Fri, 19 Apr 2024 07:44:17 GMT, Richard Reingruber 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

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-23 Thread Sergey Nazarkin
On Fri, 19 Apr 2024 07:44:17 GMT, Richard Reingruber 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

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-19 Thread Richard Reingruber
On Fri, 12 Apr 2024 14:40:05 GMT, Sergey Nazarkin 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 >

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-15 Thread Sergey Nazarkin
On Mon, 15 Apr 2024 08:33:25 GMT, Bernhard Urban-Forster wrote: > do you have numbers on how many transitions are done with your PR vs. the > current state when running the same program? With just simple **java -version** it is ~180 vs ~9500 (new vs old), for **java -help** ~1120 vs ~86300.

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-15 Thread Bernhard Urban-Forster
On Fri, 12 Apr 2024 14:40:05 GMT, Sergey Nazarkin 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 >

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-13 Thread Andrew Haley
On Sat, 13 Apr 2024 18:16:21 GMT, Thomas Stuefe wrote: > I have one question, and I'm sorry if it has been answered before. How > expensive is changing the mode? Is it just a status variable in user-space > pthread lib? Or does it need a system call? > > In other words, how fine granular can

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-13 Thread Thomas Stuefe
On Fri, 12 Apr 2024 14:40:05 GMT, Sergey Nazarkin 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 >

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-12 Thread Sergey Nazarkin
On Fri, 12 Apr 2024 15:26:03 GMT, Andrew Haley wrote: >> Hello Sergey. >> W^X mode was initially forced by Apple to prevent writing to executable >> memory, as a security feature. >> This change just eliminates this security feature at all, doesn't it ? >> Basically: "want to write to

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-12 Thread Vladimir Kempik
On Fri, 12 Apr 2024 14:40:05 GMT, Sergey Nazarkin 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 >

Re: RFR: 8330171: Lazy W^X switch implementation

2024-04-12 Thread Andrew Haley
On Fri, 12 Apr 2024 14:50:46 GMT, Vladimir Kempik wrote: > Hello Sergey. W^X mode was initially forced by Apple to prevent writing to > executable memory, as a security feature. This change just eliminates this > security feature at all, doesn't it ? Basically: "want to write to Executable >