From a8c67364a625994d2c3796bd7034297f4d88dab5 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Thu, 20 Jan 2011 15:42:52 +0100 Subject: [PATCH] --- yaml --- r: 232281 b: refs/heads/master c: 93789b32dbf355e70f18b17a82e8661677a7f7fb h: refs/heads/master i: 232279: 67c941595d3b85d64896a02fae87025523eb56e2 v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/cpu.h | 1 + trunk/arch/x86/kernel/process.c | 3 ++- trunk/arch/x86/kernel/smpboot.c | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 3146fe019e6f..cbbd208fb0c6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f21bbec9ffcaf73e99938209e52b757d93f9133b +refs/heads/master: 93789b32dbf355e70f18b17a82e8661677a7f7fb diff --git a/trunk/arch/x86/include/asm/cpu.h b/trunk/arch/x86/include/asm/cpu.h index 4fab24de26b1..6e6e7558e702 100644 --- a/trunk/arch/x86/include/asm/cpu.h +++ b/trunk/arch/x86/include/asm/cpu.h @@ -32,5 +32,6 @@ extern void arch_unregister_cpu(int); DECLARE_PER_CPU(int, cpu_state); +int __cpuinit mwait_usable(const struct cpuinfo_x86 *); #endif /* _ASM_X86_CPU_H */ diff --git a/trunk/arch/x86/kernel/process.c b/trunk/arch/x86/kernel/process.c index d8286ed54ffa..e764fc05d700 100644 --- a/trunk/arch/x86/kernel/process.c +++ b/trunk/arch/x86/kernel/process.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -505,7 +506,7 @@ static void poll_idle(void) #define MWAIT_ECX_EXTENDED_INFO 0x01 #define MWAIT_EDX_C1 0xf0 -static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c) +int __cpuinit mwait_usable(const struct cpuinfo_x86 *c) { u32 eax, ebx, ecx, edx; diff --git a/trunk/arch/x86/kernel/smpboot.c b/trunk/arch/x86/kernel/smpboot.c index 763df77343dd..0cbe8c0b35ed 100644 --- a/trunk/arch/x86/kernel/smpboot.c +++ b/trunk/arch/x86/kernel/smpboot.c @@ -1402,8 +1402,9 @@ static inline void mwait_play_dead(void) unsigned int highest_subcstate = 0; int i; void *mwait_ptr; + struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info); - if (!cpu_has(__this_cpu_ptr(&cpu_info), X86_FEATURE_MWAIT)) + if (!(cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c))) return; if (!cpu_has(__this_cpu_ptr(&cpu_info), X86_FEATURE_CLFLSH)) return;