From dc4d5f1ef6b73db6bb75e31d35223da21c5a52ea Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 20 Jan 2026 09:01:50 +0100 Subject: [PATCH] x86/cpufreq: use host CPU policy for Turbo checking There's no need to invoke CPUID yet another time - we assume symmetry anyway. With symmetry assumed, logging per-CPU also isn't very useful. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Reviewed-by: Jason Andryuk --- xen/arch/x86/acpi/cpufreq/acpi.c | 11 ++++------- xen/arch/x86/include/asm/cpufeature.h | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/acpi/cpufreq/acpi.c b/xen/arch/x86/acpi/cpufreq/acpi.c index b027459417..2d08c3094f 100644 --- a/xen/arch/x86/acpi/cpufreq/acpi.c +++ b/xen/arch/x86/acpi/cpufreq/acpi.c @@ -220,14 +220,11 @@ static unsigned int cf_check get_cur_freq_on_cpu(unsigned int cpu) void intel_feature_detect(struct cpufreq_policy *policy) { - unsigned int eax; - - eax = cpuid_eax(6); - if (eax & 0x2) { + if ( cpu_has_turbo_boost ) + { policy->turbo = CPUFREQ_TURBO_ENABLED; - if (cpufreq_verbose) - printk(XENLOG_INFO "CPU%u: Turbo Mode detected and enabled\n", - smp_processor_id()); + if ( cpufreq_verbose ) + printk_once(XENLOG_INFO "Turbo Mode detected and enabled\n"); } } diff --git a/xen/arch/x86/include/asm/cpufeature.h b/xen/arch/x86/include/asm/cpufeature.h index f45295d84e..a0374c1b20 100644 --- a/xen/arch/x86/include/asm/cpufeature.h +++ b/xen/arch/x86/include/asm/cpufeature.h @@ -177,6 +177,7 @@ static inline bool boot_cpu_has(unsigned int feat) #define cpu_has_tbm boot_cpu_has(X86_FEATURE_TBM) /* CPUID level 0x00000006.eax */ +#define cpu_has_turbo_boost host_cpu_policy.basic.turbo_boost #define cpu_has_arat host_cpu_policy.basic.arat /* CPUID level 0x00000006.ecx */