Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3150644pxb; Mon, 6 Sep 2021 13:41:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkgzjtRgOY6uhI6/q6rExFQYP8yIMsLGRbwic953GVrqBDEDvJ2+AvyYD0/Y7A9vmla52H X-Received: by 2002:a92:4406:: with SMTP id r6mr9200656ila.88.1630960910467; Mon, 06 Sep 2021 13:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630960910; cv=none; d=google.com; s=arc-20160816; b=Yr8N9j0RbwOa4DcusGTfGG2JmnfXWRKPX9ZALFYXwG3qEplZNVx0a4chesEzyxgS4d 27T583hJO0819zFVvjuu7Q1Xo2MFmt1OtCGc+VoPVwk+xwkygm/h6n/NibiagXaBE1h+ tfqlGzEDibL5R/wEt/eAy50elLICnRVIlI2XSR6wlJ5h6DGUAlMhlsTlxeFAm7AoCpPd OCYZa/FhTULWrjwtPi/xoEaw0PkQKOoWOYR8OSKvIoauCVPMZppBTD/wcxbeRzcVtneT fFt4MvI2V/qBbrvDZldGNxnQvNLlUL85cyq+j0BJLNHgVQ/OU8ARzLZn/muQbI6tDVCV EFCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=edFlo/yYxzw4aF0TVXLvwrMEvaNIJ0dixY1NBGP/pXE=; b=IRnzvgiJygKvOPoyWOsDjLoYNhgtD8DJIcZherI/O4IxODKwIm2iGolGkbftKqFB+T Cyll6rx5qZCOT9ZIRaR+lbefcaAIHNz8ALYU0TadUNACOpuIMPirgW9Rc3WggOAoQVI3 RalErEjy/dwS5AQ3cnAxcKhrEQLs+d6ktLNyK+Fkzkg7ayEEjVfNBPASyv2+H/8BODz0 uoPa2OIvS1MX8UWXGTSP672EbU+nOnjzSN66MQEmADbkkQXcEAMmaPByn48tp3KlFTUd jTbGEwWDr8xxcTmIejBy3Aro7y505whFoP/HQbeQCmlci3t9nEm9zmB1t5T91FHxFRMZ 0nSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=jgFg06yM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si10355994ilu.111.2021.09.06.13.41.26; Mon, 06 Sep 2021 13:41:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=jgFg06yM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231540AbhIFUl1 (ORCPT + 99 others); Mon, 6 Sep 2021 16:41:27 -0400 Received: from mout.gmx.net ([212.227.17.22]:57449 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbhIFUl0 (ORCPT ); Mon, 6 Sep 2021 16:41:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630960702; bh=WevteChaVTuIJ4vpbr4/S6Dy5gJM391zvvJnoNTQzeQ=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=jgFg06yM+iwybYFpbzzkJmZm/SCTiZitHSZTAJ9C5NX2kLKqYS0y0KP2FTserSuxh Eqwm30wHapagCvLCe+sfLUcjybTUJKUWLlL4N6xw1YMdd7tlspbfrymTlU7+4q3gkF PE/NY5aL+n60GN8BN0jWsYWdG0hg52z5OmxZ4RNo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.85.61] ([80.187.112.14]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MKbkC-1mfxez3TOW-00KvzB; Mon, 06 Sep 2021 22:38:22 +0200 Subject: Re: [PATCH v2] ftrace: Cleanup ftrace_dyn_arch_init() To: Weizhao Ouyang , Steven Rostedt , Ingo Molnar Cc: Russell King , Catalin Marinas , Will Deacon , Guo Ren , Michal Simek , Thomas Bogendoerfer , Nick Hu , Greentime Hu , Vincent Chen , "James E.J. Bottomley" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Yoshinori Sato , Rich Felker , "David S. Miller" , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org References: <20210906111626.1259867-1-o451686892@gmail.com> From: Helge Deller Message-ID: Date: Mon, 6 Sep 2021 22:36:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210906111626.1259867-1-o451686892@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:r/JUrRhbvOicWGkiqogKRwFTRO8+bXkMsWJ6ArSDb2+yOaZh1Qh itUnWpVNjQZtukajCgk+9dVW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TsmdMuCDwAB Z4qWUzHaETcq5zJPgtCKjptx9/07i1enT+zaXoFenEP/ien6VfMOu818AJVG7zgPCAChvvhO/ 3B7OkK469cs9rUvkqUjzWgdjs42P6wWz8HKmOG4h7fA+dUruy2tipPUOLvzSyWMTmrHl5yG1S Vz4p4FrS45Wlm0zmdLqj3BlCIo4KZXsI5jJ3aFUoi1GkRY1W4IkespQ7JpG/CToEyVNoNNBxX 8ju98M7ZjSeuEU554usU2/WnmGPp2u1TmeW6vjq1Qo+ZBY9J3/8cNFhLw== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/6/21 1:16 PM, Weizhao Ouyang wrote: > Most of ARCHs use empty ftrace_dyn_arch_init(), introduce a weak common > ftrace_dyn_arch_init() to cleanup them. > > Signed-off-by: Weizhao Ouyang > Acked-by: Heiko Carstens (s390) Acked-by: Helge Deller # parisc Thanks, Helge > --- > > Changes in v2: > -- correct CONFIG_DYNAMIC_FTRACE on PowerPC > -- add Acked-by tag > > --- > arch/arm/kernel/ftrace.c | 5 ----- > arch/arm64/kernel/ftrace.c | 5 ----- > arch/csky/kernel/ftrace.c | 5 ----- > arch/ia64/kernel/ftrace.c | 6 ------ > arch/microblaze/kernel/ftrace.c | 5 ----- > arch/mips/include/asm/ftrace.h | 2 ++ > arch/nds32/kernel/ftrace.c | 5 ----- > arch/parisc/kernel/ftrace.c | 5 ----- > arch/powerpc/include/asm/ftrace.h | 4 ++++ > arch/riscv/kernel/ftrace.c | 5 ----- > arch/s390/kernel/ftrace.c | 5 ----- > arch/sh/kernel/ftrace.c | 5 ----- > arch/sparc/kernel/ftrace.c | 5 ----- > arch/x86/kernel/ftrace.c | 5 ----- > include/linux/ftrace.h | 1 - > kernel/trace/ftrace.c | 5 +++++ > 16 files changed, 11 insertions(+), 62 deletions(-) > > diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c > index 3c83b5d29697..a006585e1c09 100644 > --- a/arch/arm/kernel/ftrace.c > +++ b/arch/arm/kernel/ftrace.c > @@ -193,11 +193,6 @@ int ftrace_make_nop(struct module *mod, > > return ret; > } > - > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > #endif /* CONFIG_DYNAMIC_FTRACE */ > > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c > index 7f467bd9db7a..fc62dfe73f93 100644 > --- a/arch/arm64/kernel/ftrace.c > +++ b/arch/arm64/kernel/ftrace.c > @@ -236,11 +236,6 @@ void arch_ftrace_update_code(int command) > command |=3D FTRACE_MAY_SLEEP; > ftrace_modify_all_code(command); > } > - > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > #endif /* CONFIG_DYNAMIC_FTRACE */ > > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > diff --git a/arch/csky/kernel/ftrace.c b/arch/csky/kernel/ftrace.c > index b4a7ec1517ff..50bfcf129078 100644 > --- a/arch/csky/kernel/ftrace.c > +++ b/arch/csky/kernel/ftrace.c > @@ -133,11 +133,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func) > (unsigned long)func, true, true); > return ret; > } > - > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > #endif /* CONFIG_DYNAMIC_FTRACE */ > > #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > diff --git a/arch/ia64/kernel/ftrace.c b/arch/ia64/kernel/ftrace.c > index b2ab2d58fb30..d6360fd404ab 100644 > --- a/arch/ia64/kernel/ftrace.c > +++ b/arch/ia64/kernel/ftrace.c > @@ -194,9 +194,3 @@ int ftrace_update_ftrace_func(ftrace_func_t func) > flush_icache_range(addr, addr + 16); > return 0; > } > - > -/* run from kstop_machine */ > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > diff --git a/arch/microblaze/kernel/ftrace.c b/arch/microblaze/kernel/ft= race.c > index 224eea40e1ee..188749d62709 100644 > --- a/arch/microblaze/kernel/ftrace.c > +++ b/arch/microblaze/kernel/ftrace.c > @@ -163,11 +163,6 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsign= ed long addr) > return ret; > } > > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > - > int ftrace_update_ftrace_func(ftrace_func_t func) > { > unsigned long ip =3D (unsigned long)(&ftrace_call); > diff --git a/arch/mips/include/asm/ftrace.h b/arch/mips/include/asm/ftra= ce.h > index b463f2aa5a61..ed013e767390 100644 > --- a/arch/mips/include/asm/ftrace.h > +++ b/arch/mips/include/asm/ftrace.h > @@ -76,6 +76,8 @@ do { \ > > > #ifdef CONFIG_DYNAMIC_FTRACE > +int __init ftrace_dyn_arch_init(void); > + > static inline unsigned long ftrace_call_adjust(unsigned long addr) > { > return addr; > diff --git a/arch/nds32/kernel/ftrace.c b/arch/nds32/kernel/ftrace.c > index 0e23e3a8df6b..f0ef4842d191 100644 > --- a/arch/nds32/kernel/ftrace.c > +++ b/arch/nds32/kernel/ftrace.c > @@ -84,11 +84,6 @@ void _ftrace_caller(unsigned long parent_ip) > /* restore all state needed by the compiler epilogue */ > } > > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > - > static unsigned long gen_sethi_insn(unsigned long addr) > { > unsigned long opcode =3D 0x46000000; > diff --git a/arch/parisc/kernel/ftrace.c b/arch/parisc/kernel/ftrace.c > index 0a1e75af5382..01581f715737 100644 > --- a/arch/parisc/kernel/ftrace.c > +++ b/arch/parisc/kernel/ftrace.c > @@ -94,11 +94,6 @@ int ftrace_disable_ftrace_graph_caller(void) > #endif > > #ifdef CONFIG_DYNAMIC_FTRACE > - > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > int ftrace_update_ftrace_func(ftrace_func_t func) > { > return 0; > diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/as= m/ftrace.h > index debe8c4f7062..d59f67c0225f 100644 > --- a/arch/powerpc/include/asm/ftrace.h > +++ b/arch/powerpc/include/asm/ftrace.h > @@ -61,6 +61,10 @@ struct dyn_arch_ftrace { > }; > #endif /* __ASSEMBLY__ */ > > +#ifdef CONFIG_DYNAMIC_FTRACE > +int __init ftrace_dyn_arch_init(void); > +#endif /* CONFIG_DYNAMIC_FTRACE */ > + > #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > #define ARCH_SUPPORTS_FTRACE_OPS 1 > #endif > diff --git a/arch/riscv/kernel/ftrace.c b/arch/riscv/kernel/ftrace.c > index 7f1e5203de88..4716f4cdc038 100644 > --- a/arch/riscv/kernel/ftrace.c > +++ b/arch/riscv/kernel/ftrace.c > @@ -154,11 +154,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func) > > return ret; > } > - > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > #endif > > #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c > index 0a464d328467..3fd80397ff52 100644 > --- a/arch/s390/kernel/ftrace.c > +++ b/arch/s390/kernel/ftrace.c > @@ -262,11 +262,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func) > return 0; > } > > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > - > void arch_ftrace_update_code(int command) > { > if (ftrace_shared_hotpatch_trampoline(NULL)) > diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c > index 295c43315bbe..930001bb8c6a 100644 > --- a/arch/sh/kernel/ftrace.c > +++ b/arch/sh/kernel/ftrace.c > @@ -252,11 +252,6 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsign= ed long addr) > > return ftrace_modify_code(rec->ip, old, new); > } > - > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > #endif /* CONFIG_DYNAMIC_FTRACE */ > > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > diff --git a/arch/sparc/kernel/ftrace.c b/arch/sparc/kernel/ftrace.c > index 684b84ce397f..eaead3da8e03 100644 > --- a/arch/sparc/kernel/ftrace.c > +++ b/arch/sparc/kernel/ftrace.c > @@ -82,11 +82,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func) > new =3D ftrace_call_replace(ip, (unsigned long)func); > return ftrace_modify_code(ip, old, new); > } > - > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > #endif > > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c > index 1b3ce3b4a2a2..23d221a9a3cd 100644 > --- a/arch/x86/kernel/ftrace.c > +++ b/arch/x86/kernel/ftrace.c > @@ -252,11 +252,6 @@ void arch_ftrace_update_code(int command) > ftrace_modify_all_code(command); > } > > -int __init ftrace_dyn_arch_init(void) > -{ > - return 0; > -} > - > /* Currently only x86_64 supports dynamic trampolines */ > #ifdef CONFIG_X86_64 > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > index 832e65f06754..f1eca123d89d 100644 > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -573,7 +573,6 @@ ftrace_set_early_filter(struct ftrace_ops *ops, char= *buf, int enable); > > /* defined in arch */ > extern int ftrace_ip_converted(unsigned long ip); > -extern int ftrace_dyn_arch_init(void); > extern void ftrace_replace_code(int enable); > extern int ftrace_update_ftrace_func(ftrace_func_t func); > extern void ftrace_caller(void); > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index 7efbc8aaf7f6..4c090323198d 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -6846,6 +6846,11 @@ void __init ftrace_free_init_mem(void) > ftrace_free_mem(NULL, start, end); > } > > +int __init __weak ftrace_dyn_arch_init(void) > +{ > + return 0; > +} > + > void __init ftrace_init(void) > { > extern unsigned long __start_mcount_loc[]; >