Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5206817pxj; Wed, 9 Jun 2021 11:41:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrMLMhHUzWmuiSkIE7fyFwu9wNTVfX7mmSunrWzfwrOmVuAkHHo/GMRyQ7sI0yLKAMvvmM X-Received: by 2002:a17:906:3485:: with SMTP id g5mr1152090ejb.174.1623264069861; Wed, 09 Jun 2021 11:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623264069; cv=none; d=google.com; s=arc-20160816; b=kQWGWJTMeo54ZVYlOlfQyl32atX4y2tIy40GsSQeA03r19j5Q+QcIOf0J9nb2HFEsi NEjsY+K7qSpNL/I+JOKny6Uq9D52SJeXQz5kKmB902mQs5T1QoGxGkdXTnNxqzMJaEVk hzbuf8t8hz6oB9J9HTadti//nDPv9jC4ul9Zp88eoYlalIJnzJ85E6gbXIh2D4FSOD9/ 7v7kxi8IWyzmBAxVdRFKpzf00IJ0kMkXKTlUi/GxRHSfSOhVJHa0st3Az7422Q4sDWvL CjZQjhxQuSTHUAycBI+EQ1veSkSbmBGjRjfsfj+qFJrRELQQg+HmOrEfzDOh/PK5y9Ka PyDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pEYcVeyNoKzSNbvy4jy8pfVSwm3ir1DHFnmbQ76O6EA=; b=pzTG8XTtuD0JSTBNTw/xf7qx2Bj4NeyWKvWLyqNckAWcE3/cQxP7kb0Npag2sASWFO Jy0RE+xE4oVEUxtVTWQ7/JqtAlk5vNZCiDXTPyVs9TwA3Xea6nBrXisoxbzX9zrhcvyb eKB+pIisclBssFzVjjLQjRYEkjN1tHufTGz90LRn28aFxdvMu1Vwldg/H87CNWMdQJnl Ofg1zYTQ2NIzyWfE6mTM5iUBhyExJZWdhLmc+QLNeZlr83Q9bV9s/MR0JZGbVxut/u1O 9iElW27sXLkGYjR8qiHuUCxljaWL9dtfky/Tk9KtLkF3hvTv6+lUC2IKFgCotE9TyFUH kegg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JTMsnpWb; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si398854edw.110.2021.06.09.11.40.46; Wed, 09 Jun 2021 11:41:09 -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=@gmail.com header.s=20161025 header.b=JTMsnpWb; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238465AbhFIKyb (ORCPT + 99 others); Wed, 9 Jun 2021 06:54:31 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:46802 "EHLO mail-pf1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237274AbhFIKyL (ORCPT ); Wed, 9 Jun 2021 06:54:11 -0400 Received: by mail-pf1-f180.google.com with SMTP id u126so14113791pfu.13; Wed, 09 Jun 2021 03:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pEYcVeyNoKzSNbvy4jy8pfVSwm3ir1DHFnmbQ76O6EA=; b=JTMsnpWbvjyyRYmDW2QAV8Ma0WytpzVLoOGSCojZcAgKvPzDoCmh2QKxB8fgHxXr7n zYVqOyN5B/XFl7wJ+y8dLgASoB1NrQFP4+P7DPi/i5W8Z+YoinGYIQUezBSQxaZzQIm1 +SIP3j/8nKS0Fmb3wl2etlShppRrw7kSoy+W8vCnaUaXWFC3lKYb6ZiK+akS4avmxOeT 8Oz2vJYAtYG9iwikhxhrSCSWQ7vUwfjhKv9UC8mzEKLblT/NgK7p2yuICXfzqRHSSuhv pyRwm/Ow7wxU/ivgzE8xsq1aBH0qj0CcrKod72suJVwTCyQ9oF7xNSXS2+DQCnIeVF1E ox/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pEYcVeyNoKzSNbvy4jy8pfVSwm3ir1DHFnmbQ76O6EA=; b=C7RZwJN5szpRbtTijMseI8k4nUHHtSFVyOe6ZVNWxEdjxsmvbvW5CgvZQRXuU+MoWY LWT+cCFwNW+00LUyxYkUEuSds4jid82GmW5n/pQo1PcneOcuAvwkMzhxQYhj3b2KkMmt mCnqRZ75Hch78Y50qXjHtvqlPiV2Lf4DTZ6UESNuNV5MwilXDsPbU+YEI/relnbnTe8W +1j0P0J4R/TjVsjRHhkfOcv02VPbDKAG93bK70iWgw7Hhxs9alSYQJHVrOq6EJgMSB/o JeJO/YhU9opiaWzq568riyEPJVjhSI7B+ZzrdbMqUHUejpmqQYMF+Foi5uZgqxR4M/a5 k+Jw== X-Gm-Message-State: AOAM532To1xKtObVvVvBXyZ+1u4qvl06Cfd8M5iDeF+j75HZQELExHJD fe84F+eThQ5fdwbshCOreJc= X-Received: by 2002:a63:5915:: with SMTP id n21mr3218842pgb.58.1623235876980; Wed, 09 Jun 2021 03:51:16 -0700 (PDT) Received: from localhost (122x211x248x161.ap122.ftth.ucom.ne.jp. [122.211.248.161]) by smtp.gmail.com with ESMTPSA id k8sm12556837pfg.185.2021.06.09.03.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 03:51:16 -0700 (PDT) From: Punit Agrawal To: mhiramat@kernel.org, naveen.n.rao@linux.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net Cc: Punit Agrawal , 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 Message-Id: <20210609105019.3626677-6-punitagrawal@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210609105019.3626677-1-punitagrawal@gmail.com> References: <20210609105019.3626677-1-punitagrawal@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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