8265292: [macos_aarch64] java/foreign/TestDowncall.java crashes with SIGBUS

8265183: [macos_aarch64] java/foreign/TestIntrinsics.java crashes with SIGBUS
8265182: [macos_aarch64] java/foreign/TestUpcall.java crashes with SIGBUS

Reviewed-by: dholmes
This commit is contained in:
Anton Kozlov 2021-05-18 18:54:16 +00:00
parent fadf58043c
commit b92c5a44f2
3 changed files with 12 additions and 4 deletions

View file

@ -290,6 +290,14 @@ class VMNativeEntryWrapper {
// LEAF routines do not lock, GC or throw exceptions
// On macos/aarch64 we need to maintain the W^X state of the thread. So we
// take WXWrite on the enter to VM from the "outside" world, so the rest of JVM
// code can assume writing (but not executing) codecache is always possible
// without preliminary actions.
// JavaThread state should be changed only after taking WXWrite. The state
// change may trigger a safepoint, that would need WXWrite to do bookkeeping
// in the codecache.
#define VM_LEAF_BASE(result_type, header) \
debug_only(NoHandleMark __hm;) \
MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, \