On Tue, 9 Feb 2021 09:12:13 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:

>> Anton Kozlov has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Update signal handler part for debugger
>
> src/hotspot/share/runtime/thread.hpp line 848:
> 
>> 846:   void init_wx();
>> 847:   WXMode enable_wx(WXMode new_state);
>> 848: #endif // __APPLE__ && AARCH64
> 
> Now that this is only compiled into macOS/AArch64, could this be moved over 
> to thread_bsd_aarch64.hpp? The same goes for the associated functions.

The thread_bsd_aarch64.hpp describes a part of JavaThread, while this block 
belongs to Thread for now. Since W^X is an attribute of any operating system 
thread, I assumed Thread to be the right place for W^X bookkeeping. 

In most cases, we manage W^X state of JavaThread. But sometimes a GC thread 
needs the WXWrite state, or safefetch is called from non-JavaThread. Probably 
this can be dealt with (e.g. GCThread to always have the WXWrite state). But 
such change would be much more than a simple refactoring and it would require a 
significant amount of testing. Ideally, I would like to investigate this as a 
follow-up change, or at least after other fixes to this PR.

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

PR: https://git.openjdk.java.net/jdk/pull/2200

Reply via email to