x86/intel_rdt: Fix initial allocation to consider CDP
authorReinette Chatre <reinette.chatre@intel.com>
Wed, 3 Oct 2018 22:17:03 +0000 (15:17 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 9 Oct 2018 06:50:47 +0000 (08:50 +0200)
commit2a7adf6ce643fdeec051dc88e5250b08c83bbb67
treeaa9e0ce655d985fd698a0b1fafc83f2e67111d29
parente5f3530c391105fdd6174852e3ea6136d073b45a
x86/intel_rdt: Fix initial allocation to consider CDP

When a new resource group is created it is initialized with a default
allocation that considers which portions of cache are currently
available for sharing across all resource groups or which portions of
cache are currently unused.

If a CDP allocation forms part of a resource group that is in exclusive
mode then it should be ensured that no new allocation overlaps with any
resource that shares the underlying hardware. The current initial
allocation does not take this sharing of hardware into account and
a new allocation in a resource that shares the same
hardware would affect the exclusive resource group.

Fix this by considering the allocation of a peer RDT domain - a RDT
domain sharing the same hardware - as part of the test to determine
which portion of cache is in use and available for use.

Fixes: 95f0b77efa57 ("x86/intel_rdt: Initialize new resource group with sane defaults")
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Cc: tony.luck@intel.com
Cc: jithu.joseph@intel.com
Cc: gavin.hindman@intel.com
Cc: dave.hansen@intel.com
Cc: hpa@zytor.com
Link: https://lkml.kernel.org/r/b1f7ec08b1695be067de416a4128466d49684317.1538603665.git.reinette.chatre@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c