Skip to content

Commit 2bcec09

Browse files
committed
x86/amd: Move amd_get_highest_perf() from amd.c to cppc.c
To prepare to let amd_get_highest_perf() detect preferred cores it will require CPPC functions. Move amd_get_highest_perf() to cppc.c to prepare for 'preferred core detection' rework. No functional changes intended. Reviewed-by: Perry Yuan <[email protected]> Reviewed-by: Gautham R. Shenoy <[email protected]> Signed-off-by: Mario Limonciello <[email protected]>
1 parent 6b612d1 commit 2bcec09

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

arch/x86/kernel/acpi/cppc.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,19 @@ void init_freq_invariance_cppc(void)
116116
init_done = true;
117117
mutex_unlock(&freq_invariance_lock);
118118
}
119+
120+
u32 amd_get_highest_perf(void)
121+
{
122+
struct cpuinfo_x86 *c = &boot_cpu_data;
123+
124+
if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) ||
125+
(c->x86_model >= 0x70 && c->x86_model < 0x80)))
126+
return 166;
127+
128+
if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) ||
129+
(c->x86_model >= 0x40 && c->x86_model < 0x70)))
130+
return 166;
131+
132+
return 255;
133+
}
134+
EXPORT_SYMBOL_GPL(amd_get_highest_perf);

arch/x86/kernel/cpu/amd.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,22 +1190,6 @@ unsigned long amd_get_dr_addr_mask(unsigned int dr)
11901190
}
11911191
EXPORT_SYMBOL_GPL(amd_get_dr_addr_mask);
11921192

1193-
u32 amd_get_highest_perf(void)
1194-
{
1195-
struct cpuinfo_x86 *c = &boot_cpu_data;
1196-
1197-
if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) ||
1198-
(c->x86_model >= 0x70 && c->x86_model < 0x80)))
1199-
return 166;
1200-
1201-
if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) ||
1202-
(c->x86_model >= 0x40 && c->x86_model < 0x70)))
1203-
return 166;
1204-
1205-
return 255;
1206-
}
1207-
EXPORT_SYMBOL_GPL(amd_get_highest_perf);
1208-
12091193
static void zenbleed_check_cpu(void *unused)
12101194
{
12111195
struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());

0 commit comments

Comments
 (0)