441 // garbage from this read is ok.
442 thread->set_pending_unsafe_access_error();
443 uc->uc_mcontext.psw.addr = ((unsigned long)pc) + Assembler::instr_len(pc);
444 return true;
445 }
446 }
447 }
448
449 else { // thread->thread_state() != _thread_in_Java
450 if ((sig == SIGILL) && VM_Version::is_determine_features_test_running()) {
451 // SIGILL must be caused by VM_Version::determine_features()
452 // when attempting to execute a non-existing instruction.
453 //*(int *) (pc-6)=0; // Patch instruction to 0 to indicate that it causes a SIGILL.
454 // Flushing of icache is not necessary.
455 stub = pc; // Continue with next instruction.
456 } else if ((sig == SIGFPE) && VM_Version::is_determine_features_test_running()) {
457 // SIGFPE is known to be caused by trying to execute a vector instruction
458 // when the vector facility is installed, but operating system support is missing.
459 VM_Version::reset_has_VectorFacility();
460 stub = pc; // Continue with next instruction.
461 } else if (thread->thread_state() == _thread_in_vm &&
462 sig == SIGBUS && thread->doing_unsafe_access()) {
463 // We don't really need a stub here! Just set the pending exeption and
464 // continue at the next instruction after the faulting read. Returning
465 // garbage from this read is ok.
466 thread->set_pending_unsafe_access_error();
467 os::Linux::ucontext_set_pc(uc, pc + Assembler::instr_len(pc));
468 return true;
469 }
470 }
471
472 // Check to see if we caught the safepoint code in the
473 // process of write protecting the memory serialization page.
474 // It write enables the page immediately after protecting it
475 // so we can just return to retry the write.
476 // Info->si_addr need not be the exact address, it is only
477 // guaranteed to be on the same page as the address that caused
478 // the SIGSEGV.
479 if ((sig == SIGSEGV) && !UseMembar &&
480 (os::get_memory_serialize_page() ==
481 (address)((uintptr_t)info->si_addr & ~(os::vm_page_size()-1)))) {
482 return true;
|
441 // garbage from this read is ok.
442 thread->set_pending_unsafe_access_error();
443 uc->uc_mcontext.psw.addr = ((unsigned long)pc) + Assembler::instr_len(pc);
444 return true;
445 }
446 }
447 }
448
449 else { // thread->thread_state() != _thread_in_Java
450 if ((sig == SIGILL) && VM_Version::is_determine_features_test_running()) {
451 // SIGILL must be caused by VM_Version::determine_features()
452 // when attempting to execute a non-existing instruction.
453 //*(int *) (pc-6)=0; // Patch instruction to 0 to indicate that it causes a SIGILL.
454 // Flushing of icache is not necessary.
455 stub = pc; // Continue with next instruction.
456 } else if ((sig == SIGFPE) && VM_Version::is_determine_features_test_running()) {
457 // SIGFPE is known to be caused by trying to execute a vector instruction
458 // when the vector facility is installed, but operating system support is missing.
459 VM_Version::reset_has_VectorFacility();
460 stub = pc; // Continue with next instruction.
461 } else if (sig == SIGBUS && thread->doing_unsafe_access()) {
462 // We don't really need a stub here! Just set the pending exeption and
463 // continue at the next instruction after the faulting read. Returning
464 // garbage from this read is ok.
465 thread->set_pending_unsafe_access_error();
466 os::Linux::ucontext_set_pc(uc, pc + Assembler::instr_len(pc));
467 return true;
468 }
469 }
470
471 // Check to see if we caught the safepoint code in the
472 // process of write protecting the memory serialization page.
473 // It write enables the page immediately after protecting it
474 // so we can just return to retry the write.
475 // Info->si_addr need not be the exact address, it is only
476 // guaranteed to be on the same page as the address that caused
477 // the SIGSEGV.
478 if ((sig == SIGSEGV) && !UseMembar &&
479 (os::get_memory_serialize_page() ==
480 (address)((uintptr_t)info->si_addr & ~(os::vm_page_size()-1)))) {
481 return true;
|