public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Punit Agrawal <punitagrawal@gmail.com>
To: mhiramat@kernel.org, naveen.n.rao@linux.ibm.com,
	anil.s.keshavamurthy@intel.com, davem@davemloft.net
Cc: Punit Agrawal <punitagrawal@gmail.com>,
	linux-kernel@vger.kernel.org, guoren@kernel.org,
	linux-csky@vger.kernel.org
Subject: [RFC PATCH 5/5] kprobes: Make arch_check_ftrace_location static
Date: Wed,  9 Jun 2021 19:50:19 +0900	[thread overview]
Message-ID: <20210609105019.3626677-6-punitagrawal@gmail.com> (raw)
In-Reply-To: <20210609105019.3626677-1-punitagrawal@gmail.com>

arch_check_ftrace_location() was introduced as a weak function in
f7f242ff0044 ("kprobes: introduce weak arch_check_ftrace_location()
helper function") to allow architectures to handle kprobes call site
on their own.

Recently, the only architecture (csky) to implement
arch_check_ftrace_location() was migrated to using the common
version.

As a result, further cleanup the code to drop the weak attribute and
rename the function to remove the architecture specific
implementation.

Signed-off-by: Punit Agrawal <punitagrawal@gmail.com>
---
 include/linux/kprobes.h | 2 --
 kernel/kprobes.c        | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 771013bab18a..beea9ecee187 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -369,8 +369,6 @@ static inline int arch_prepare_kprobe_ftrace(struct kprobe *p)
 }
 #endif
 
-int arch_check_ftrace_location(struct kprobe *p);
-
 /* Get the kprobe at this addr (if any) - called with preemption disabled */
 struct kprobe *get_kprobe(void *addr);
 
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 54d37d4ab897..b12ae6cc8dc3 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1531,7 +1531,7 @@ static inline int warn_kprobe_rereg(struct kprobe *p)
 	return ret;
 }
 
-int __weak arch_check_ftrace_location(struct kprobe *p)
+static int check_ftrace_location(struct kprobe *p)
 {
 	unsigned long ftrace_addr;
 
@@ -1554,7 +1554,7 @@ static int check_kprobe_address_safe(struct kprobe *p,
 {
 	int ret;
 
-	ret = arch_check_ftrace_location(p);
+	ret = check_ftrace_location(p);
 	if (ret)
 		return ret;
 	jump_label_lock();
-- 
2.30.2


  parent reply	other threads:[~2021-06-09 10:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 10:50 [PATCH 0/5] kprobes: Bugfix and improvements Punit Agrawal
2021-06-09 10:50 ` [PATCH 1/5] kprobes: Do not use local variable when creating debugfs file Punit Agrawal
2021-06-09 14:35   ` Masami Hiramatsu
2021-06-10 23:31     ` Punit Agrawal
2021-06-09 10:50 ` [RFC PATCH 2/5] kprobes: Use helper to parse boolean input from userspace Punit Agrawal
2021-06-09 14:37   ` Masami Hiramatsu
2021-06-09 10:50 ` [RFC PATCH 3/5] kprobe: Simplify prepare_kprobe() by dropping redundant version Punit Agrawal
2021-06-09 14:42   ` Masami Hiramatsu
2021-06-09 10:50 ` [RFC PATCH 4/5] csky: ftrace: Drop duplicate implementation of arch_check_ftrace_location() Punit Agrawal
2021-06-09 12:33   ` Guo Ren
2021-06-09 14:29     ` Masami Hiramatsu
2021-06-09 15:47       ` Guo Ren
2021-06-10  0:07   ` Masami Hiramatsu
2021-06-09 10:50 ` Punit Agrawal [this message]
2021-06-10  0:37   ` [RFC PATCH 5/5] kprobes: Make arch_check_ftrace_location static Masami Hiramatsu

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=20210609105019.3626677-6-punitagrawal@gmail.com \
    --to=punitagrawal@gmail.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=davem@davemloft.net \
    --cc=guoren@kernel.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=naveen.n.rao@linux.ibm.com \
    /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