From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422978AbcBZSu2 (ORCPT ); Fri, 26 Feb 2016 13:50:28 -0500 Received: from www.linutronix.de ([62.245.132.108]:33361 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932880AbcBZSoy (ORCPT ); Fri, 26 Feb 2016 13:44:54 -0500 Message-Id: <20160226182340.242063758@linutronix.de> User-Agent: quilt/0.63-1 Date: Fri, 26 Feb 2016 18:43:22 -0000 From: Thomas Gleixner To: LKML Cc: Linus Torvalds , Andrew Morton , Ingo Molnar , Peter Zijlstra , Peter Anvin , Oleg Nesterov , linux-arch@vger.kernel.org, Tejun Heo , Steven Rostedt , Rusty Russell , Paul McKenney , Rafael Wysocki , Arjan van de Ven , Rik van Riel , "Srivatsa S. Bhat" , Sebastian Siewior , Paul Turner Subject: [patch 01/20] idle: Move x86ism out of generic code References: <20160226164321.657646833@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=idle--Move-x86ism-out-of-generic-code.patch X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have an arch specific callback here already. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/process.c | 12 ++++++++++++ kernel/sched/idle.c | 15 --------------- 2 files changed, 12 insertions(+), 15 deletions(-) Index: b/arch/x86/kernel/process.c =================================================================== --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -271,6 +271,18 @@ 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. 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(); +} + void arch_cpu_idle_enter(void) { local_touch_nmi(); Index: b/kernel/sched/idle.c =================================================================== --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -275,21 +275,6 @@ 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 arch_cpu_idle_prepare(); cpu_idle_loop(); }