[PATCH v4 3/3] RISC-V: Add support for srmcfg CSR from Ssqosid ext
Drew Fustini
fustini at kernel.org
Sat Oct 11 11:35:46 PDT 2025
On Thu, Oct 09, 2025 at 08:47:27AM +0200, Radim Krčmář wrote:
> 2025-10-07T23:21:12-07:00, Drew Fustini <fustini at kernel.org>:
> > diff --git a/arch/riscv/include/asm/qos.h b/arch/riscv/include/asm/qos.h
> > +static inline void __switch_to_srmcfg(struct task_struct *next)
> > +{
> > + u32 *cpu_srmcfg_ptr = this_cpu_ptr(&cpu_srmcfg);
> > + u32 thread_srmcfg;
> > +
> > + thread_srmcfg = READ_ONCE(next->thread.srmcfg);
> > +
> > + if (thread_srmcfg != *cpu_srmcfg_ptr) {
>
> Wouldn't prev->thread.srmcfg have the value of CSR_SRMCFG when executing
> switch_to?
Thanks for reviewing. Yes, you are right that prev->thread.srmcfg should
have same value as CSR_SRMCFG. Are you suggesting that the cpu_srmcfg is
not necessary as prev->thread.srmcfg should have same value?
Drew
More information about the linux-riscv
mailing list