[v9, 06/10] riscv: fpu: drop SR_SD bit checking

Guo Ren guoren at kernel.org
Thu Jan 4 04:34:26 PST 2024


On Fri, Dec 29, 2023 at 10:37 PM Andy Chiu <andy.chiu at sifive.com> wrote:
>
> SR_SD summarizes the dirty status of FS/VS/XS. However, the current code
> structure does not fully utilize it because each extension specific code
> is divided into an individual segment. So remove the SR_SD check for
> now.
It seems SR_SD is useless in the specs because of its duplicate. FS/VS
contexts are separate.

>
> Signed-off-by: Andy Chiu <andy.chiu at sifive.com>
> ---
>  arch/riscv/include/asm/switch_to.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/riscv/include/asm/switch_to.h b/arch/riscv/include/asm/switch_to.h
> index f90d8e42f3c7..7efdb0584d47 100644
> --- a/arch/riscv/include/asm/switch_to.h
> +++ b/arch/riscv/include/asm/switch_to.h
> @@ -53,8 +53,7 @@ static inline void __switch_to_fpu(struct task_struct *prev,
>         struct pt_regs *regs;
>
>         regs = task_pt_regs(prev);
> -       if (unlikely(regs->status & SR_SD))
> -               fstate_save(prev, regs);
> +       fstate_save(prev, regs);
>         fstate_restore(next, task_pt_regs(next));
>  }
>
> --
> 2.17.1
>
Reviewed-by: Guo Ren <guoren at kernel.org>

-- 
Best Regards
 Guo Ren



More information about the linux-riscv mailing list