Skip to content

Commit 38776cc

Browse files
Kan LiangPeter Zijlstra
authored andcommitted
perf/x86/uncore: Correct the number of CHAs on SPR
The number of CHAs from the discovery table on some SPR variants is incorrect, because of a firmware issue. An accurate number can be read from the MSR UNC_CBO_CONFIG. Fixes: 949b113 ("perf/x86/intel/uncore: Add Sapphire Rapids server CHA support") Reported-by: Stephane Eranian <[email protected]> Signed-off-by: Kan Liang <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Stephane Eranian <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent 3c84530 commit 38776cc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

arch/x86/events/intel/uncore_snbep.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6150,6 +6150,7 @@ static struct intel_uncore_type spr_uncore_mdf = {
61506150
};
61516151

61526152
#define UNCORE_SPR_NUM_UNCORE_TYPES 12
6153+
#define UNCORE_SPR_CHA 0
61536154
#define UNCORE_SPR_IIO 1
61546155
#define UNCORE_SPR_IMC 6
61556156
#define UNCORE_SPR_UPI 8
@@ -6460,12 +6461,22 @@ static int uncore_type_max_boxes(struct intel_uncore_type **types,
64606461
return max + 1;
64616462
}
64626463

6464+
#define SPR_MSR_UNC_CBO_CONFIG 0x2FFE
6465+
64636466
void spr_uncore_cpu_init(void)
64646467
{
6468+
struct intel_uncore_type *type;
6469+
u64 num_cbo;
6470+
64656471
uncore_msr_uncores = uncore_get_uncores(UNCORE_ACCESS_MSR,
64666472
UNCORE_SPR_MSR_EXTRA_UNCORES,
64676473
spr_msr_uncores);
64686474

6475+
type = uncore_find_type_by_id(uncore_msr_uncores, UNCORE_SPR_CHA);
6476+
if (type) {
6477+
rdmsrl(SPR_MSR_UNC_CBO_CONFIG, num_cbo);
6478+
type->num_boxes = num_cbo;
6479+
}
64696480
spr_uncore_iio_free_running.num_boxes = uncore_type_max_boxes(uncore_msr_uncores, UNCORE_SPR_IIO);
64706481
}
64716482

0 commit comments

Comments
 (0)