Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] cpufreq/amd-pstate: Bail out early in virtual machines and don't warn
@ 2026-07-15 17:41 Rong Zhang
  2026-07-15 17:46 ` Mario Limonciello
  0 siblings, 1 reply; 7+ messages in thread
From: Rong Zhang @ 2026-07-15 17:41 UTC (permalink / raw)
  To: Huang Rui, Mario Limonciello, Perry Yuan, K Prateek Nayak,
	Rafael J. Wysocki, Viresh Kumar, Gautham R. Shenoy
  Cc: linux-pm, linux-kernel, Rong Zhang

When booting a virtual machine that simulates or passes-through a
relatively new CPUID, one or two warning messages are printed to kmsg:

    amd_pstate: The CPPC feature is supported but currently disabled by the BIOS.
    Please enable it if your BIOS has the CPPC option.
    amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled

Technically the check is not wrong and acts as a safetynet that prevents
the driver from being registered incorrectly, but the warning messages
are noisy and not really helpful, as virtual machines cannot adjust the
CPU frequency from the very beginning. Moreover, mentioning BIOS here
makes the messages even more confusing.

Fix it by bailing out early when running in virtual machines (excluding
Xen Dom0).

Fixes: cb817ec6673b ("cpufreq: amd-pstate: show CPPC debug message if CPPC is not supported")
Signed-off-by: Rong Zhang <i@rong.moe>
---
 drivers/cpufreq/amd-pstate.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index a74a4cf99d22..f2115f935318 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -2228,6 +2228,9 @@ static int __init amd_pstate_init(void)
 	if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
 		return -ENODEV;
 
+	if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR) && !xen_initial_domain())
+		return -ENODEV;
+
 	/* show debug message only if CPPC is not supported */
 	if (!amd_cppc_supported())
 		return -EOPNOTSUPP;

---
base-commit: 58717b2a1365d06c8c64b72aa948541b53fe31eb
change-id: 1cc24037-amd-pstate-vm-d6ab4c959bd3

Thanks,
Rong


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-15 22:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-15 17:41 [PATCH] cpufreq/amd-pstate: Bail out early in virtual machines and don't warn Rong Zhang
2026-07-15 17:46 ` Mario Limonciello
2026-07-15 18:04   ` Borislav Petkov
2026-07-15 19:21     ` Rong Zhang
2026-07-15 20:32       ` Jason Andryuk
2026-07-15 20:54         ` Mario Limonciello
2026-07-15 22:58         ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox