x86, 32-bit: trim memory not covered by wb mtrrs
[deliverable/linux.git] / arch / x86 / kernel / process_64.c
index f91521e26335d11f2139ffd9a9f207c6b0486bcc..dbe0a846ec52a2ec23033c4e480a63f8495eba85 100644 (file)
@@ -170,14 +170,13 @@ void cpu_idle(void)
        current_thread_info()->status |= TS_POLLING;
        /* endless idle loop with no priority at all */
        while (1) {
+               tick_nohz_stop_sched_tick();
                while (!need_resched()) {
                        void (*idle)(void);
 
                        if (__get_cpu_var(cpu_idle_state))
                                __get_cpu_var(cpu_idle_state) = 0;
 
-                       tick_nohz_stop_sched_tick();
-
                        rmb();
                        idle = pm_idle;
                        if (!idle)
@@ -281,10 +280,19 @@ static void mwait_idle(void)
        }
 }
 
+
+static int mwait_usable(const struct cpuinfo_x86 *c)
+{
+       if (force_mwait)
+               return 1;
+       /* Any C1 states supported? */
+       return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0;
+}
+
 void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
        static int printed;
-       if (cpu_has(c, X86_FEATURE_MWAIT)) {
+       if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
                /*
                 * Skip, if setup has overridden idle.
                 * One CPU supports mwait => All CPUs supports mwait
@@ -330,7 +338,7 @@ void __show_regs(struct pt_regs * regs)
                (int)strcspn(init_utsname()->version, " "),
                init_utsname()->version);
        printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip);
-       printk_address(regs->ip);
+       printk_address(regs->ip, 1);
        printk("RSP: %04lx:%016lx  EFLAGS: %08lx\n", regs->ss, regs->sp,
                regs->flags);
        printk("RAX: %016lx RBX: %016lx RCX: %016lx\n",
@@ -378,7 +386,7 @@ void show_regs(struct pt_regs *regs)
 {
        printk("CPU %d:", smp_processor_id());
        __show_regs(regs);
-       show_trace(NULL, regs, (void *)(regs + 1));
+       show_trace(NULL, regs, (void *)(regs + 1), regs->bp);
 }
 
 /*
@@ -544,24 +552,6 @@ out:
  */
 #define loaddebug(thread, r) set_debugreg(thread->debugreg ## r, r)
 
-/*
- * Capture the user space registers if the task is not running (in user space)
- */
-int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
-{
-       struct pt_regs *pp, ptregs;
-
-       pp = task_pt_regs(tsk);
-
-       ptregs = *pp;
-       ptregs.cs &= 0xffff;
-       ptregs.ss &= 0xffff;
-
-       elf_core_copy_regs(regs, &ptregs);
-
-       return 1;
-}
-
 static inline void __switch_to_xtra(struct task_struct *prev_p,
                                    struct task_struct *next_p,
                                    struct tss_struct *tss)
@@ -608,10 +598,6 @@ static inline void __switch_to_xtra(struct task_struct *prev_p,
                memset(tss->io_bitmap, 0xff, prev->io_bitmap_max);
        }
 
-       /*
-        * Last branch recording recofiguration of trace hardware and
-        * disentangling of trace data per task.
-        */
        if (test_tsk_thread_flag(prev_p, TIF_BTS_TRACE_TS))
                ptrace_bts_take_timestamp(prev_p, BTS_TASK_DEPARTS);
 
@@ -643,7 +629,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
        /*
         * Reload esp0, LDT and the page table pointer:
         */
-       tss->sp0 = next->sp0;
+       load_sp0(tss, next);
 
        /* 
         * Switch DS and ES.
@@ -933,4 +919,3 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
        unsigned long range_end = mm->brk + 0x02000000;
        return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
 }
-
This page took 0.026878 seconds and 5 git commands to generate.