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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 956E2C55179 for ; Fri, 6 Nov 2020 02:57:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 310E42078E for ; Fri, 6 Nov 2020 02:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604631434; bh=9rQRIBsHfZeDxfMqnHjDf3pUoaqjw7mhb/AQ10vMDoY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=hzpk2eR6lyeDN80N0NU/DB9fLk8JzS8DKx62UWt0QLT/bbXsTIj2W3KjsqyK7jLnc yz2s0BKzvcC7OLXcOKtPIYOdX23U0TBUX0e+lJglMOl+CgTQuJsop6iwk/AY3Y05IQ zKD4rGzZ9UmNUImiwcXGtMVCcC9kduqc0+hrG6XA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726064AbgKFC5M (ORCPT ); Thu, 5 Nov 2020 21:57:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:44792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbgKFC5J (ORCPT ); Thu, 5 Nov 2020 21:57:09 -0500 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BB80B20885; Fri, 6 Nov 2020 02:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604631428; bh=9rQRIBsHfZeDxfMqnHjDf3pUoaqjw7mhb/AQ10vMDoY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TF7x00ZgQVa4HaGnSQPmDiTyB8y+VIQoCzJV3YdhsaaRLyFkTM9ISom0fByffhcI1 pBZBzMw9pSGGggy6eUaKobaD6IWzYqTcZEfnah5VBBFPN+U/8aODKos2zvTkGnE6/X iTrY+Q7WCTabdB4kIhBAdrrlNJU9vVaKgMtfmRRU= Received: by mail-lj1-f177.google.com with SMTP id l10so3780288lji.4; Thu, 05 Nov 2020 18:57:07 -0800 (PST) X-Gm-Message-State: AOAM533iAYBPjJ1o+S8PD8TvKFR0STdCkW6sNlLLWWLr3SkramzaC2P8 Hh/ACuWjlhLVirscn7d9U1CsIadixfR7rkGUyHA= X-Google-Smtp-Source: ABdhPJyS549mSsbY71592hwkiYhz+BcFJErkk2ka5vmMUXvgndKh9GeAWhQ5JZMC4w2XtW9dc3WPYMqmypHc7huC/0s= X-Received: by 2002:a2e:8816:: with SMTP id x22mr1814521ljh.377.1604631425962; Thu, 05 Nov 2020 18:57:05 -0800 (PST) MIME-Version: 1.0 References: <1602918377-23573-6-git-send-email-guoren@kernel.org> In-Reply-To: From: Guo Ren Date: Fri, 6 Nov 2020 10:56:54 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 5/9] riscv: Add kprobes supported To: Palmer Dabbelt Cc: Paul Walmsley , Masami Hiramatsu , Alan Kao , Steven Rostedt , linux-riscv , Linux Kernel Mailing List , Anup Patel , linux-csky@vger.kernel.org, Greentime Hu , Zong Li , =?UTF-8?Q?Patrick_St=C3=A4hlin?= , Guo Ren , Bjorn Topel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 6, 2020 at 9:02 AM Palmer Dabbelt wr= ote: > > On Sat, 17 Oct 2020 00:06:13 PDT (-0700), guoren@kernel.org wrote: > > From: Guo Ren > > > > This patch enables "kprobe & kretprobe" to work with ftrace > > interface. It utilized software breakpoint as single-step > > mechanism. > > > > Some instructions which can't be single-step executed must be > > simulated in kernel execution slot, such as: branch, jal, auipc, > > la ... > > > > Some instructions should be rejected for probing and we use a > > blacklist to filter, such as: ecall, ebreak, ... > > > > We use ebreak & c.ebreak to replace origin instruction and the > > kprobe handler prepares an executable memory slot for out-of-line > > execution with a copy of the original instruction being probed. > > In execution slot we add ebreak behind original instruction to > > simulate a single-setp mechanism. > > > > The patch is based on packi's work [1] and csky's work [2]. > > - The kprobes_trampoline.S is all from packi's patch > > - The single-step mechanism is new designed for riscv without hw > > single-step trap > > - The simulation codes are from csky > > - Frankly, all codes refer to other archs' implementation > > > > [1] https://lore.kernel.org/linux-riscv/20181113195804.22825-1-me@pack= i.ch/ > > [2] https://lore.kernel.org/linux-csky/20200403044150.20562-9-guoren@k= ernel.org/ > > > > Signed-off-by: Guo Ren > > Co-Developed-by: Patrick St=C3=A4hlin > > Checkpatch says > > WARNING: 'Co-developed-by:' is the preferred signature form > #108: > Co-Developed-by: Patrick St=C3=A4hlin > > WARNING: Co-developed-by: must be immediately followed by Signed-off-= by: > #108: > Co-Developed-by: Patrick St=C3=A4hlin > Acked-by: Masami Hiramatsu > > There's some other checkpatch warnings throughout the patch set, but this= is > one I'm not supposed to fix up. Can one of you re-post the patches with = the > correct DCO? Ok, I'll fix it up in V5 and rebase 5.10-rc2 --=20 Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/