From 227ed17a1b03aa9d27d7b6bd59dd9ce316a8ce2e Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 29 Mar 2026 18:50:06 +0300 Subject: [PATCH] linuxPackages.amneziawg: 1.0.20260322 -> 1.0.20260329-2 Now with upstreamed (and arguably cleaner) NEON fix, and another crash fix. --- pkgs/os-specific/linux/amneziawg/default.nix | 10 +-- .../linux/amneziawg/neon-619.patch | 74 ------------------- 2 files changed, 2 insertions(+), 82 deletions(-) delete mode 100644 pkgs/os-specific/linux/amneziawg/neon-619.patch diff --git a/pkgs/os-specific/linux/amneziawg/default.nix b/pkgs/os-specific/linux/amneziawg/default.nix index b3fb2bb4a566..e291e91d77d5 100644 --- a/pkgs/os-specific/linux/amneziawg/default.nix +++ b/pkgs/os-specific/linux/amneziawg/default.nix @@ -9,21 +9,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "amneziawg"; - version = "1.0.20260322"; + version = "1.0.20260329-2"; src = fetchFromGitHub { owner = "amnezia-vpn"; repo = "amneziawg-linux-kernel-module"; tag = "v${finalAttrs.version}"; - hash = "sha256-Y6TETOo5oAr3ZtqsJX909zm38rXq+1fAXiRFSt+g2Gw="; + hash = "sha256-BlWnncTzVKDpCVvtLp8L+bABs81YH/Ce+9JGCoCm1LI="; }; - patches = [ - # fix aarch64-linux builds with NEON - # upstream PR: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/159 - ./neon-619.patch - ]; - sourceRoot = "${finalAttrs.src.name}/src"; hardeningDisable = [ "pic" ]; nativeBuildInputs = kernel.moduleBuildDependencies; diff --git a/pkgs/os-specific/linux/amneziawg/neon-619.patch b/pkgs/os-specific/linux/amneziawg/neon-619.patch deleted file mode 100644 index 7daac1ecd873..000000000000 --- a/pkgs/os-specific/linux/amneziawg/neon-619.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- a/compat/simd/include/linux/simd.h -+++ b/compat/simd/include/linux/simd.h -@@ -18,31 +18,42 @@ typedef enum { - HAVE_NO_SIMD = 1 << 0, - HAVE_FULL_SIMD = 1 << 1, - HAVE_SIMD_IN_USE = 1 << 31 -+} simd_state_t; -+ -+typedef struct { -+ simd_state_t state; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0) && defined(CONFIG_KERNEL_MODE_NEON) -+ struct user_fpsimd_state kstate; -+#endif - } simd_context_t; - - #define DONT_USE_SIMD ((simd_context_t []){ HAVE_NO_SIMD }) - - static inline void simd_get(simd_context_t *ctx) - { -- *ctx = !IS_ENABLED(CONFIG_PREEMPT_RT) && !IS_ENABLED(CONFIG_PREEMPT_RT_BASE) && may_use_simd() ? HAVE_FULL_SIMD : HAVE_NO_SIMD; -+ ctx->state = !IS_ENABLED(CONFIG_PREEMPT_RT) && !IS_ENABLED(CONFIG_PREEMPT_RT_BASE) && may_use_simd() ? HAVE_FULL_SIMD : HAVE_NO_SIMD; - } - - static inline void simd_put(simd_context_t *ctx) - { - #if defined(CONFIG_X86_64) -- if (*ctx & HAVE_SIMD_IN_USE) -+ if (ctx->state & HAVE_SIMD_IN_USE) - kernel_fpu_end(); - #elif defined(CONFIG_KERNEL_MODE_NEON) -- if (*ctx & HAVE_SIMD_IN_USE) -+ if (ctx->state & HAVE_SIMD_IN_USE) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0) -+ kernel_neon_end(&ctx->kstate); -+#else - kernel_neon_end(); - #endif -- *ctx = HAVE_NO_SIMD; -+#endif -+ ctx->state = HAVE_NO_SIMD; - } - - static inline bool simd_relax(simd_context_t *ctx) - { - #ifdef CONFIG_PREEMPT -- if ((*ctx & HAVE_SIMD_IN_USE) && need_resched()) { -+ if ((ctx->state & HAVE_SIMD_IN_USE) && need_resched()) { - simd_put(ctx); - simd_get(ctx); - return true; -@@ -53,16 +64,20 @@ static inline bool simd_relax(simd_context_t *ctx) - - static __must_check inline bool simd_use(simd_context_t *ctx) - { -- if (!(*ctx & HAVE_FULL_SIMD)) -+ if (!(ctx->state & HAVE_FULL_SIMD)) - return false; -- if (*ctx & HAVE_SIMD_IN_USE) -+ if (ctx->state & HAVE_SIMD_IN_USE) - return true; - #if defined(CONFIG_X86_64) - kernel_fpu_begin(); - #elif defined(CONFIG_KERNEL_MODE_NEON) -+#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 19, 0) -+ kernel_neon_begin(&ctx->kstate); -+#else - kernel_neon_begin(); - #endif -- *ctx |= HAVE_SIMD_IN_USE; -+#endif -+ ctx->state |= HAVE_SIMD_IN_USE; - return true; - } -