]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: Save LBT before FPU in setup_sigcontext()
authorHuacai Chen <chenhuacai@loongson.cn>
Wed, 20 Aug 2025 14:23:44 +0000 (22:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Sep 2025 16:56:19 +0000 (18:56 +0200)
commitee58a0a353783b745059dc948809b457aa0823a3
tree68173454a6b09403ad24fd971e379505d3187d4c
parentdc4a024b19906063052fac38b8fe3a5293b090c9
LoongArch: Save LBT before FPU in setup_sigcontext()

[ Upstream commit 112ca94f6c3b3e0b2002a240de43c487a33e0234 ]

Now if preemption happens between protected_save_fpu_context() and
protected_save_lbt_context(), FTOP context is lost. Because FTOP is
saved by protected_save_lbt_context() but protected_save_fpu_context()
disables TM before that. So save LBT before FPU in setup_sigcontext()
to avoid this potential risk.

Signed-off-by: Hanlu Li <lihanlu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/loongarch/kernel/signal.c