diff --git a/arch/riscv/include/asm/switch_to.h b/arch/riscv/include/asm/switch_to.h index 733559083f24bf..5d440df6a908b2 100644 --- a/arch/riscv/include/asm/switch_to.h +++ b/arch/riscv/include/asm/switch_to.h @@ -30,7 +30,12 @@ static inline void __fstate_clean(struct pt_regs *regs) static inline void fstate_save(struct task_struct *task, struct pt_regs *regs) { + // JRRK: Hack around buggy support for SR_FS and/or SR_SD +#if 0 if ((regs->sstatus & SR_FS) == SR_FS_DIRTY) { +#else + if ((regs->sstatus & SR_FS) != SR_FS_OFF) { +#endif __fstate_save(task); __fstate_clean(regs); } @@ -51,7 +56,10 @@ static inline void __switch_to_aux(struct task_struct *prev, struct pt_regs *regs; regs = task_pt_regs(prev); + // JRRK: Hack around buggy support for SR_FS and/or SR_SD +#if 0 if (unlikely(regs->sstatus & SR_SD)) +#endif fstate_save(prev, regs); fstate_restore(next, task_pt_regs(next)); }