x86/resctrl: Do not repeat rdtgroup mode initialization
authorXiaochen Shen <xiaochen.shen@intel.com>
Tue, 9 Apr 2019 19:53:49 +0000 (03:53 +0800)
committerBorislav Petkov <bp@suse.de>
Sun, 14 Apr 2019 16:23:13 +0000 (18:23 +0200)
commit40fba00ffa431c8597ca785ea1cfa4d9f6503390
tree8a578610587b37a5a6983ce0c1a2feda84fb7361
parent5b77e95dd7790ff6c8fbf1cd8d0104ebed818a03
x86/resctrl: Do not repeat rdtgroup mode initialization

When cache allocation is supported and the user creates a new resctrl
resource group, the allocations of the new resource group are
initialized to all regions that it can possibly use. At this time these
regions are all that are shareable by other resource groups as well as
regions that are not currently used. The new resource group's mode is
also initialized to reflect this initialization and set to "shareable".

The new resource group's mode is currently repeatedly initialized within
the loop that configures the hardware with the resource group's default
allocations.

Move the initialization of the resource group's mode outside the
hardware configuration loop. The resource group's mode is now
initialized only once as the final step to reflect that its configured
allocations are "shareable".

Fixes: 95f0b77efa57 ("x86/intel_rdt: Initialize new resource group with sane defaults")
Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: pei.p.jia@intel.com
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/1554839629-5448-1-git-send-email-xiaochen.shen@intel.com
arch/x86/kernel/cpu/resctrl/rdtgroup.c