All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Will Deacon <will@kernel.org>
Cc: stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.linux.dev, Ard Biesheuvel <ardb@kernel.org>,
	Lee Jones <lee@kernel.org>, Sasha Levin <sashal@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Fuad Tabba <tabba@google.com>, Marc Zyngier <maz@kernel.org>
Subject: Re: [STABLE] [PATCH] KVM: arm64: Fix kernel BUG() due to bad backport of FPSIMD/SVE/SME fix
Date: Fri, 22 Aug 2025 16:25:14 +0200	[thread overview]
Message-ID: <2025082203-stream-carless-e5d9@gregkh> (raw)
In-Reply-To: <20250822140402.2688-1-will@kernel.org>

On Fri, Aug 22, 2025 at 03:04:02PM +0100, Will Deacon wrote:
> 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 <ardb@kernel.org>
> Cc: Lee Jones <lee@kernel.org>
> Cc: Sasha Levin <sashal@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Fuad Tabba <tabba@google.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: <stable@vger.kernel.org> # 5.15.y, 6.1.y and 6.6.y

Now queued up to these trees, thanks!

greg k-h

  reply	other threads:[~2025-08-22 14:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-22 14:04 [STABLE] [PATCH] KVM: arm64: Fix kernel BUG() due to bad backport of FPSIMD/SVE/SME fix Will Deacon
2025-08-22 14:25 ` Greg Kroah-Hartman [this message]
2025-08-22 14:25 ` Patch "KVM: arm64: Fix kernel BUG() due to bad backport of FPSIMD/SVE/SME fix" has been added to the 5.15-stable tree gregkh
2025-08-22 14:25 ` Patch "KVM: arm64: Fix kernel BUG() due to bad backport of FPSIMD/SVE/SME fix" has been added to the 6.1-stable tree gregkh
2025-08-22 14:25 ` Patch "KVM: arm64: Fix kernel BUG() due to bad backport of FPSIMD/SVE/SME fix" has been added to the 6.6-stable tree gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2025082203-stream-carless-e5d9@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=ardb@kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tabba@google.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.