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=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,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 26CDAC48BCD for ; Wed, 9 Jun 2021 14:30:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A158613AE for ; Wed, 9 Jun 2021 14:30:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234767AbhFIOcD (ORCPT ); Wed, 9 Jun 2021 10:32:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:48744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236007AbhFIOb6 (ORCPT ); Wed, 9 Jun 2021 10:31:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5EDC61364; Wed, 9 Jun 2021 14:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623249003; bh=D31J9ARRh9ELvjX6pTEQbRNy1KIC+gmUtHCUZpQK0L4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CRydjYwiIPrKLvOX29Gc54/BO66vTFutfDGmAXbX5CRU17WwQ3mh5c058fnTOER0I orTMXUh1siwzdHwiP97n35NtVbPEbHbNWO4RtnkvtE4ACgAvRMgpjt8X06fTtv2bDw SHLRYS3E5BycmrCYaPMtxbF2O9WSjHIMGCEfNh3oAYjB+SiI9kp4dioJVGWnxh+j1z 1KlfD3Mm8CoVDiLPgnSX9V1v1YdgQmLZTilID96JIdzGouxjoi4bAunfVJvYKTDMc9 dS27HrR15U20Xgtj7FhqpPA2pZFhsVe88Mdr+Y9lr/iKyyzjqhbpxGBHe7gYxb3viO LEY3gtTLECeXw== Date: Wed, 9 Jun 2021 23:29:59 +0900 From: Masami Hiramatsu To: Guo Ren Cc: Punit Agrawal , Masami Hiramatsu , "Naveen N . Rao" , Anil S Keshavamurthy , David Miller , Linux Kernel Mailing List , linux-csky@vger.kernel.org, Guo Ren Subject: Re: [RFC PATCH 4/5] csky: ftrace: Drop duplicate implementation of arch_check_ftrace_location() Message-Id: <20210609232959.3b94659c00ad66a602653bde@kernel.org> In-Reply-To: References: <20210609105019.3626677-1-punitagrawal@gmail.com> <20210609105019.3626677-5-punitagrawal@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-csky@vger.kernel.org Hi Guo, On Wed, 9 Jun 2021 20:33:18 +0800 Guo Ren wrote: > csky using -mcount not -fpatchable-function-entry, so > /* Given address is not on the instruction boundary */ > if ((unsigned long)p->addr != ftrace_addr) > return -EILSEQ; > all right? Even if -mcount is used, that check is still needed since the ftrace hooked address will be the ftrace_addr. If user tries to probe the second instruction in mcount code, kprobes needs to stop it. Thank you, > > On Wed, Jun 9, 2021 at 6:51 PM Punit Agrawal wrote: > > > > The csky specific arch_check_ftrace_location() shadows a weak > > implementation of the function in core code that offers the same > > functionality but with additional error checking. > > > > Drop the architecture specific function as a step towards further > > cleanup in core code. > > > > Signed-off-by: Punit Agrawal > > Cc: Guo Ren > > --- > > arch/csky/kernel/probes/ftrace.c | 7 ------- > > 1 file changed, 7 deletions(-) > > > > diff --git a/arch/csky/kernel/probes/ftrace.c b/arch/csky/kernel/probes/ftrace.c > > index ef2bb9bd9605..b388228abbf2 100644 > > --- a/arch/csky/kernel/probes/ftrace.c > > +++ b/arch/csky/kernel/probes/ftrace.c > > @@ -2,13 +2,6 @@ > > > > #include > > > > -int arch_check_ftrace_location(struct kprobe *p) > > -{ > > - if (ftrace_location((unsigned long)p->addr)) > > - p->flags |= KPROBE_FLAG_FTRACE; > > - return 0; > > -} > > - > > /* Ftrace callback handler for kprobes -- called under preepmt disabled */ > > void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, > > struct ftrace_ops *ops, struct ftrace_regs *fregs) > > -- > > 2.30.2 > > > > > -- > Best Regards > Guo Ren > > ML: https://lore.kernel.org/linux-csky/ -- Masami Hiramatsu