riscv: vector: use a mask to write vstate_ctrl
authorAndy Chiu <andy.chiu@sifive.com>
Mon, 15 Jan 2024 05:59:27 +0000 (05:59 +0000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 16 Jan 2024 15:14:00 +0000 (07:14 -0800)
commit5b6048f2ff710196c85ce14373febe8be5115bbe
tree5f618b35a76dd50561a6bec9f82c548ba0f344c5
parentd6c78f1ca3e8ec3fd1afa1bc567cdf083e7af9fe
riscv: vector: use a mask to write vstate_ctrl

riscv_v_ctrl_set() should only touch bits within
PR_RISCV_V_VSTATE_CTRL_MASK. So, use the mask when we really set task's
vstate_ctrl.

Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Tested-by: Björn Töpel <bjorn@rivosinc.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20240115055929.4736-9-andy.chiu@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/vector.c