From: Yipeng Zou <zouyipeng@huawei.com>
To: <x86@kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linux-csky@vger.kernel.org>,
<linux-riscv@lists.infradead.org>,
<linux-perf-users@vger.kernel.org>, <linux-s390@vger.kernel.org>,
<guoren@kernel.org>, <paul.walmsley@sifive.com>,
<palmer@dabbelt.com>, <hca@linux.ibm.com>, <gor@linux.ibm.com>,
<borntraeger@linux.ibm.com>, <dave.hansen@linux.intel.com>,
<hpa@zytor.com>, <naveen.n.rao@linux.ibm.com>,
<anil.s.keshavamurthy@intel.com>, <mhiramat@kernel.org>,
<namit@vmware.com>, <catalin.marinas@arm.com>,
<peterz@infradead.org>, <mark.rutland@arm.com>
Cc: <liaochang1@huawei.com>, <chris.zjh@huawei.com>, <zouyipeng@huawei.com>
Subject: [PATCH 1/2] kprobes: make arch_init_kprobes as weak
Date: Sat, 17 Sep 2022 09:55:21 +0800 [thread overview]
Message-ID: <20220917015522.44583-2-zouyipeng@huawei.com> (raw)
In-Reply-To: <20220917015522.44583-1-zouyipeng@huawei.com>
The function implementation under some arch does nothing.
We can mark it with weak attributes to improve.
Signed-off-by: Yipeng Zou <zouyipeng@huawei.com>
---
arch/csky/kernel/probes/kprobes.c | 5 -----
arch/riscv/kernel/probes/kprobes.c | 5 -----
arch/s390/kernel/kprobes.c | 5 -----
arch/x86/kernel/kprobes/core.c | 5 -----
kernel/kprobes.c | 5 +++++
5 files changed, 5 insertions(+), 20 deletions(-)
diff --git a/arch/csky/kernel/probes/kprobes.c b/arch/csky/kernel/probes/kprobes.c
index 3c6e5c725d81..d31b6ab5cea0 100644
--- a/arch/csky/kernel/probes/kprobes.c
+++ b/arch/csky/kernel/probes/kprobes.c
@@ -405,8 +405,3 @@ int __kprobes arch_trampoline_kprobe(struct kprobe *p)
{
return 0;
}
-
-int __init arch_init_kprobes(void)
-{
- return 0;
-}
diff --git a/arch/riscv/kernel/probes/kprobes.c b/arch/riscv/kernel/probes/kprobes.c
index e6e950b7cf32..d4577108e5c9 100644
--- a/arch/riscv/kernel/probes/kprobes.c
+++ b/arch/riscv/kernel/probes/kprobes.c
@@ -362,8 +362,3 @@ int __kprobes arch_trampoline_kprobe(struct kprobe *p)
{
return 0;
}
-
-int __init arch_init_kprobes(void)
-{
- return 0;
-}
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 0032bdbe8e3f..aaf9329a7cf4 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -544,11 +544,6 @@ int kprobe_exceptions_notify(struct notifier_block *self,
}
NOKPROBE_SYMBOL(kprobe_exceptions_notify);
-int __init arch_init_kprobes(void)
-{
- return 0;
-}
-
int arch_trampoline_kprobe(struct kprobe *p)
{
return 0;
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 4c3c27b6aea3..e26b336f8b18 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -1055,11 +1055,6 @@ int __init arch_populate_kprobe_blacklist(void)
(unsigned long)__entry_text_end);
}
-int __init arch_init_kprobes(void)
-{
- return 0;
-}
-
int arch_trampoline_kprobe(struct kprobe *p)
{
return 0;
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index ca9d834d0b84..23f6d329b53b 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -2684,6 +2684,11 @@ void kprobe_free_init_mem(void)
mutex_unlock(&kprobe_mutex);
}
+int __init __weak arch_init_kprobes(void)
+{
+ return 0;
+}
+
static int __init init_kprobes(void)
{
int i, err = 0;
--
2.17.1
next prev parent reply other threads:[~2022-09-17 1:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-17 1:55 [PATCH 0/2] make weak attributes in {k,u}probes Yipeng Zou
2022-09-17 1:55 ` Yipeng Zou [this message]
2022-09-17 1:55 ` [PATCH 2/2] uprobes: make arch_uprobe_exception_notify as weak Yipeng Zou
2022-09-17 10:58 ` [PATCH 0/2] make weak attributes in {k,u}probes Guo Ren
2022-09-20 17:02 ` Naveen N. Rao
2022-09-21 8:25 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220917015522.44583-2-zouyipeng@huawei.com \
--to=zouyipeng@huawei.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=borntraeger@linux.ibm.com \
--cc=catalin.marinas@arm.com \
--cc=chris.zjh@huawei.com \
--cc=dave.hansen@linux.intel.com \
--cc=gor@linux.ibm.com \
--cc=guoren@kernel.org \
--cc=hca@linux.ibm.com \
--cc=hpa@zytor.com \
--cc=liaochang1@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=namit@vmware.com \
--cc=naveen.n.rao@linux.ibm.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).