Skip to content

Commit ca62cf5

Browse files
committed
Merge branch 'misc' into release
Conflicts: arch/x86/kernel/process.c Signed-off-by: Len Brown <len.brown@intel.com>
2 parents 2e7d0f6 + 27be457 commit ca62cf5

8 files changed

Lines changed: 15 additions & 140 deletions

File tree

‎Documentation/kernel-parameters.txt‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,16 +1039,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
10391039
Claim all unknown PCI IDE storage controllers.
10401040

10411041
idle= [X86]
1042-
Format: idle=poll, idle=mwait, idle=halt, idle=nomwait
1042+
Format: idle=poll, idle=halt, idle=nomwait
10431043
Poll forces a polling idle loop that can slightly
10441044
improve the performance of waking up a idle CPU, but
10451045
will use a lot of power and make the system run hot.
10461046
Not recommended.
1047-
idle=mwait: On systems which support MONITOR/MWAIT but
1048-
the kernel chose to not use it because it doesn't save
1049-
as much power as a normal idle loop, use the
1050-
MONITOR/MWAIT idle loop anyways. Performance should be
1051-
the same as idle=poll.
10521047
idle=halt: Halt is forced to be used for CPU idle.
10531048
In such case C2/C3 won't be used again.
10541049
idle=nomwait: Disable mwait for CPU C-states
@@ -1886,10 +1881,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
18861881
wfi(ARM) instruction doesn't work correctly and not to
18871882
use it. This is also useful when using JTAG debugger.
18881883

1889-
no-hlt [BUGS=X86-32] Tells the kernel that the hlt
1890-
instruction doesn't work correctly and not to
1891-
use it.
1892-
18931884
no_file_caps Tells the kernel not to honor file capabilities. The
18941885
only way then for a file to be executed with privilege
18951886
is to be setuid root or executed by root.

‎arch/x86/include/asm/processor.h‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ struct cpuinfo_x86 {
8989
char wp_works_ok; /* It doesn't on 386's */
9090

9191
/* Problems on some 486Dx4's and old 386's: */
92-
char hlt_works_ok;
9392
char hard_math;
9493
char rfu;
9594
char fdiv_bug;
@@ -165,15 +164,6 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
165164

166165
extern const struct seq_operations cpuinfo_op;
167166

168-
static inline int hlt_works(int cpu)
169-
{
170-
#ifdef CONFIG_X86_32
171-
return cpu_data(cpu).hlt_works_ok;
172-
#else
173-
return 1;
174-
#endif
175-
}
176-
177167
#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
178168

179169
extern void cpu_detect(struct cpuinfo_x86 *c);
@@ -725,7 +715,7 @@ extern unsigned long boot_option_idle_override;
725715
extern bool amd_e400_c1e_detected;
726716

727717
enum idle_boot_override {IDLE_NO_OVERRIDE=0, IDLE_HALT, IDLE_NOMWAIT,
728-
IDLE_POLL, IDLE_FORCE_MWAIT};
718+
IDLE_POLL};
729719

730720
extern void enable_sep_cpu(void);
731721
extern int sysenter_setup(void);
@@ -998,7 +988,11 @@ extern unsigned long arch_align_stack(unsigned long sp);
998988
extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
999989

1000990
void default_idle(void);
1001-
bool set_pm_idle_to_default(void);
991+
#ifdef CONFIG_XEN
992+
bool xen_set_default_idle(void);
993+
#else
994+
#define xen_set_default_idle 0
995+
#endif
1002996

1003997
void stop_this_cpu(void *dummy);
1004998

‎arch/x86/kernel/cpu/bugs.c‎

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717
#include <asm/paravirt.h>
1818
#include <asm/alternative.h>
1919

20-
static int __init no_halt(char *s)
21-
{
22-
WARN_ONCE(1, "\"no-hlt\" is deprecated, please use \"idle=poll\"\n");
23-
boot_cpu_data.hlt_works_ok = 0;
24-
return 1;
25-
}
26-
27-
__setup("no-hlt", no_halt);
28-
2920
static int __init no_387(char *s)
3021
{
3122
boot_cpu_data.hard_math = 0;
@@ -89,23 +80,6 @@ static void __init check_fpu(void)
8980
pr_warn("Hmm, FPU with FDIV bug\n");
9081
}
9182

92-
static void __init check_hlt(void)
93-
{
94-
if (boot_cpu_data.x86 >= 5 || paravirt_enabled())
95-
return;
96-
97-
pr_info("Checking 'hlt' instruction... ");
98-
if (!boot_cpu_data.hlt_works_ok) {
99-
pr_cont("disabled\n");
100-
return;
101-
}
102-
halt();
103-
halt();
104-
halt();
105-
halt();
106-
pr_cont("OK\n");
107-
}
108-
10983
/*
11084
* Check whether we are able to run this kernel safely on SMP.
11185
*
@@ -129,7 +103,6 @@ void __init check_bugs(void)
129103
print_cpu_info(&boot_cpu_data);
130104
#endif
131105
check_config();
132-
check_hlt();
133106
init_utsname()->machine[1] =
134107
'0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86);
135108
alternative_instructions();

‎arch/x86/kernel/cpu/proc.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
2828
{
2929
seq_printf(m,
3030
"fdiv_bug\t: %s\n"
31-
"hlt_bug\t\t: %s\n"
3231
"f00f_bug\t: %s\n"
3332
"coma_bug\t: %s\n"
3433
"fpu\t\t: %s\n"
3534
"fpu_exception\t: %s\n"
3635
"cpuid level\t: %d\n"
3736
"wp\t\t: %s\n",
3837
c->fdiv_bug ? "yes" : "no",
39-
c->hlt_works_ok ? "no" : "yes",
4038
c->f00f_bug ? "yes" : "no",
4139
c->coma_bug ? "yes" : "no",
4240
c->hard_math ? "yes" : "no",

‎arch/x86/kernel/process.c‎

Lines changed: 6 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,16 @@ void default_idle(void)
390390
EXPORT_SYMBOL(default_idle);
391391
#endif
392392

393-
bool set_pm_idle_to_default(void)
393+
#ifdef CONFIG_XEN
394+
bool xen_set_default_idle(void)
394395
{
395396
bool ret = !!x86_idle;
396397

397398
x86_idle = default_idle;
398399

399400
return ret;
400401
}
402+
#endif
401403
void stop_this_cpu(void *dummy)
402404
{
403405
local_irq_disable();
@@ -407,31 +409,8 @@ void stop_this_cpu(void *dummy)
407409
set_cpu_online(smp_processor_id(), false);
408410
disable_local_APIC();
409411

410-
for (;;) {
411-
if (hlt_works(smp_processor_id()))
412-
halt();
413-
}
414-
}
415-
416-
/* Default MONITOR/MWAIT with no hints, used for default C1 state */
417-
static void mwait_idle(void)
418-
{
419-
if (!need_resched()) {
420-
trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
421-
trace_cpu_idle_rcuidle(1, smp_processor_id());
422-
if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
423-
clflush((void *)&current_thread_info()->flags);
424-
425-
__monitor((void *)&current_thread_info()->flags, 0, 0);
426-
smp_mb();
427-
if (!need_resched())
428-
__sti_mwait(0, 0);
429-
else
430-
local_irq_enable();
431-
trace_power_end_rcuidle(smp_processor_id());
432-
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
433-
} else
434-
local_irq_enable();
412+
for (;;)
413+
halt();
435414
}
436415

437416
/*
@@ -450,53 +429,6 @@ static void poll_idle(void)
450429
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
451430
}
452431

453-
/*
454-
* mwait selection logic:
455-
*
456-
* It depends on the CPU. For AMD CPUs that support MWAIT this is
457-
* wrong. Family 0x10 and 0x11 CPUs will enter C1 on HLT. Powersavings
458-
* then depend on a clock divisor and current Pstate of the core. If
459-
* all cores of a processor are in halt state (C1) the processor can
460-
* enter the C1E (C1 enhanced) state. If mwait is used this will never
461-
* happen.
462-
*
463-
* idle=mwait overrides this decision and forces the usage of mwait.
464-
*/
465-
466-
#define MWAIT_INFO 0x05
467-
#define MWAIT_ECX_EXTENDED_INFO 0x01
468-
#define MWAIT_EDX_C1 0xf0
469-
470-
int mwait_usable(const struct cpuinfo_x86 *c)
471-
{
472-
u32 eax, ebx, ecx, edx;
473-
474-
/* Use mwait if idle=mwait boot option is given */
475-
if (boot_option_idle_override == IDLE_FORCE_MWAIT)
476-
return 1;
477-
478-
/*
479-
* Any idle= boot option other than idle=mwait means that we must not
480-
* use mwait. Eg: idle=halt or idle=poll or idle=nomwait
481-
*/
482-
if (boot_option_idle_override != IDLE_NO_OVERRIDE)
483-
return 0;
484-
485-
if (c->cpuid_level < MWAIT_INFO)
486-
return 0;
487-
488-
cpuid(MWAIT_INFO, &eax, &ebx, &ecx, &edx);
489-
/* Check, whether EDX has extended info about MWAIT */
490-
if (!(ecx & MWAIT_ECX_EXTENDED_INFO))
491-
return 1;
492-
493-
/*
494-
* edx enumeratios MONITOR/MWAIT extensions. Check, whether
495-
* C1 supports MWAIT
496-
*/
497-
return (edx & MWAIT_EDX_C1);
498-
}
499-
500432
bool amd_e400_c1e_detected;
501433
EXPORT_SYMBOL(amd_e400_c1e_detected);
502434

@@ -567,13 +499,7 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
567499
if (x86_idle)
568500
return;
569501

570-
if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
571-
/*
572-
* One CPU supports mwait => All CPUs supports mwait
573-
*/
574-
pr_info("using mwait in idle threads\n");
575-
x86_idle = mwait_idle;
576-
} else if (cpu_has_amd_erratum(amd_erratum_400)) {
502+
if (cpu_has_amd_erratum(amd_erratum_400)) {
577503
/* E400: APIC timer interrupt does not wake up CPU from C1e */
578504
pr_info("using AMD E400 aware idle routine\n");
579505
x86_idle = amd_e400_idle;
@@ -597,9 +523,6 @@ static int __init idle_setup(char *str)
597523
pr_info("using polling idle threads\n");
598524
x86_idle = poll_idle;
599525
boot_option_idle_override = IDLE_POLL;
600-
} else if (!strcmp(str, "mwait")) {
601-
boot_option_idle_override = IDLE_FORCE_MWAIT;
602-
WARN_ONCE(1, "\"idle=mwait\" will be removed in 2012\n");
603526
} else if (!strcmp(str, "halt")) {
604527
/*
605528
* When the boot option of idle=halt is added, halt is

‎arch/x86/kernel/smpboot.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ static inline void mwait_play_dead(void)
13691369
void *mwait_ptr;
13701370
struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info);
13711371

1372-
if (!(this_cpu_has(X86_FEATURE_MWAIT) && mwait_usable(c)))
1372+
if (!this_cpu_has(X86_FEATURE_MWAIT))
13731373
return;
13741374
if (!this_cpu_has(X86_FEATURE_CLFLSH))
13751375
return;

‎arch/x86/xen/setup.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,9 @@ void __init xen_arch_setup(void)
556556
COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE);
557557

558558
/* Set up idle, making sure it calls safe_halt() pvop */
559-
#ifdef CONFIG_X86_32
560-
boot_cpu_data.hlt_works_ok = 1;
561-
#endif
562559
disable_cpuidle();
563560
disable_cpufreq();
564-
WARN_ON(set_pm_idle_to_default());
561+
WARN_ON(xen_set_default_idle());
565562
fiddle_vdso();
566563
#ifdef CONFIG_NUMA
567564
numa_off = 1;

‎drivers/acpi/processor_idle.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ static struct acpi_processor_cx *acpi_cstate[CPUIDLE_STATE_MAX];
7171
static int disabled_by_idle_boot_param(void)
7272
{
7373
return boot_option_idle_override == IDLE_POLL ||
74-
boot_option_idle_override == IDLE_FORCE_MWAIT ||
7574
boot_option_idle_override == IDLE_HALT;
7675
}
7776

0 commit comments

Comments
 (0)