8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP

Use mmap on AIX to allocate protected page. Use trap instructions for polling if UseSIGTRAP is enabled.

Reviewed-by: rehn, goetz
This commit is contained in:
Martin Doerr 2018-01-10 11:09:55 +01:00
parent 15ef7c04a2
commit 201a232a23
8 changed files with 87 additions and 30 deletions

View file

@ -46,6 +46,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/osThread.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
@ -382,7 +383,7 @@ JVM_handle_linux_signal(int sig,
stub = SharedRuntime::get_handle_wrong_method_stub();
}
else if (sig == SIGSEGV &&
else if (sig == ((SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? SIGTRAP : SIGSEGV) &&
// A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults
// in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6),
// especially when we try to read from the safepoint polling page. So the check
@ -393,7 +394,8 @@ JVM_handle_linux_signal(int sig,
((cb = CodeCache::find_blob(pc)) != NULL) &&
cb->is_compiled()) {
if (TraceTraps) {
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (%s)", p2i(pc),
(SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? "SIGTRAP" : "SIGSEGV");
}
stub = SharedRuntime::get_poll_stub(pc);
}