Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp264157iol; Thu, 9 Jun 2022 03:30:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9gVui7x6Y03XEUiAiwSoMp24sM7whiVSza5pEd/pm0xVvRV7hcqnphG1D/R7gtwJir1Xt X-Received: by 2002:a17:907:a064:b0:711:c819:3cbf with SMTP id ia4-20020a170907a06400b00711c8193cbfmr21205940ejc.460.1654770635578; Thu, 09 Jun 2022 03:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654770635; cv=none; d=google.com; s=arc-20160816; b=T8tf0cV7ASMoM6QQ7JQ54gRBoQV8RRZy3Z1ZLIIk/8xWffzfdbZ0/qAH26PClVCFFO eaQYOrjG8OomZjIXaHFYhJmyiFZOYsXo9OxUt8I/h+Sd3WG2oPNb0Lefgb4b3zQzi1he cLg8xOxcecEKDcPGWJFH0XuMmxer2Sazg12VnSP2shm3B+aPupV3geFBVHJeRrztQ2p0 PC3r8e3I1Gt8Pbgqp4eFFR8KFFuBrfiNMqNFg/lpAvnyAe1inNK1WnszwBcM/+GQF7+x W0xkTaQTiWG9r58llGnW63IpwLBSQO4drmHTvAqOTjHBghNDsSGsWTHUjEnjpYL7DbQa +03g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=aXU+E7dv6U775LqIszy5BNOT/RT3w3ghWOLh5lJ2Meg=; b=c9J7FSQXuWLlG5Wj3ndLHDg3PcaXskP1J5l3DYTE0DUWYZCiIbVXcZzp4PPKkFR7uK qsC5CNfR8fe6DVwj14fWiILbh1aiQypWnvu5XvrBCGeA4vQgHUAyPJHOZX1SsE/UIHf2 fk1pw+Zuh1vkfhqfV91IjfmWCdQELoI+n/TXOyCSO53Z5YCxzuO62HjfaC+D3rpWF8G/ 3LNFOejG0dkha3nilRi5ZiiCwwuQBaElna9nItKNv7FzKtcR83ioIByt0YrLmHe7QXv6 SLp8xryvKY26pLq0tptSowJIrmufHHKUaBS+rb+3fzj5zGxzlaGDAt9g++Pf/7GzI3Ha kgYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t25-20020a508d59000000b0042df4f8c103si1563415edt.472.2022.06.09.03.30.08; Thu, 09 Jun 2022 03:30:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239635AbiFIKRZ (ORCPT + 99 others); Thu, 9 Jun 2022 06:17:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232788AbiFIKRU (ORCPT ); Thu, 9 Jun 2022 06:17:20 -0400 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C67ABB1D for ; Thu, 9 Jun 2022 03:17:19 -0700 (PDT) Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4LJg4p0fyjz9tJB; Thu, 9 Jun 2022 12:17:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CwCJpVoUbHxB; Thu, 9 Jun 2022 12:17:14 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4LJg4n1zxpz9tJF; Thu, 9 Jun 2022 12:17:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 334D88B779; Thu, 9 Jun 2022 12:17:13 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id yeryjKyfAtDF; Thu, 9 Jun 2022 12:17:13 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.6.129]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D58CA8B77D; Thu, 9 Jun 2022 12:17:12 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 259AH37n133866 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 9 Jun 2022 12:17:03 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 259AH0PB133864; Thu, 9 Jun 2022 12:17:00 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 1/3] powerpc/irq: Make __do_irq() static Date: Thu, 9 Jun 2022 12:16:40 +0200 Message-Id: X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1654769796; l=2894; s=20211009; h=from:subject:message-id; bh=D/YnwbpsLRuA5tJYiZC5RVaVHXgdTEiVTKEkUJ95FSE=; b=Qaamowtk+TMggMfh9IooX3NDV7HcTwS5pRTBwM545kHOyAZIfRv/2JfrVcBW0Q0rQk6Eg6D69om/ KWZy4d24C/wDwabcvEioa17SkELs5MmrwFwMcMgUbPCZpTJ7hv5N X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 48cf12d88969 ("powerpc/irq: Inline call_do_irq() and call_do_softirq()"), __do_irq() is not used outside irq.c Reorder functions and make __do_irq() static and drop the declaration in irq.h. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/irq.h | 1 - arch/powerpc/kernel/irq.c | 46 +++++++++++++++++----------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h index 13f0409dd617..5c1516a5ba8f 100644 --- a/arch/powerpc/include/asm/irq.h +++ b/arch/powerpc/include/asm/irq.h @@ -54,7 +54,6 @@ extern void *softirq_ctx[NR_CPUS]; void __do_IRQ(struct pt_regs *regs); extern void __init init_IRQ(void); -extern void __do_irq(struct pt_regs *regs); int irq_choose_cpu(const struct cpumask *mask); diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 873e6dffb868..370434f6c316 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -219,31 +219,9 @@ static __always_inline void call_do_softirq(const void *sp) ); } -static __always_inline void call_do_irq(struct pt_regs *regs, void *sp) -{ - register unsigned long r3 asm("r3") = (unsigned long)regs; - - /* Temporarily switch r1 to sp, call __do_irq() then restore r1. */ - asm volatile ( - PPC_STLU " %%r1, %[offset](%[sp]) ;" - "mr %%r1, %[sp] ;" - "bl %[callee] ;" - PPC_LL " %%r1, 0(%%r1) ;" - : // Outputs - "+r" (r3) - : // Inputs - [sp] "b" (sp), [offset] "i" (THREAD_SIZE - STACK_FRAME_OVERHEAD), - [callee] "i" (__do_irq) - : // Clobbers - "lr", "xer", "ctr", "memory", "cr0", "cr1", "cr5", "cr6", - "cr7", "r0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", - "r11", "r12" - ); -} - DEFINE_STATIC_CALL_RET0(ppc_get_irq, *ppc_md.get_irq); -void __do_irq(struct pt_regs *regs) +static void __do_irq(struct pt_regs *regs) { unsigned int irq; @@ -269,6 +247,28 @@ void __do_irq(struct pt_regs *regs) trace_irq_exit(regs); } +static __always_inline void call_do_irq(struct pt_regs *regs, void *sp) +{ + register unsigned long r3 asm("r3") = (unsigned long)regs; + + /* Temporarily switch r1 to sp, call __do_irq() then restore r1. */ + asm volatile ( + PPC_STLU " %%r1, %[offset](%[sp]) ;" + "mr %%r1, %[sp] ;" + "bl %[callee] ;" + PPC_LL " %%r1, 0(%%r1) ;" + : // Outputs + "+r" (r3) + : // Inputs + [sp] "b" (sp), [offset] "i" (THREAD_SIZE - STACK_FRAME_OVERHEAD), + [callee] "i" (__do_irq) + : // Clobbers + "lr", "xer", "ctr", "memory", "cr0", "cr1", "cr5", "cr6", + "cr7", "r0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", + "r11", "r12" + ); +} + void __do_IRQ(struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); -- 2.35.3