All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/mwait-idle: Graceful probe failure when MWAIT is disabled
@ 2018-11-22  9:58 Jan Beulich
  2018-11-22 12:09 ` Roger Pau Monné
  2018-11-22 13:52 ` Andrew Cooper
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2018-11-22  9:58 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monne

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

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Linux commit: a4c447533a18ee86e07232d6344ba12b1f9c5077]
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/mwait-idle: Graceful probe failure when MWAIT is disabled
  2018-11-22  9:58 [PATCH] x86/mwait-idle: Graceful probe failure when MWAIT is disabled Jan Beulich
@ 2018-11-22 12:09 ` Roger Pau Monné
  2018-11-22 13:52 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Roger Pau Monné @ 2018-11-22 12:09 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Wei Liu, Andrew Cooper

On Thu, Nov 22, 2018 at 02:58:03AM -0700, Jan Beulich wrote:
> 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
> 
> Signed-off-by: Len Brown <len.brown@intel.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> [Linux commit: a4c447533a18ee86e07232d6344ba12b1f9c5077]
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/mwait-idle: Graceful probe failure when MWAIT is disabled
  2018-11-22  9:58 [PATCH] x86/mwait-idle: Graceful probe failure when MWAIT is disabled Jan Beulich
  2018-11-22 12:09 ` Roger Pau Monné
@ 2018-11-22 13:52 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2018-11-22 13:52 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Wei Liu, Roger Pau Monne

On 22/11/2018 09:58, Jan Beulich wrote:
> 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
>
> Signed-off-by: Len Brown <len.brown@intel.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> [Linux commit: a4c447533a18ee86e07232d6344ba12b1f9c5077]
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-11-22 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-22  9:58 [PATCH] x86/mwait-idle: Graceful probe failure when MWAIT is disabled Jan Beulich
2018-11-22 12:09 ` Roger Pau Monné
2018-11-22 13:52 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.