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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0B48C4332F for ; Tue, 11 Oct 2022 15:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IQhWKs+R2+ZLAiZ9Agfc2kAqywX7m24+2fq06JqrPVo=; b=LY/80YxHGPgbdE bRUuCyCPcZeWc86y+x3a0/xAoyimKwrWUDc1MfMEij66IDdFNfAh/dd7LDki3Jfwqs4O9d1QylhHw edOP7++iORoWlIT6emEOwxNkx/KlShlw7Z7eiUlL4/CYU3Y5CI1e61fdpRsPmdP90QHzx8kMo7OFv z3mnU8r/kO7GjFVAHGJ5EhaSzGgFGBcr+1CMlz48d6XK9p9qp/eAjXY3vAhdkgqMoz3C96i/QpK5c qfc2O8MBoPE85W351NG4CZ6m6zFJCM4B4mFkjF94oEI+nbqQ1TPUF5nuBSX2dAKp5Ofu+dxsoLvhy uHrA/NaZbr0hib+bcwyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiHCQ-004oL8-Eb; Tue, 11 Oct 2022 15:29:43 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiGco-004YeG-M2 for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 14:52:56 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2772D611B0; Tue, 11 Oct 2022 14:52:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD31FC433D7; Tue, 11 Oct 2022 14:52:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665499973; bh=+2Uexoq1RUVq8EcT0uT55HnAPIB1PMUURPdHRSIVR+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lkwLQN1+Bol/2M35cigOI+zXicoMLWQvhsnYVV0chWsZlccAG6ZEAyNfWo/aiC+1x RTQBIgQmNjjtrU9nM0Ykb8kNFGP3uXHZbulcuKunYiSL/EGO7Gy79nzfvXiIAdQ5fs TdID1daAzBtmgnfQ4soYXgrGyW3hW0RXVclOrVvz6k2RDYcq6Qfu6GV2rg9pZz9eKk jcLk/PlmG558PV/ZboUhgg5CxlIA8YJ4So4zB3fGHXuoIw3pq9yRPz3IVTg4bo4Heo Nb694HLTH2FQSR7D8HtZnwSI6wEgWPAu6jtbasSun3zSVPaIgI97OObWT5zQ3j5Gq8 0OmfC73K+J8qA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Qi Zheng , Arnd Bergmann , Will Deacon , Catalin Marinas , Sasha Levin , linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 13/26] arm64: run softirqs on the per-CPU IRQ stack Date: Tue, 11 Oct 2022 10:52:20 -0400 Message-Id: <20221011145233.1624013-13-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221011145233.1624013-1-sashal@kernel.org> References: <20221011145233.1624013-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_075254_823350_E3352D06 X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Qi Zheng [ Upstream commit 8eb858c44b98e0326bb32fca34ae671995cd73bb ] Currently arm64 supports per-CPU IRQ stack, but softirqs are still handled in the task context. Since any call to local_bh_enable() at any level in the task's call stack may trigger a softirq processing run, which could potentially cause a task stack overflow if the combined stack footprints exceed the stack's size, let's run these softirqs on the IRQ stack as well. Signed-off-by: Qi Zheng Reviewed-by: Arnd Bergmann Acked-by: Will Deacon Link: https://lore.kernel.org/r/20220815124739.15948-1-zhengqi.arch@bytedance.com Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- arch/arm64/Kconfig | 1 + arch/arm64/kernel/irq.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 24cce3b9ff1a..496c68aa1b98 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -221,6 +221,7 @@ config ARM64 select HAVE_ARCH_USERFAULTFD_MINOR if USERFAULTFD select TRACE_IRQFLAGS_SUPPORT select TRACE_IRQFLAGS_NMI_SUPPORT + select HAVE_SOFTIRQ_ON_OWN_STACK help ARM 64-bit (AArch64) Linux support. diff --git a/arch/arm64/kernel/irq.c b/arch/arm64/kernel/irq.c index bda49430c9ea..38dbd3828f13 100644 --- a/arch/arm64/kernel/irq.c +++ b/arch/arm64/kernel/irq.c @@ -21,7 +21,9 @@ #include #include #include +#include #include +#include /* Only access this in an NMI enter/exit */ DEFINE_PER_CPU(struct nmi_ctx, nmi_contexts); @@ -71,6 +73,18 @@ static void init_irq_stacks(void) } #endif +#ifndef CONFIG_PREEMPT_RT +static void ____do_softirq(struct pt_regs *regs) +{ + __do_softirq(); +} + +void do_softirq_own_stack(void) +{ + call_on_irq_stack(NULL, ____do_softirq); +} +#endif + static void default_handle_irq(struct pt_regs *regs) { panic("IRQ taken without a root IRQ handler\n"); -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel