[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] x86/mwait-idle: Graceful probe failure when MWAIT is disabled



commit cb36aafa76a49bb45a08d00e4f8682e79637c6bb
Author:     Len Brown <len.brown@xxxxxxxxx>
AuthorDate: Fri Nov 23 12:06:07 2018 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Nov 23 12:06:07 2018 +0100

    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
    
    Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    [Linux commit: a4c447533a18ee86e07232d6344ba12b1f9c5077]
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/cpu/mwait-idle.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 77fc3ddacc..f89c52f256 100644
--- 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_dnv = {
 };
 
 #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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.