Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp960782pxb; Thu, 5 Nov 2020 18:59:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTG8/sub9RNQUq0mHSBw40FuIxULZn1r69PzvnLth4v7aFBPvf0C+4kyyOKFhkurK3TBx2 X-Received: by 2002:a50:930d:: with SMTP id m13mr5794307eda.117.1604631577773; Thu, 05 Nov 2020 18:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604631577; cv=none; d=google.com; s=arc-20160816; b=HmWgEpDzPK1SPQKb06APC+StCsc/uDIxTFSfcSKbK6CyvHK+38Tr01JjXhBTWiBLTT XOGxfdY27xs+w4dHTKm52f5n1dXPrDg/4VCwh1OpgkIvKPNOAEC/Exxxb5QcOAhyF0U0 Wv3w5+6fBebREVbZWRbMGAMyoaGjpCk6VO1wXh4Ebt2N0WfutQkfAb7k/ffD3F4/7bwR URgtDgEq120H53Vt7mrAbA+7g/d4gUrM3NvweUvlJTxnTqFPJOCgTD9zXZGxWYqPNC8B qmYZpbHHVyjXD0EpPXHUI9I1FOasvf0Ad8gI3KtrY9/0RYE9b5I39xXxgJCKB8R4fEn5 WkUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=q7+6rMshbHnXrtJsGCGJYzy2+e6Bkr9mEWG5+e/8+1w=; b=qIK4KkRimDZMck39cnRNI13R5+/WCJTmkYipijRaazA3pmcCIjCzbNU2drJlcHxMwc IPt4bd3cPbwOGbrTAQ6aNQbfVP2iqO7om+6tJPjgv/7I9mRTqXnK+lvwRvC9hRTzC+Wj xRN2YuKcb2/SiNjtXSV1jVEa6yIwhRSxjvnlU/WjZjtzbE2OLetTdLARy5wTJy3+mv6l 1LRGFqdxMbWpzQGWSNLUgIqrWH3RlyYVJoPmNfdmXdHqMAQbbU1r2aYIoRajmN9pRBem 55hbzuvxcfUvU9snqh2/tGbVfXM3/NXGydzDAsqCRAMIlrzNt9RCFra4CTJWVj63cEWX pYAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TF7x00Zg; 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 m3si10897ejq.277.2020.11.05.18.59.15; Thu, 05 Nov 2020 18:59:37 -0800 (PST) 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=default header.b=TF7x00Zg; 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 S1726056AbgKFC5L (ORCPT + 99 others); Thu, 5 Nov 2020 21:57:11 -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-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/