Skip to content

Commit

Permalink
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip

Pull cpu idle fixes from Thomas Gleixner:
 - Add a missing irq enable. Fallout of the idle conversion
 - Fix stackprotector wreckage caused by the idle conversion

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  idle: Enable interrupts in the weak arch_cpu_idle() implementation
  idle: Add the stack canary init to cpu_startup_entry()
  • Loading branch information
Linus Torvalds committed Jun 20, 2013
2 parents 4db88eb + 29ce378 commit 805e318
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
12 changes: 0 additions & 12 deletions arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,18 +277,6 @@ void exit_idle(void)
}
#endif

void arch_cpu_idle_prepare(void)
{
/*
* If we're the non-boot CPU, nothing set the stack canary up
* for us. CPU0 already has it initialized but no harm in
* doing it again. This is a good place for updating it, as
* we wont ever return from this function (so the invalid
* canaries already on the stack wont ever trigger).
*/
boot_init_stack_canary();
}

void arch_cpu_idle_enter(void)
{
local_touch_nmi();
Expand Down
17 changes: 17 additions & 0 deletions kernel/cpu/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <linux/cpu.h>
#include <linux/tick.h>
#include <linux/mm.h>
#include <linux/stackprotector.h>

#include <asm/tlb.h>

Expand Down Expand Up @@ -58,6 +59,7 @@ void __weak arch_cpu_idle_dead(void) { }
void __weak arch_cpu_idle(void)
{
cpu_idle_force_poll = 1;
local_irq_enable();
}

/*
Expand Down Expand Up @@ -112,6 +114,21 @@ static void cpu_idle_loop(void)

void cpu_startup_entry(enum cpuhp_state state)
{
/*
* This #ifdef needs to die, but it's too late in the cycle to
* make this generic (arm and sh have never invoked the canary
* init for the non boot cpus!). Will be fixed in 3.11
*/
#ifdef CONFIG_X86
/*
* If we're the non-boot CPU, nothing set the stack canary up
* for us. The boot CPU already has it initialized but no harm
* in doing it again. This is a good place for updating it, as
* we wont ever return from this function (so the invalid
* canaries already on the stack wont ever trigger).
*/
boot_init_stack_canary();
#endif
current_set_polling();
arch_cpu_idle_prepare();
cpu_idle_loop();
Expand Down

0 comments on commit 805e318

Please sign in to comment.