Skip to content

Commit db99675

Browse files
aeglbp3tk0v
authored andcommitted
x86/resctrl: Switch to new Intel CPU model defines
New CPU #defines encode vendor and family as well as model. [ bp: Squash two resctrl patches into one. ] Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/all/20240424181514.41848-1-tony.luck%40intel.com
1 parent 375a756 commit db99675

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <linux/cacheinfo.h>
2323
#include <linux/cpuhotplug.h>
2424

25-
#include <asm/intel-family.h>
25+
#include <asm/cpu_device_id.h>
2626
#include <asm/resctrl.h>
2727
#include "internal.h"
2828

@@ -821,18 +821,18 @@ static __init bool get_rdt_mon_resources(void)
821821

822822
static __init void __check_quirks_intel(void)
823823
{
824-
switch (boot_cpu_data.x86_model) {
825-
case INTEL_FAM6_HASWELL_X:
824+
switch (boot_cpu_data.x86_vfm) {
825+
case INTEL_HASWELL_X:
826826
if (!rdt_options[RDT_FLAG_L3_CAT].force_off)
827827
cache_alloc_hsw_probe();
828828
break;
829-
case INTEL_FAM6_SKYLAKE_X:
829+
case INTEL_SKYLAKE_X:
830830
if (boot_cpu_data.x86_stepping <= 4)
831831
set_rdt_options("!cmt,!mbmtotal,!mbmlocal,!l3cat");
832832
else
833833
set_rdt_options("!l3cat");
834834
fallthrough;
835-
case INTEL_FAM6_BROADWELL_X:
835+
case INTEL_BROADWELL_X:
836836
intel_rdt_mbm_apply_quirk();
837837
break;
838838
}

arch/x86/kernel/cpu/resctrl/pseudo_lock.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <linux/uaccess.h>
2424

2525
#include <asm/cacheflush.h>
26-
#include <asm/intel-family.h>
26+
#include <asm/cpu_device_id.h>
2727
#include <asm/resctrl.h>
2828
#include <asm/perf_event.h>
2929

@@ -88,8 +88,8 @@ static u64 get_prefetch_disable_bits(void)
8888
boot_cpu_data.x86 != 6)
8989
return 0;
9090

91-
switch (boot_cpu_data.x86_model) {
92-
case INTEL_FAM6_BROADWELL_X:
91+
switch (boot_cpu_data.x86_vfm) {
92+
case INTEL_BROADWELL_X:
9393
/*
9494
* SDM defines bits of MSR_MISC_FEATURE_CONTROL register
9595
* as:
@@ -100,8 +100,8 @@ static u64 get_prefetch_disable_bits(void)
100100
* 63:4 Reserved
101101
*/
102102
return 0xF;
103-
case INTEL_FAM6_ATOM_GOLDMONT:
104-
case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
103+
case INTEL_ATOM_GOLDMONT:
104+
case INTEL_ATOM_GOLDMONT_PLUS:
105105
/*
106106
* SDM defines bits of MSR_MISC_FEATURE_CONTROL register
107107
* as:
@@ -1084,9 +1084,9 @@ static int measure_l2_residency(void *_plr)
10841084
* L2_HIT 02H
10851085
* L2_MISS 10H
10861086
*/
1087-
switch (boot_cpu_data.x86_model) {
1088-
case INTEL_FAM6_ATOM_GOLDMONT:
1089-
case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
1087+
switch (boot_cpu_data.x86_vfm) {
1088+
case INTEL_ATOM_GOLDMONT:
1089+
case INTEL_ATOM_GOLDMONT_PLUS:
10901090
perf_miss_attr.config = X86_CONFIG(.event = 0xd1,
10911091
.umask = 0x10);
10921092
perf_hit_attr.config = X86_CONFIG(.event = 0xd1,
@@ -1123,8 +1123,8 @@ static int measure_l3_residency(void *_plr)
11231123
* MISS 41H
11241124
*/
11251125

1126-
switch (boot_cpu_data.x86_model) {
1127-
case INTEL_FAM6_BROADWELL_X:
1126+
switch (boot_cpu_data.x86_vfm) {
1127+
case INTEL_BROADWELL_X:
11281128
/* On BDW the hit event counts references, not hits */
11291129
perf_hit_attr.config = X86_CONFIG(.event = 0x2e,
11301130
.umask = 0x4f);
@@ -1142,7 +1142,7 @@ static int measure_l3_residency(void *_plr)
11421142
*/
11431143

11441144
counts.miss_after -= counts.miss_before;
1145-
if (boot_cpu_data.x86_model == INTEL_FAM6_BROADWELL_X) {
1145+
if (boot_cpu_data.x86_vfm == INTEL_BROADWELL_X) {
11461146
/*
11471147
* On BDW references and misses are counted, need to adjust.
11481148
* Sometimes the "hits" counter is a bit more than the

0 commit comments

Comments
 (0)