]> git.baikalelectronics.ru Git - kernel.git/commit
x86/resctrl: Apply READ_ONCE/WRITE_ONCE to task_struct.{rmid,closid}
authorValentin Schneider <valentin.schneider@arm.com>
Thu, 17 Dec 2020 22:31:21 +0000 (14:31 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:16 +0000 (16:44 +0100)
commitb4180d02ca0e69fa1566f4f235628c8b3dabed06
tree08cfc3763e3a013159748ad4a431a3d0d91e8438
parent597c866c4cf28df485d22936c98ae8c5f8b4a194
x86/resctrl: Apply READ_ONCE/WRITE_ONCE to task_struct.{rmid,closid}

commit cc8279d2dbd9e67ed43306f9ac734bc68a91d94c upstream.

A CPU's current task can have its {closid, rmid} fields read locally
while they are being concurrently written to from another CPU.
This can happen anytime __resctrl_sched_in() races with either
__rdtgroup_move_task() or rdt_move_group_tasks().

Prevent load / store tearing for those accesses by giving them the
READ_ONCE() / WRITE_ONCE() treatment.

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/9921fda88ad81afb9885b517fbe864a2bc7c35a9.1608243147.git.reinette.chatre@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/resctrl_sched.h
arch/x86/kernel/cpu/resctrl/rdtgroup.c