From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 528DECA0EFA for ; Sat, 23 Aug 2025 06:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:From:Cc:To:Subject: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:References:List-Owner; bh=lvx5rLk3Fr7gevF0oMQ8jwU+6OqHCPvxxaNin/cMSvw=; b=cLSHUWZjczapxdtpxBLvOBn34q LPIdKz6Fwav5mntbTGAGfZElmRcKYppiYHQb98PYrqt9bijhBLuQwbQd8Uf3f4db08rIoJDCtPC13 9Fqrrmb+6Qd2Ju9jFaII1Z5KVtI7SGSzfvcV+9PY1y+hFbgPxd9CtkMxif2j3kETDiy+EzVMvDr35 6XZInO7PyJ1m41Uo5ZR6SbnGPXvNDz+6y/Le6q5AQNjtX0A4SjrxpxV0DPA0+CG5D1CP3WYMUkTrm YNr8Scr2xuG+Ar3m0M+T978fg8Ve6XD9m5XTqNuXHdY5XTvUwQ76lwt6i4x5/lkjslLxNCDtCRYXE MEO7sXGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uphn2-000000040rN-0Tk4; Sat, 23 Aug 2025 06:31:48 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1upSiJ-00000002p11-0483 for linux-arm-kernel@lists.infradead.org; Fri, 22 Aug 2025 14:25:56 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 5252BA583B1; Fri, 22 Aug 2025 14:25:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72747C4CEED; Fri, 22 Aug 2025 14:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755872754; bh=76Gtx921lfkYOv/RLmr58xDncs7LI7vNa6RkrmqUAU0=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=t3UV70MM2rvMkNEQtuhMOh1GMQq5uD3TY8m+B+7jjX7jM6spSefLPztxfvA3kAHV5 xkeMP5+wNJxo7I1TSnAdvxVL5xKZTS59HC4oPEAz72aYPP5wVPG9BR3I+ACIvcAq23 oPsMsQxcgCnrizwyRy/dPLSOtn9OsasEs6YG31Ik= Subject: Patch "KVM: arm64: Fix kernel BUG() due to bad backport of FPSIMD/SVE/SME fix" has been added to the 6.6-stable tree To: ardb@kernel.org,gregkh@linuxfoundation.org,kvmarm@lists.linux.dev,lee@kernel.org,linux-arm-kernel@lists.infradead.org,mark.rutland@arm.com,maz@kernel.org,sashal@kernel.org,tabba@google.com,will@kernel.org Cc: From: Date: Fri, 22 Aug 2025 16:25:51 +0200 In-Reply-To: <20250822140402.2688-1-will@kernel.org> Message-ID: <2025082250-occultist-shingle-27f9@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit X-stable: commit X-Patchwork-Hint: ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250822_072555_195580_CE20AE6B X-CRM114-Status: GOOD ( 17.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a note to let you know that I've just added the patch titled KVM: arm64: Fix kernel BUG() due to bad backport of FPSIMD/SVE/SME fix to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kvm-arm64-fix-kernel-bug-due-to-bad-backport-of-fpsimd-sve-sme-fix.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From will@kernel.org Fri Aug 22 16:24:21 2025 From: Will Deacon Date: Fri, 22 Aug 2025 15:04:02 +0100 Subject: KVM: arm64: Fix kernel BUG() due to bad backport of FPSIMD/SVE/SME fix To: stable@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Will Deacon , Ard Biesheuvel , Lee Jones , Sasha Levin , Greg Kroah-Hartman , Mark Rutland , Fuad Tabba , Marc Zyngier Message-ID: <20250822140402.2688-1-will@kernel.org> From: Will Deacon Upstream commit fbc7e61195e2 ("KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state") relies on interrupts being disabled during fpsimd_save_and_flush_cpu_state() so that a softirq cannot be taken while the host floating point context is being saved and potentially try to use kernel-mode NEON. Unfortunately, stable kernels without 9b19700e623f ("arm64: fpsimd: Drop unneeded 'busy' flag") leave interrupts enabled in fpsimd_save_and_flush_cpu_state() and so the BUG_ON(!may_use_simd()) in kernel_neon_begin() has been observed to trigger in real-world usage: | kernel BUG at arch/arm64/kernel/fpsimd.c:1904! | Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP | | Call trace: | kernel_neon_begin+0xdc/0x12c | ... | crypto_aead_decrypt+0x5c/0x6c | seqiv_aead_decrypt+0x88/0x9c | crypto_aead_decrypt+0x5c/0x6c | esp_input+0x280/0x364 | xfrm_input+0x6ac/0x16f8 | ... | net_rx_action+0x13c/0x31c | handle_softirqs+0x124/0x3d0 | __do_softirq+0x14/0x20 | ____do_softirq+0x10/0x20 | call_on_irq_stack+0x3c/0x74 | do_softirq_own_stack+0x1c/0x2c | __irq_exit_rcu+0x54/0xb4 | irq_exit_rcu+0x10/0x1c | el1_interrupt+0x38/0x58 | el1h_64_irq_handler+0x18/0x24 | el1h_64_irq+0x68/0x6c | fpsimd_save+0xe4/0x130 | kvm_arch_vcpu_load_fp+0x2c/0x58 | kvm_arch_vcpu_load+0x88/0x26c | kvm_sched_in+0x2c/0x3c Given that 9b19700e623f ("arm64: fpsimd: Drop unneeded 'busy' flag") is not a fix in its own right, has non-trivial dependencies and is a reasonably invasive change to the in-kernel use of fpsimd, opt instead for a simple fix to use the softirq-safe {get,put}_cpu_fpsimd_context() helpers in fpsimd_save_and_flush_cpu_state(). Cc: Ard Biesheuvel Cc: Lee Jones Cc: Sasha Levin Cc: Mark Rutland Cc: Fuad Tabba Cc: Marc Zyngier Cc: # 5.15.y, 6.1.y and 6.6.y Fixes: 806d5c1e1d2e ("KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state") # 6.6.y Fixes: 04c50cc23a49 ("KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state") # 6.1.y Fixes: 5289ac43b69c ("KVM: arm64: Unconditionally save+flush host FPSIMD/SVE/SME state") # 5.15.y Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/fpsimd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1876,10 +1876,10 @@ void fpsimd_save_and_flush_cpu_state(voi if (!system_supports_fpsimd()) return; WARN_ON(preemptible()); - __get_cpu_fpsimd_context(); + get_cpu_fpsimd_context(); fpsimd_save(); fpsimd_flush_cpu_state(); - __put_cpu_fpsimd_context(); + put_cpu_fpsimd_context(); } #ifdef CONFIG_KERNEL_MODE_NEON Patches currently in stable-queue which might be from will@kernel.org are queue-6.6/vsock-virtio-resize-receive-buffers-so-that-each-skb.patch queue-6.6/kvm-arm64-fix-kernel-bug-due-to-bad-backport-of-fpsimd-sve-sme-fix.patch queue-6.6/arm64-mark-kernel-as-tainted-on-sae-and-serror-panic.patch queue-6.6/vsock-virtio-validate-length-in-packet-header-before-skb_put.patch queue-6.6/perf-cxlpmu-remove-unintended-newline-from-irq-name-.patch queue-6.6/iommu-arm-smmu-qcom-add-sm6115-mdss-compatible.patch queue-6.6/arm64-amu-use-capacity_ref_freq-to-set-amu-ratio.patch queue-6.6/mm-ptdump-take-the-memory-hotplug-lock-inside-ptdump_walk_pgd.patch queue-6.6/vhost-vsock-avoid-allocating-arbitrarily-sized-skbs.patch