MIPS: add missing MSACSR and upper MSA initialization
authorHuang Pei <huangpei@loongson.cn>
Tue, 1 Sep 2020 06:53:09 +0000 (14:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:14:22 +0000 (19:14 +0200)
commitb5c901d96a596a20fe97d85690acf23e85d6b857
tree0850a5e4807ec13465e373b7dbebbffc819bd234
parent6aef739073384ea855cf694f3c5d43a5a8872141
MIPS: add missing MSACSR and upper MSA initialization

[ Upstream commit bb06748207cfb1502d11b90325eba7f8c44c9f02 ]

In cc97ab235f3f ("MIPS: Simplify FP context initialization), init_fp_ctx
just initialize the fp/msa context, and own_fp_inatomic just restore
FCSR and 64bit FP regs from it, but miss MSACSR and upper MSA regs for
MSA, so MSACSR and MSA upper regs's value from previous task on current
cpu can leak into current task and cause unpredictable behavior when MSA
context not initialized.

Fixes: cc97ab235f3f ("MIPS: Simplify FP context initialization")
Signed-off-by: Huang Pei <huangpei@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/kernel/traps.c