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 10FAAC433FE for ; Tue, 11 Oct 2022 15:15: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=bl417idwPRH+mTNVfJ5EPkxtZoojLqfRTozVpXqIfMs=; b=cyX2C+A48JLtSK ASkvoYQwqt/cmkIdEPDaqmT7m+hPhv6zm59b7QpEV/Bh7DY3KmUUE1gG4CEWK98xO1fTqQ3xFVlOn 7THPL1Poe1ZyZ6rfl/tHlCi8+tAmPNdtvRA0J3aS6dvNPLa/0PdnzRNLgw94uh03IPrYBOse8IRYT /4CMNW4iNACcoskPo3xP/y3+7BIRaaASO9pmf+uz3qtHT7iW/xf2qDJdY0FHgmDW6GLOdR1YCVOWf hRmIqhBbudFMQMOrJGiA5E528FWRPij9LXGm3q+C9XkQVIsDu92Ggn3MhgJl3+gncHHGZUw0m5ok3 gosKxIBp49/Mcm49TcRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiGxy-004iOP-T5; Tue, 11 Oct 2022 15:14:47 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiGbw-004Y9d-VX for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 14:52:02 +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 80632611CA; Tue, 11 Oct 2022 14:52:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB877C433D6; Tue, 11 Oct 2022 14:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665499919; bh=41z8DR5540UKHevpWyzwuW1g2GJIwYdiG4YznirPtA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B8zNEXk0kErildTHemxFgajoqmEOvnH+hNTMLX/aZgwZ3DtVguF5jjrXWdOsx+6Xa lRUt+3qaEeSBAcQ0oVcTavJ6n1kDvokWxeiq0n41qlvzu8qWmYOadIcNzGKCer1v8I 4MotvDUcnEYGcRoNCxRUmEUFYHEwpqQHrJw5bChlVXIRLpepFYR42gvvvKPxwV1v8t Wmbj4hF7PIXSDMfZw7YwRehlxJqPVJn2e5/c3YIyE9DaxD/rgECg4E9eDwcvoyhs7d nIKAu8KMDOfH3aL50tK3SG4m+qcfR6tG1JfOQZGDR3sILxq4iv2uDzKWjVWNxQL8Pa Dpn3H2f58TI2A== 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.19 18/40] arm64: run softirqs on the per-CPU IRQ stack Date: Tue, 11 Oct 2022 10:51:07 -0400 Message-Id: <20221011145129.1623487-18-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221011145129.1623487-1-sashal@kernel.org> References: <20221011145129.1623487-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_075201_112864_30774892 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 cc1e7bb49d38..07537d34224f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -227,6 +227,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