mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
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>
This commit is contained in:
parent
d6c78f1ca3
commit
5b6048f2ff
@ -122,7 +122,8 @@ static inline void riscv_v_ctrl_set(struct task_struct *tsk, int cur, int nxt,
|
||||
ctrl |= VSTATE_CTRL_MAKE_NEXT(nxt);
|
||||
if (inherit)
|
||||
ctrl |= PR_RISCV_V_VSTATE_CTRL_INHERIT;
|
||||
tsk->thread.vstate_ctrl = ctrl;
|
||||
tsk->thread.vstate_ctrl &= ~PR_RISCV_V_VSTATE_CTRL_MASK;
|
||||
tsk->thread.vstate_ctrl |= ctrl;
|
||||
}
|
||||
|
||||
bool riscv_v_vstate_ctrl_user_allowed(void)
|
||||
|
Loading…
Reference in New Issue
Block a user