This patch optimizing chacha20 for WireGuard https://github.com/shawnl/WireGuard/commit/3e02fce92a14cba7b7d1e2733def3a51bec97498 doesn't work because may_use_simd() is always returning false in kworkers. If I remove the check everything seems to work fine.
▒ - 11.41% 0.01% kworker/1:2-mm_ [kernel.vmlinux] [k] process_one_work ▒ - 11.41% process_one_work ▒ - 10.28% wg_packet_tx_worker ▒ - 10.06% wg_socket_send_skb_to_peer ▒ - 7.38% _raw_read_unlock_bh ▒ - 7.35% __local_bh_enable_ip ▒ - 7.34% do_softirq.part.2 ▒ - 7.31% do_softirq_own_stack ▒ + 7.28% call_do_softirq ▒ - 2.45% send4 ▒ - 1.85% udp_tunnel_xmit_skb ▒ - 1.66% iptunnel_xmit ▒ - 1.33% ip_local_out ▒ - 1.14% ip_output ▒ - 1.06% ip_finish_output2 ▒ + 0.99% __dev_queue_xmit ▒ - 1.06% wg_packet_encrypt_worker ▒ - 1.03% encrypt_packet ▒ - 0.98% chacha20poly1305_encrypt_sg ▒ 0.59% chacha20
X86 manages to allow SIMD in interrupts through some very careful code in arch/x86/kernel/fpu/core.c (starting with irq_fpu_usable()) PowerPC can do the same.