Message ID | 20231229143627.22898-7-andy.chiu@sifive.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | riscv: support kernel-mode Vector | expand |
在 2023/12/29 22:36, Andy Chiu 写道: > 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. > Should here add "Link" and "Fixes" tags? > Signed-off-by: Andy Chiu <andy.chiu@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)); > } > Reviewed-by: Song Shuai <songshuaishuai@tinylab.org>
On Fri, Dec 29, 2023 at 10:37 PM Andy Chiu <andy.chiu@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@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@kernel.org>
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)); }
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. Signed-off-by: Andy Chiu <andy.chiu@sifive.com> --- arch/riscv/include/asm/switch_to.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)