Skip to contentSkip to conversation

x86/mwait-idle: Graceful probe failure when MWAIT is disabled

PATCH In review Jan Beulich 3 participants 3 messages Nov 22, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mwait-idle: Graceful probe failure when MWAIT is disabled

When MWAIT is disabled, intel_idle refuses to probe. But it may mis-lead the user by blaming this on the model number:

intel_idle: does not run on family 6 modesl 79

So defer the check for MWAIT until after the model# white-list check succeeds, and if the MWAIT check fails, tell the user how to fix it:

intel_idle: Please enable MWAIT in BIOS SETUP

[Linux commit: a4c447533a18ee86e07232d6344ba12b1f9c5077]
xen/arch/x86/cpu/mwait-idle.c +6 -2
@@ -917,8 +917,7 @@ static const struct idle_cpu idle_cpu_dn
 };
 
 #define ICPU(model, cpu) \
-    { X86_VENDOR_INTEL, 6, model, X86_FEATURE_MONITOR, \
-        &idle_cpu_##cpu}
+	{ X86_VENDOR_INTEL, 6, model, X86_FEATURE_ALWAYS, &idle_cpu_##cpu}
 
 static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
 	ICPU(0x1a, nehalem),
@@ -1121,6 +1120,11 @@ static int __init mwait_idle_probe(void)
 		return -ENODEV;
 	}
 
+	if (!boot_cpu_has(X86_FEATURE_MONITOR)) {
+		pr_debug(PREFIX "Please enable MWAIT in BIOS SETUP\n");
+		return -ENODEV;
+	}
+
 	if (boot_cpu_data.cpuid_level < CPUID_MWAIT_LEAF)
 		return -ENODEV;
 

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jan Beulich

When MWAIT is disabled, intel_idle refuses to probe. But it may mis-lead the user by blaming this on the model number:

intel_idle: does not run on family 6 modesl 79

So defer the check for MWAIT until after the model# white-list check succeeds, and if the MWAIT check fails, tell the user how to fix it:

Quoted 6 lines

intel_idle: Please enable MWAIT in BIOS SETUP

[Linux commit: a4c447533a18ee86e07232d6344ba12b1f9c5077]

Thanks.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Jan Beulich
Quoted 8 lines · Jan Beulich

When MWAIT is disabled, intel_idle refuses to probe. But it may mis-lead the user by blaming this on the model number:

intel_idle: does not run on family 6 modesl 79

So defer the check for MWAIT until after the model# white-list check succeeds, and if the MWAIT check fails, tell the user how to fix it:

Quoted 6 lines

intel_idle: Please enable MWAIT in BIOS SETUP

[Linux commit: a4c447533a18ee86e07232d6344ba12b1f9c5077]

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel