diff mbox series

[3/4] intel_idle: add VM guest (non)handling to model_specific_fixups

Message ID 20230717151856.2529029-3-arjan@linux.intel.com (mailing list archive)
State Superseded, archived
Headers show
Series [1/4] intel_idle: refactor and split out model specific fixups into its own function | expand

Commit Message

Arjan van de Ven July 17, 2023, 3:18 p.m. UTC
From: Arjan van de Ven <arjan@linux.intel.com>

The model specific fixups don't make sense in a VM guest; all the MSR
accesses at best will be fiction, and at worse cause logspam

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 drivers/idle/intel_idle.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index f3eba9b147d2..4dd8081d2406 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1957,6 +1957,10 @@  static bool should_verify_mwait(struct cpuidle_state *state)
 
 static void __init model_specific_fixups(void)
 {
+	/* when running in a hypervisor, none of these fixups will work */
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
+		return;
+
 	switch (boot_cpu_data.x86_model) {
 	case INTEL_FAM6_IVYBRIDGE_X:
 		ivt_idle_state_table_update();