Skip to content

Commit e48cb1a

Browse files
Fenghua Yusuryasaimadhu
authored andcommitted
x86/resctrl: Enumerate per-thread MBA controls
Some systems support per-thread Memory Bandwidth Allocation (MBA) which applies a throttling delay value to each hardware thread instead of to a core. Per-thread MBA is enumerated by CPUID. No feature flag is shown in /proc/cpuinfo. User applications need to check a resctrl throttling mode info file to know if the feature is supported. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Babu Moger <babu.moger@amd.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://lkml.kernel.org/r/1598296281-127595-2-git-send-email-fenghua.yu@intel.com
1 parent 709c436 commit e48cb1a

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

arch/x86/include/asm/cpufeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@
288288
#define X86_FEATURE_FENCE_SWAPGS_USER (11*32+ 4) /* "" LFENCE in user entry SWAPGS path */
289289
#define X86_FEATURE_FENCE_SWAPGS_KERNEL (11*32+ 5) /* "" LFENCE in kernel entry SWAPGS path */
290290
#define X86_FEATURE_SPLIT_LOCK_DETECT (11*32+ 6) /* #AC for split lock */
291+
#define X86_FEATURE_PER_THREAD_MBA (11*32+ 7) /* "" Per-thread Memory Bandwidth Allocation */
291292

292293
/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
293294
#define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */

arch/x86/kernel/cpu/cpuid-deps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static const struct cpuid_dep cpuid_deps[] = {
6969
{ X86_FEATURE_CQM_MBM_TOTAL, X86_FEATURE_CQM_LLC },
7070
{ X86_FEATURE_CQM_MBM_LOCAL, X86_FEATURE_CQM_LLC },
7171
{ X86_FEATURE_AVX512_BF16, X86_FEATURE_AVX512VL },
72+
{ X86_FEATURE_PER_THREAD_MBA, X86_FEATURE_MBA },
7273
{}
7374
};
7475

arch/x86/kernel/cpu/scattered.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ static const struct cpuid_bit cpuid_bits[] = {
3535
{ X86_FEATURE_CDP_L3, CPUID_ECX, 2, 0x00000010, 1 },
3636
{ X86_FEATURE_CDP_L2, CPUID_ECX, 2, 0x00000010, 2 },
3737
{ X86_FEATURE_MBA, CPUID_EBX, 3, 0x00000010, 0 },
38+
{ X86_FEATURE_PER_THREAD_MBA, CPUID_ECX, 0, 0x00000010, 3 },
3839
{ X86_FEATURE_HW_PSTATE, CPUID_EDX, 7, 0x80000007, 0 },
3940
{ X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 },
4041
{ X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 },

0 commit comments

Comments
 (0)