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 X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C7CBC433E2 for ; Mon, 14 Sep 2020 17:20:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19B1D217BA for ; Mon, 14 Sep 2020 17:20:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="yyMWsr4x"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="odOS1JxO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726166AbgINRUH (ORCPT ); Mon, 14 Sep 2020 13:20:07 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:34804 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725967AbgINRQ0 (ORCPT ); Mon, 14 Sep 2020 13:16:26 -0400 Date: Mon, 14 Sep 2020 17:16:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1600103773; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t/BVLfPodmkKSyyuqcU0WOv7FRo4wNdBeEErB837QcI=; b=yyMWsr4xAm0h6Ba7JQ5cxUaAmPI0YK7Z4IbBn9pSrqMoOycq7YQaSq1X11PzKkgwii8gRR jJCFt40+fS+pG+xmXCun4EG2aQV+2UDD52LYA2j3tKrUzO7wPl5K+oM9ondnEmySR59/yL ZWt4JR4fm5dvzmraujRFr3LNfSrIF35ryOJ4am0DqNlfzMAsA/y4AvcvoJmtkAIlj5uZ1b QBc8eLy6xwrMNhEoLr2IyedLTs2YrIFyTRrHeeIMkzjgTJOywgeVYUMw529Ht4OgCJpkyF BEUYAES1y/2rqE7FPPsVsVvhVcgbkUqDC6wTtPwxNueEH2TECqaGadbRxYmE4g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1600103773; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t/BVLfPodmkKSyyuqcU0WOv7FRo4wNdBeEErB837QcI=; b=odOS1JxO/nM7ZUYX78wwc892T08dHfLB90upjJw/SORqHEqvymswHtzUyz8LAuuSOaC59D 6ddQKDtcGfxERTDA== From: "tip-bot2 for Masami Hiramatsu" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/kprobes] kprobes: Make local functions static Cc: Masami Hiramatsu , Ingo Molnar , x86 , LKML In-Reply-To: <159870618256.1229682.8692046612635810882.stgit@devnote2> References: <159870618256.1229682.8692046612635810882.stgit@devnote2> MIME-Version: 1.0 Message-ID: <160010377297.15536.8276526796144935467.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/kprobes branch of tip: Commit-ID: 319f0ce284fff8e4f95167cb144acc905d0584c7 Gitweb: https://git.kernel.org/tip/319f0ce284fff8e4f95167cb144acc905d0584c7 Author: Masami Hiramatsu AuthorDate: Sat, 29 Aug 2020 22:03:02 +09:00 Committer: Ingo Molnar CommitterDate: Tue, 08 Sep 2020 11:52:42 +02:00 kprobes: Make local functions static Since we unified the kretprobe trampoline handler from arch/* code, some functions and objects do not need to be exported anymore. Signed-off-by: Masami Hiramatsu Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/159870618256.1229682.8692046612635810882.stgit@devnote2 --- include/linux/kprobes.h | 15 --------------- kernel/kprobes.c | 9 ++++----- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 3389067..5c8c271 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h @@ -190,7 +190,6 @@ static inline int kprobes_built_in(void) return 1; } -extern struct kprobe kprobe_busy; extern void kprobe_busy_begin(void); extern void kprobe_busy_end(void); @@ -235,16 +234,6 @@ static inline int arch_trampoline_kprobe(struct kprobe *p) extern struct kretprobe_blackpoint kretprobe_blacklist[]; -static inline void kretprobe_assert(struct kretprobe_instance *ri, - unsigned long orig_ret_address, unsigned long trampoline_address) -{ - if (!orig_ret_address || (orig_ret_address == trampoline_address)) { - printk("kretprobe BUG!: Processing kretprobe %p @ %p\n", - ri->rp, ri->rp->kp.addr); - BUG(); - } -} - #ifdef CONFIG_KPROBES_SANITY_TEST extern int init_test_probes(void); #else @@ -364,10 +353,6 @@ 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); -void kretprobe_hash_lock(struct task_struct *tsk, - struct hlist_head **head, unsigned long *flags); -void kretprobe_hash_unlock(struct task_struct *tsk, unsigned long *flags); -struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); /* kprobe_running() will just return the current_kprobe on this CPU */ static inline struct kprobe *kprobe_running(void) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 0676868..732a701 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -1239,7 +1239,7 @@ static void recycle_rp_inst(struct kretprobe_instance *ri) } NOKPROBE_SYMBOL(recycle_rp_inst); -void kretprobe_hash_lock(struct task_struct *tsk, +static void kretprobe_hash_lock(struct task_struct *tsk, struct hlist_head **head, unsigned long *flags) __acquires(hlist_lock) { @@ -1261,7 +1261,7 @@ __acquires(hlist_lock) } NOKPROBE_SYMBOL(kretprobe_table_lock); -void kretprobe_hash_unlock(struct task_struct *tsk, +static void kretprobe_hash_unlock(struct task_struct *tsk, unsigned long *flags) __releases(hlist_lock) { @@ -1282,7 +1282,7 @@ __releases(hlist_lock) } NOKPROBE_SYMBOL(kretprobe_table_unlock); -struct kprobe kprobe_busy = { +static struct kprobe kprobe_busy = { .addr = (void *) get_kprobe, }; @@ -1983,8 +1983,7 @@ unsigned long __kretprobe_trampoline_handler(struct pt_regs *regs, break; } - kretprobe_assert(ri, (unsigned long)correct_ret_addr, - (unsigned long)trampoline_address); + BUG_ON(!correct_ret_addr || (correct_ret_addr == trampoline_address)); last = ri; hlist_for_each_entry_safe(ri, tmp, head, hlist) {