Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2330271pxk; Mon, 14 Sep 2020 10:22:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX/06xTCTzhjsTo0mhjTvaeS9dsuGf6y1W7mCo8CBaSxmvEihtB6W5U0wYsDK/wRJK9Hzy X-Received: by 2002:aa7:d34b:: with SMTP id m11mr18530816edr.178.1600104148058; Mon, 14 Sep 2020 10:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600104148; cv=none; d=google.com; s=arc-20160816; b=D00ZIvhVqvHs/ZXm2vpBOdye92jN5X2kvg2ELohIILe/UodJMAwkJ58MHa+RSNc5Y4 OvWxLByIxMEnQ+i8TTV6QxOn38pndLIH7eUXbU3Hz52EqcnG5qkGynFFNZPjJ5UZN6cP apoqeckzhmV1RWonIaGFLUBtxOvtUtZJ56FcY6Fg4MiqcnvN/VOmN449Bd6L1yhSyWlU yBoi6VJZxnDSOR+g8LjuqEM5mhhPuQFTilxBgeXqhD86HhT4hEJanBclcb36DoU8gigu UAQYFzVF/5723aiWAZStVNWXcMPsuatM2S7gx98aZ7SGZAxxV9qh1nWWeeCpf1Ds4fDI WHRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:dkim-signature :dkim-signature:date; bh=t/BVLfPodmkKSyyuqcU0WOv7FRo4wNdBeEErB837QcI=; b=iO1JLymStRbTttofo+xtWtteDRVbtdBDfRQ0Kzfb2UATRgW6aCKjRFEcSdnQVWTStY i6YZeGoWvz84pJ6DdLR9nBnvt2gWKEWsVF2lrqUeagjsw8BcwJbHhRB2ImgLJjINSbI+ 8rUi2hnYx0mmGFczUJCfP2QI31lErLBA/wBNajKQZ6f2P7rtVqcQ0ODT2SdlO3KhiuN9 fuXmn4K+10qCAYypj19cQK4gbmAs8niJmZItCA7koZ4kh0p8pxDEaxxSylmDc51KcptL GkDXXOSQOeZMZtqnukNbvd1aeZiDGT0KAiBujIBo12Jyz/xmAdZc9A85K6rxSH9H0le8 iF2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=yyMWsr4x; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e header.b=odOS1JxO; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si7445275ejy.70.2020.09.14.10.22.04; Mon, 14 Sep 2020 10:22:28 -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=fail header.i=@linutronix.de header.s=2020 header.b=yyMWsr4x; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e header.b=odOS1JxO; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726370AbgINRUE (ORCPT + 99 others); Mon, 14 Sep 2020 13:20:04 -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) {