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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36BDCC4332F for ; Mon, 7 Nov 2022 15:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=goTPaD8L9UXPAO88k00y7bO3ioI5b/pTShNyhDsp4ds=; b=49X1OVD0Bi/hb8 Udl6HP7+m+YxXdcoUoMPRfa1loSKQdeVBRHdbP+r/tjJIlrf0W+nXNYgmwPudhbo2Kv13JFy4jh+C YIBOO/3YISq9+RH15oxpC4POo40yaYN3/TYv21Dt2E2di4hJ/PPAzV817yR953WdtM1X2LJyMyLgl brx+gCVkRTqYW0SYVWJEZnfBNHEHeSVNaw3knypuq00m+UrwuTZ07f8f7qmJv4YutnKUrI873tnEW ARZA4oVUOxOEYZUdKEZfCBCvIhmPYkc/UKidluEGc9LYiXLLpnuCHIb+WTISElgrogeMapaxs5MNe AaYUUzvOIW4HXlF0Uz9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os3dy-00FUk3-0M; Mon, 07 Nov 2022 15:02:36 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1os3RV-00FNKf-Dw for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 14:49:42 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BFD4CB811C0; Mon, 7 Nov 2022 14:49:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F677C433D6; Mon, 7 Nov 2022 14:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667832578; bh=3WK9Jq/Qe/BgudIXrjjalPxMr2bjl68Gs+psLSmfhcc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FWGGMUUeRPCsiDwZofNcQpiJuk6DroMw24HvO46ZQ5KbOwVn2En6Ex4K/E/3Ny3ZS Rmt1UCF4RMrQst0hl4lW2S89wcz1bOzLlOkLDbRTu4SqJ05E+qXrTndRkKW1CiHpyP mK6eRUMpIwGo5r73WpfyjC4+Vxo7NoC/yMr5bOUi0Gmg/d63Quw54+O3dLndMC4OUK ruFvx0YL33X4+GDxk0dpoOUaebskl1oCl+LhOjs6W2fQv9FQZe9VLD0tuWab3tE5O3 4zxX7XmeN3tVXT1JlgjRf+xaE4rVtWC3Sn35j+hsWnc6VjGBYbobr4jwQqHwfOaWT2 UKkOIZXwaGuZQ== Date: Mon, 7 Nov 2022 14:49:31 +0000 From: Will Deacon To: Jianlin Lv Cc: corbet@lwn.net, catalin.marinas@arm.com, rostedt@goodmis.org, mingo@redhat.com, naveen.n.rao@linux.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net, mhiramat@kernel.org, arnd@arndb.de, zhengzengkai@huawei.com, jianlv@ebay.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com Subject: Re: [PATCH] arm64/kprobes: Add support for KPROBES_ON_FTRACE Message-ID: <20221107144931.GA20793@willie-the-truck> References: <20220728020250.1699-1-iecedge@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220728020250.1699-1-iecedge@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_064941_657182_F4306807 X-CRM114-Status: GOOD ( 16.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [+Mark R] On Thu, Jul 28, 2022 at 02:02:50AM +0000, Jianlin Lv wrote: > This is the arm64 version of ftrace-based kprobes to avoid the overhead > with regular kprobes, by using the ftrace infrastructure. > > Signed-off-by: Jianlin Lv > --- > .../debug/kprobes-on-ftrace/arch-support.txt | 2 +- > arch/arm64/Kconfig | 1 + > arch/arm64/kernel/probes/Makefile | 1 + > arch/arm64/kernel/probes/kprobes-ftrace.c | 81 +++++++++++++++++++ > include/linux/kprobes.h | 2 + > kernel/kprobes.c | 4 +- > 6 files changed, 88 insertions(+), 3 deletions(-) > create mode 100644 arch/arm64/kernel/probes/kprobes-ftrace.c Sorry for the slow reply on this, but I think this deserved to be split into two patches: the first one reworking the core check_ftrace_location() logic to work properly with branch-and-link style architectures, and the second one adding support for arm64. I'd also prefer that we don't just punt the whole of check_ftrace_location() to the arch code using weak symbols. I'd have thought it would be cleaner for architectures to specify the offset which needs to be applied to the PC instead. Having said that, how do architectures such as PowerPC and Risc-V handle this today without changing the core code? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel