Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232281
b: refs/heads/master
c: 93789b3
h: refs/heads/master
i:
  232279: 67c9415
v: v3
  • Loading branch information
Borislav Petkov authored and H. Peter Anvin committed Jan 22, 2011
1 parent 85976a5 commit a8c6736
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f21bbec9ffcaf73e99938209e52b757d93f9133b
refs/heads/master: 93789b32dbf355e70f18b17a82e8661677a7f7fb
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
3 changes: 2 additions & 1 deletion trunk/arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/utsname.h>
#include <trace/events/power.h>
#include <linux/hw_breakpoint.h>
#include <asm/cpu.h>
#include <asm/system.h>
#include <asm/apic.h>
#include <asm/syscalls.h>
Expand Down Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a8c6736

Please sign in to comment.