From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EB1CC433E0 for ; Fri, 5 Feb 2021 01:02:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E22B64F95 for ; Fri, 5 Feb 2021 01:02:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232500AbhBEBAL (ORCPT ); Thu, 4 Feb 2021 20:00:11 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:44156 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232392AbhBEA6n (ORCPT ); Thu, 4 Feb 2021 19:58:43 -0500 Message-Id: <20210204211155.100196672@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1612486681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=IeXqFHkyXQcQYKZrO/0J8hVsVVBF0HX1Izi/JiaMnro=; b=sBo2Dn1i3A85iC8T2s9TAHvZMEgIgblH+iZ+tTp7EeLcCnDbvCHHX7Jf7T0ZhY65X866JA gzosSXbdQ/AgRZfuCzR2WX5pko2cJpAZ2/mrQI+IVxwQsyxG9gtyc+xLxMLR2VoftCgabB k0EJLfZ/ukI2z/SLRsOf4CVzlY2u1jhKpKj7QVsr4BTT2IC5UnmzvAf3CjOlV3+rw5j8on CaG8RKNkVWaAsULnu2AsFSSjqUeqC2Js3iDT0iSsCStNrM3TswOCCTVSJswnK64uPT0FIN fqu2/N/TuwiveD7EJRS6xZkmfruTSBG5IrDTBNSa3R61fYL9tz6+GazOV/+I+g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1612486681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=IeXqFHkyXQcQYKZrO/0J8hVsVVBF0HX1Izi/JiaMnro=; b=O0jh47SuUKv/oHsb6RB12meAyaXIaVo5PgcaoI13vGS8gSSHMs2HbmW5WZI/s9TgllApDQ fRllmy6tcMr5ggBQ== Date: Thu, 04 Feb 2021 21:49:13 +0100 From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Josh Poimboeuf , Kees Cook Subject: [patch 10/12] x86: Select CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK References: <20210204204903.350275743@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that all invocations of irq_exit_rcu() happen on the irq stack, turn on CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK which causes the core code to invoke __do_softirq() directly without going through do_softirq_own_stack(). That means do_softirq_own_stack() is only invoked from task context which means it can't be on the irq stack. Remove the conditional from run_softirq_on_irqstack_cond() and rename the function accordingly. Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig | 1 + arch/x86/include/asm/irq_stack.h | 19 ++++++++----------- arch/x86/kernel/irq_64.c | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -187,6 +187,7 @@ config X86 select HAVE_HW_BREAKPOINT select HAVE_IDE select HAVE_IOREMAP_PROT + select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64 select HAVE_IRQ_TIME_ACCOUNTING select HAVE_KERNEL_BZIP2 select HAVE_KERNEL_GZIP --- a/arch/x86/include/asm/irq_stack.h +++ b/arch/x86/include/asm/irq_stack.h @@ -195,19 +195,16 @@ "call %P[__func] \n" /* - * Macro to invoke __do_softirq on the irq stack. Contrary to the above - * the only check which is necessary is whether the interrupt stack is - * in use already. + * Macro to invoke __do_softirq on the irq stack. This is only called from + * task context when bottom halfs are about to be reenabled and soft + * interrupts are pending to be processed. The interrupt stack cannot be in + * use here. */ -#define run_softirq_on_irqstack_cond() \ +#define run_softirq_on_irqstack() \ { \ - if (__this_cpu_read(hardirq_stack_inuse)) { \ - __do_softirq(); \ - } else { \ - __this_cpu_write(hardirq_stack_inuse, true); \ - __call_on_irqstack(__do_softirq, ASM_CALL_SOFTIRQ); \ - __this_cpu_write(hardirq_stack_inuse, false); \ - } \ + __this_cpu_write(hardirq_stack_inuse, true); \ + __call_on_irqstack(__do_softirq, ASM_CALL_SOFTIRQ); \ + __this_cpu_write(hardirq_stack_inuse, false); \ } #else /* CONFIG_X86_64 */ --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c @@ -76,5 +76,5 @@ int irq_init_percpu_irqstack(unsigned in void do_softirq_own_stack(void) { - run_softirq_on_irqstack_cond(); + run_softirq_on_irqstack(); }