807 st->print("ESP="); print_location(st, uc->uc_mcontext.gregs[REG_ESP]);
808 st->print("EBP="); print_location(st, uc->uc_mcontext.gregs[REG_EBP]);
809 st->print("ESI="); print_location(st, uc->uc_mcontext.gregs[REG_ESI]);
810 st->print("EDI="); print_location(st, uc->uc_mcontext.gregs[REG_EDI]);
811 #endif // AMD64
812
813 st->cr();
814 }
815
816 void os::setup_fpu() {
817 #ifndef AMD64
818 address fpu_cntrl = StubRoutines::addr_fpu_cntrl_wrd_std();
819 __asm__ volatile ( "fldcw (%0)" :
820 : "r" (fpu_cntrl) : "memory");
821 #endif // !AMD64
822 }
823
824 #ifndef PRODUCT
825 void os::verify_stack_alignment() {
826 #ifdef AMD64
827 assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment");
828 #endif
829 }
830 #endif
831
832
833 /*
834 * IA32 only: execute code at a high address in case buggy NX emulation is present. I.e. avoid CS limit
835 * updates (JDK-8023956).
836 */
837 void os::workaround_expand_exec_shield_cs_limit() {
838 #if defined(IA32)
839 assert(Linux::initial_thread_stack_bottom() != NULL, "sanity");
840 size_t page_size = os::vm_page_size();
841
842 /*
843 * JDK-8197429
844 *
845 * Expand the stack mapping to the end of the initial stack before
846 * attempting to install the codebuf. This is needed because newer
847 * Linux kernels impose a distance of a megabyte between stack
|
807 st->print("ESP="); print_location(st, uc->uc_mcontext.gregs[REG_ESP]);
808 st->print("EBP="); print_location(st, uc->uc_mcontext.gregs[REG_EBP]);
809 st->print("ESI="); print_location(st, uc->uc_mcontext.gregs[REG_ESI]);
810 st->print("EDI="); print_location(st, uc->uc_mcontext.gregs[REG_EDI]);
811 #endif // AMD64
812
813 st->cr();
814 }
815
816 void os::setup_fpu() {
817 #ifndef AMD64
818 address fpu_cntrl = StubRoutines::addr_fpu_cntrl_wrd_std();
819 __asm__ volatile ( "fldcw (%0)" :
820 : "r" (fpu_cntrl) : "memory");
821 #endif // !AMD64
822 }
823
824 #ifndef PRODUCT
825 void os::verify_stack_alignment() {
826 #ifdef AMD64
827 // TODO: TSAN requires being built with Clang, but stack alignment assertion fails with Clang.
828 // assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment");
829 #endif
830 }
831 #endif
832
833
834 /*
835 * IA32 only: execute code at a high address in case buggy NX emulation is present. I.e. avoid CS limit
836 * updates (JDK-8023956).
837 */
838 void os::workaround_expand_exec_shield_cs_limit() {
839 #if defined(IA32)
840 assert(Linux::initial_thread_stack_bottom() != NULL, "sanity");
841 size_t page_size = os::vm_page_size();
842
843 /*
844 * JDK-8197429
845 *
846 * Expand the stack mapping to the end of the initial stack before
847 * attempting to install the codebuf. This is needed because newer
848 * Linux kernels impose a distance of a megabyte between stack
|