Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5173880pxj; Wed, 9 Jun 2021 10:49:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+EFSGWRPwBDG4upPJUrneZSubwdQhmJ/xL6r0e2nYClxICXIyUy1gXtktOJswJakCpIe7 X-Received: by 2002:a17:906:4109:: with SMTP id j9mr1020913ejk.250.1623260987206; Wed, 09 Jun 2021 10:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623260987; cv=none; d=google.com; s=arc-20160816; b=fA9Junjz+FbTWHFQoOLbJT+Jwv+ceAH+p1JZDnrBdzOZm+3ZQ+8uxCAsnCdOERpgEd F+DdH1f6t0u0DM+7g4kjKVky3udYmZ2Hh4mhvnik4Y3N7fCIlbnOv+9m2uNm3sBgY8wz TP9voue0E89wdDk1TOnweqFRidJiDqBKUPpmGNXCLcsiQrErVLpHbshZ75jj5oejgHFA 8VnFnHYMVaLE4l2OqF/z9p6e4DkJSV6hJ8XBbMFsyeRftaqZmz7GWzAMaerN1Q275V1y fdgFiqqAENyRm7Iq++dDmZG3Fsm8q1TitzwxiAEtHv3/qMhamBJSbEFPb5rln/gAWU8x lTQA== 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:subject:cc:to:from:date :dkim-signature; bh=BFeOPtqb4tulpF1//4u2AFaYwDLNBsY2bgoWjh2/4bE=; b=l3GKuYEiZdL4YxCYNWbIZuJFcNnmpl20IfrXuuscJYpey4uG6YAGNSzVLocs+GCM3t FU52LPe85FTC/SKB5QbzMLLvy/MgrrLaYmHXCKq12PWUwXVJZOzJndmxM+acarNFerRE QIDfJAsGgHx0kFIm+3K7UR0D2OjCSUbwehtew0ZIXa90SPT1Op3sAqGRobaHjUl2XonL s533ij3hTk2uHKH/tqnTTHG5GLx750nihbsQeqcvn4ydMlWabgwLv1Sy6UqSybm/PqWs SawPk+zAB/bIZcTmNVEaUA67fwvQWoiAOaIqviCTNXPAKMum8NYWh2aUzosA7ZOJgQtt iuzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CRydjYwi; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si20677edv.349.2021.06.09.10.49.23; Wed, 09 Jun 2021 10:49:47 -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=@kernel.org header.s=k20201202 header.b=CRydjYwi; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237294AbhFIOcE (ORCPT + 99 others); Wed, 9 Jun 2021 10:32:04 -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-kernel@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