[PATCH v4 3/3] RISC-V: Add support for srmcfg CSR from Ssqosid ext
Radim Krčmář
rkrcmar at ventanamicro.com
Mon Oct 13 02:06:50 PDT 2025
2025-10-11T11:35:46-07:00, Drew Fustini <fustini at kernel.org>:
> 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?
Yes, it would be more consistent with other context switched state.
I just wasn't sure if srmcfg doesn't have special race conditions.
Thanks.
More information about the linux-riscv
mailing list