head 1.3; access; symbols pkgsrc-2026Q1:1.3.0.6 pkgsrc-2026Q1-base:1.3 pkgsrc-2025Q4:1.3.0.4 pkgsrc-2025Q4-base:1.3 pkgsrc-2025Q3:1.3.0.2 pkgsrc-2025Q3-base:1.3 pkgsrc-2021Q4:1.1.0.18 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.16 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.14 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.12 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.10 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.8 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.6 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.2 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.4 pkgsrc-2019Q4-base:1.1; locks; strict; comment @// @; 1.3 date 2025.08.04.13.22.06; author pho; state Exp; branches; next 1.2; commitid hLvjvkVJi5XjNp5G; 1.2 date 2022.03.01.13.51.44; author ryoon; state dead; branches; next 1.1; commitid Zmhhbo9ovISzcwuD; 1.1 date 2019.12.04.12.19.25; author tnn; state Exp; branches; next ; commitid zrZWNNptJy3UYnNB; desc @@ 1.3 log @lang/openjdk11: Workaround for the VM dying on Apple Silicon chips See the patch for threadWXSetters.inline.hpp for details. I rebuilt the bootkit for aarch64 with new patches applied. This may cause some performance regression on Cortex series, but as I stated in the patch comment, relying on assumptions made on implementation details of chips is fundamentally unsound, and that's why it didn't work on Apple Silicon in the first place. Also backported fixes regarding floating point arithmetics that appeared in OpenJDK 22. @ text @$NetBSD$ Workaround for the Hotspot VM dying on Apple Silicon chips. See the patch to threadWXSetters.inline.hpp for details. --- src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp.orig 2025-08-01 08:01:30.302760008 +0000 +++ src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp @@@@ -1053,6 +1053,7 @@@@ JVM_handle_bsd_signal(int sig, // check if fault address is within thread stack if (thread->on_local_stack(addr)) { + AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread)); // stack overflow if (thread->in_stack_yellow_reserved_zone(addr)) { if (thread->thread_state() == _thread_in_Java) { @@@@ -1100,6 +1101,7 @@@@ JVM_handle_bsd_signal(int sig, if (thread->thread_state() == _thread_in_Java) { // Java thread running in Java code => find exception handler if any // a fault inside compiled code, the interpreter, or a stub + AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread)); // Handle signal from NativeJump::patch_verified_entry(). if ((sig == SIGILL || sig == SIGTRAP) @ 1.2 log @openjdk11: Update to 1.11.0.14.9 * Some NetBSD-specific patches are merged by upstream. Changelog: Updated BSD port of JDK 11 Additional features include: Update to 11.0.14 GA More fixes for LLVM/Clang 13 OpenBSD fixes Improved NetBSD support @ text @d1 1 a1 1 $NetBSD: patch-src_hotspot_os__cpu_bsd__aarch64_os__bsd__aarch64.cpp,v 1.1 2019/12/04 12:19:25 tnn Exp $ d3 2 a4 1 NetBSD/evbarm-aarch64 support d6 1 a6 1 --- src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp.orig 2019-10-16 18:31:09.000000000 +0000 d8 1 a8 8 @@@@ -103,6 +103,8 @@@@ address os::Bsd::ucontext_get_pc(const u return (address)uc->uc_mcontext.mc_gpregs.gp_elr; #elif defined(__OpenBSD__) return (address)uc->sc_elr; +#elif defined(__NetBSD__) + return (address)uc->uc_mcontext.__gregs[_REG_ELR]; #endif } d10 11 a20 8 @@@@ -111,6 +113,8 @@@@ void os::Bsd::ucontext_set_pc(ucontext_t uc->uc_mcontext.mc_gpregs.gp_elr = (intptr_t)pc; #elif defined(__OpenBSD__) uc->sc_elr = (unsigned long)pc; +#elif defined(__NetBSD__) + uc->uc_mcontext.__gregs[_REG_ELR] = (__greg_t)pc; #endif } d22 2 a23 46 @@@@ -119,6 +123,8 @@@@ intptr_t* os::Bsd::ucontext_get_sp(const return (intptr_t*)uc->uc_mcontext.mc_gpregs.gp_sp; #elif defined(__OpenBSD__) return (intptr_t*)uc->sc_sp; +#elif defined(__NetBSD__) + return (intptr_t*)uc->uc_mcontext.__gregs[_REG_SP]; #endif } @@@@ -127,6 +133,8 @@@@ intptr_t* os::Bsd::ucontext_get_fp(const return (intptr_t*)uc->uc_mcontext.mc_gpregs.gp_x[REG_FP]; #elif defined(__OpenBSD__) return (intptr_t*)uc->sc_x[REG_FP]; +#elif defined(__NetBSD__) + return (intptr_t*)uc->uc_mcontext.__gregs[_REG_FP]; #endif } @@@@ -204,6 +212,9 @@@@ bool os::Bsd::get_frame_at_stack_banging #elif defined(__OpenBSD__) address pc = (address)(uc->sc_lr - NativeInstruction::instruction_size); +#elif defined(__NetBSD__) + address pc = (address)(uc->uc_mcontext.__gregs[_REG_LR] + - NativeInstruction::instruction_size); #endif *fr = frame(sp, fp, pc); if (!fr->is_java_frame()) { @@@@ -552,6 +563,8 @@@@ void os::print_context(outputStream *st, print_location(st, uc->uc_mcontext.mc_gpregs.gp_x[r]); #elif defined(__OpenBSD__) print_location(st, uc->sc_x[r]); +#elif defined(__NetBSD__) + print_location(st, uc->uc_mcontext.__gregs[r]); #endif } st->cr(); @@@@ -588,6 +601,8 @@@@ void os::print_register_info(outputStrea st->print_cr( "R%d=" INTPTR_FORMAT, r, (uintptr_t)uc->uc_mcontext.mc_gpregs.gp_x[r]); #elif defined(__OpenBSD__) st->print_cr( "R%d=" INTPTR_FORMAT, r, (uintptr_t)uc->sc_x[r]); +#elif defined(__NetBSD__) + st->print_cr( "R%d=" INTPTR_FORMAT, r, (uintptr_t)uc->uc_mcontext.__gregs[r]); #endif st->cr(); } @ 1.1 log @openjdk11: NetBSD/evbarm-aarch64 compile fixes (doesn't quite run yet) @ text @d1 1 a1 1 $NetBSD$ @