aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r--arch/x86/kernel/process.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 57d1868a86aa..b6472153e45b 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -22,11 +22,6 @@
22#include <asm/i387.h> 22#include <asm/i387.h>
23#include <asm/debugreg.h> 23#include <asm/debugreg.h>
24 24
25unsigned long idle_halt;
26EXPORT_SYMBOL(idle_halt);
27unsigned long idle_nomwait;
28EXPORT_SYMBOL(idle_nomwait);
29
30struct kmem_cache *task_xstate_cachep; 25struct kmem_cache *task_xstate_cachep;
31EXPORT_SYMBOL_GPL(task_xstate_cachep); 26EXPORT_SYMBOL_GPL(task_xstate_cachep);
32 27
@@ -328,7 +323,7 @@ long sys_execve(const char __user *name,
328/* 323/*
329 * Idle related variables and functions 324 * Idle related variables and functions
330 */ 325 */
331unsigned long boot_option_idle_override = 0; 326unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE;
332EXPORT_SYMBOL(boot_option_idle_override); 327EXPORT_SYMBOL(boot_option_idle_override);
333 328
334/* 329/*
@@ -499,7 +494,6 @@ static void poll_idle(void)
499 * 494 *
500 * idle=mwait overrides this decision and forces the usage of mwait. 495 * idle=mwait overrides this decision and forces the usage of mwait.
501 */ 496 */
502static int __cpuinitdata force_mwait;
503 497
504#define MWAIT_INFO 0x05 498#define MWAIT_INFO 0x05
505#define MWAIT_ECX_EXTENDED_INFO 0x01 499#define MWAIT_ECX_EXTENDED_INFO 0x01
@@ -509,7 +503,7 @@ static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
509{ 503{
510 u32 eax, ebx, ecx, edx; 504 u32 eax, ebx, ecx, edx;
511 505
512 if (force_mwait) 506 if (boot_option_idle_override == IDLE_FORCE_MWAIT)
513 return 1; 507 return 1;
514 508
515 if (c->cpuid_level < MWAIT_INFO) 509 if (c->cpuid_level < MWAIT_INFO)
@@ -629,9 +623,10 @@ static int __init idle_setup(char *str)
629 if (!strcmp(str, "poll")) { 623 if (!strcmp(str, "poll")) {
630 printk("using polling idle threads.\n"); 624 printk("using polling idle threads.\n");
631 pm_idle = poll_idle; 625 pm_idle = poll_idle;
632 } else if (!strcmp(str, "mwait")) 626 boot_option_idle_override = IDLE_POLL;
633 force_mwait = 1; 627 } else if (!strcmp(str, "mwait")) {
634 else if (!strcmp(str, "halt")) { 628 boot_option_idle_override = IDLE_FORCE_MWAIT;
629 } else if (!strcmp(str, "halt")) {
635 /* 630 /*
636 * When the boot option of idle=halt is added, halt is 631 * When the boot option of idle=halt is added, halt is
637 * forced to be used for CPU idle. In such case CPU C2/C3 632 * forced to be used for CPU idle. In such case CPU C2/C3
@@ -640,8 +635,7 @@ static int __init idle_setup(char *str)
640 * the boot_option_idle_override. 635 * the boot_option_idle_override.
641 */ 636 */
642 pm_idle = default_idle; 637 pm_idle = default_idle;
643 idle_halt = 1; 638 boot_option_idle_override = IDLE_HALT;
644 return 0;
645 } else if (!strcmp(str, "nomwait")) { 639 } else if (!strcmp(str, "nomwait")) {
646 /* 640 /*
647 * If the boot option of "idle=nomwait" is added, 641 * If the boot option of "idle=nomwait" is added,
@@ -649,12 +643,10 @@ static int __init idle_setup(char *str)
649 * states. In such case it won't touch the variable 643 * states. In such case it won't touch the variable
650 * of boot_option_idle_override. 644 * of boot_option_idle_override.
651 */ 645 */
652 idle_nomwait = 1; 646 boot_option_idle_override = IDLE_NOMWAIT;
653 return 0;
654 } else 647 } else
655 return -1; 648 return -1;
656 649
657 boot_option_idle_override = 1;
658 return 0; 650 return 0;
659} 651}
660early_param("idle", idle_setup); 652early_param("idle", idle_setup);