linux/arch/x86/kernel/cpu
Fenghua Yu a0195f314a x86/resctrl: Don't move a task to the same resource group
Shakeel Butt reported in [1] that a user can request a task to be moved
to a resource group even if the task is already in the group. It just
wastes time to do the move operation which could be costly to send IPI
to a different CPU.

Add a sanity check to ensure that the move operation only happens when
the task is not already in the resource group.

[1] https://lore.kernel.org/lkml/CALvZod7E9zzHwenzf7objzGKsdBmVwTgEJ0nPgs0LUFU3SN5Pw@mail.gmail.com/

Fixes: e02737d5b8 ("x86/intel_rdt: Add tasks files")
Reported-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/962ede65d8e95be793cb61102cca37f7bb018e66.1608243147.git.reinette.chatre@intel.com
2021-01-08 09:08:03 +01:00
..
mce A set of updates for entry/exit handling: 2020-12-14 17:13:53 -08:00
microcode - A single cleanup removing "break" after a return statement (Tom Rix) 2020-12-14 13:13:15 -08:00
mtrr x86/mtrr: Correct the range check before performing MTRR type lookups 2021-01-06 13:01:13 +01:00
resctrl x86/resctrl: Don't move a task to the same resource group 2021-01-08 09:08:03 +01:00
sgx x86/sgx: Return -EINVAL on a zero length buffer in sgx_ioc_enclave_add_pages() 2020-12-03 19:54:40 +01:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
acrn.c x86/acrn: Remove redundant chars from ACRN signature 2020-08-07 01:32:00 +02:00
amd.c x86/cpu/amd: Remove dead code for TSEG region remapping 2020-12-08 18:45:21 +01:00
aperfmperf.c x86/cpu: Avoid cpuinfo-induced IPIing of idle CPUs 2020-11-06 16:59:11 -08:00
bugs.c x86/speculation: Fix prctl() when spectre_v2_user={seccomp,prctl},ibpb 2020-11-25 20:17:09 +01:00
cacheinfo.c x86/CPU/AMD: Remove amd_get_nb_id() 2020-11-19 11:43:17 +01:00
centaur.c x86/cpu/centaur: Add Centaur family >=7 CPUs initialization support 2020-09-11 10:53:19 +02:00
common.c This feature enhances the current guest memory encryption support 2020-10-14 10:21:34 -07:00
cpu.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
cpuid-deps.c x86: Enumerate AVX512 FP16 CPUID feature flag 2020-12-11 19:00:58 -05:00
cyrix.c x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors 2019-03-21 12:28:50 +01:00
feat_ctl.c x86/cpu/intel: Add a nosgx kernel parameter 2020-11-17 14:36:13 +01:00
hygon.c x86/cpu/amd: Remove dead code for TSEG region remapping 2020-12-08 18:45:21 +01:00
hypervisor.c x86/paravirt: Remove const mark from x86_hyper_xen_hvm variable 2019-07-17 08:09:59 +02:00
intel_epb.c x86: intel_epb: Do not build when CONFIG_PM is unset 2019-05-30 10:58:36 +02:00
intel_pconfig.c x86/pconfig: Detect PCONFIG targets 2018-03-12 12:10:54 +01:00
intel.c A set of locking fixes and updates: 2020-08-10 19:07:44 -07:00
Makefile x86/sgx: Initialize metadata for Enclave Page Cache (EPC) sections 2020-11-17 14:36:13 +01:00
match.c x86/cpu: Add a steppings field to struct x86_cpu_id 2020-04-20 12:19:21 +02:00
mkcapflags.sh x86/cpu: Print VMX flags in /proc/cpuinfo using VMX_FEATURES_* 2020-01-13 18:36:02 +01:00
mshyperv.c x86/hyperv: Enable 15-bit APIC ID if the hypervisor supports it 2020-11-04 11:10:52 +01:00
perfctr-watchdog.c x86/perf: Add hardware performance events support for Zhaoxin CPU. 2020-04-30 20:14:35 +02:00
powerflags.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc.c x86/cpu: Print VMX flags in /proc/cpuinfo using VMX_FEATURES_* 2020-01-13 18:36:02 +01:00
rdrand.c x86/rdrand: Sanity-check RDRAND output 2019-10-01 19:55:32 +02:00
scattered.c x86/cpu: Add VM page flush MSR availablility as a CPUID feature 2020-12-14 11:09:30 -05:00
topology.c x86/topology: Set cpu_die_id only if DIE_TYPE found 2020-11-19 11:43:25 +01:00
transmeta.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tsx.c Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-01-28 12:46:42 -08:00
umc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
umwait.c KVM: VMX: Stop context switching MSR_IA32_UMWAIT_CONTROL 2020-06-22 20:54:57 -04:00
vmware.c KVM: SVM: Add GHCB accessor functions for retrieving fields 2020-12-14 11:09:32 -05:00
zhaoxin.c x86/cpu: Reinitialize IA32_FEAT_CTL MSR on BSP during wakeup 2020-06-15 14:18:37 +02:00