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=-5.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,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 5E4D3C43331 for ; Tue, 31 Mar 2020 02:45:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2A98520748 for ; Tue, 31 Mar 2020 02:45:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OK2GZ6VJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="WYLIUVbn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A98520748 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cVqU5IzDFMtEwQ1SdELiLgU5kra5OrHiUcD1XBCVDgs=; b=OK2GZ6VJmch7db nf7yFpbLPNX0BcKeMBbtyanldgNeMKgyOkF2IQF4aQ/7nSMZ2ZjhRyvrPMaWub0tEkhblc8knaUWE IO+0lggHhEF7iS3zDB7Tps8+bktem1QjBT8SOPTCa2VEgaETHlbwCjHkDJFwt758eLx5ADqFxDn69 ptiPIz8S353kEzfwadIP6rcDjG0NAwwtFe9m2LayJ3Ul528yBtyazLTPhaGSoobq6ju+Fpli9BV2U JE0ecKJd/HjaujtsNub2ONVvSmQ0iup4AkgqAsIvm2iZmNzQXb0rDEKtfd7Tt/m1k8nVt1gROUlx2 Dttro/HmL4YBQ8cMRyLQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJ6uL-0001hn-PQ; Tue, 31 Mar 2020 02:45:41 +0000 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJ6uG-0001go-6B for linux-riscv@lists.infradead.org; Tue, 31 Mar 2020 02:45:39 +0000 Received: by mail-ot1-x344.google.com with SMTP id f52so20506413otf.8 for ; Mon, 30 Mar 2020 19:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=cVqU5IzDFMtEwQ1SdELiLgU5kra5OrHiUcD1XBCVDgs=; b=WYLIUVbnj1Klvmjge4kDkOK13ziylDUSA3RqL+GiVvCZE3o/fBjO/pXe6a9q3Fab2W oLmh1FkN0p0G9YphbQR4ByrsGbX0EEOjlSfH0ehRwAG/pfHRy31nzuDzxb/5bWFhDExq V82kBJ0l6d5L6N6vBZf9zEclmm55hDBoo/J+F9WDk79Np0MLZFbVhi/PVygo/tQLW0fZ KJObbcWFlnfDGelmo0XTF2VVwapRF26sxcjPIDw72HqsgYTrf7K5902UAjhPDEAVdVmv dH2KQQrmOaE9SyHqKFHdJDKfr9OwTWo0Io0+8HOE4OQgid5/oPWBcz+F33cGSCUE2Ik+ HFhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=cVqU5IzDFMtEwQ1SdELiLgU5kra5OrHiUcD1XBCVDgs=; b=XDegRRhp302ah4wHDyByw2cxcKb+g5wF8iMIeokMhEDAXBMxHrgrWUTmV8QaaQrPSY sdbQDa2TLMKmzH5CeayiC3i0Y5Ei8ZwF/Ou05DMz1l63i8IxL1uE9PSzY0fUNDpzJ359 n3lgxoCpR6PLqfGRlD26QsRRP8VcRxusY9N6Wt61YMuNKSe1A7VRfNeO+LQOCNb2WgHA gMVqBvRpnbkX+p1QwACYisJkKsTyTDXq3D3Q/t+6MagdH4L/mckYAnie2MYLE0FUrf6N 6fTSkBwC89CAtg76+MzfeKafdFLuVcgckFRRJAM1xmc6aNVlwWrlRcE366snPHfS8OB3 DrFA== X-Gm-Message-State: ANhLgQ2TdMAECmiyqCDr6KyBMmYQSPaOTzeAMPj14Q4U3XLVKpUrn5yl g4k3nA+cGhC1ueIif6wZDkrjJ73ynddOIUVQJgWlTRwy X-Google-Smtp-Source: ADFU+vvGQXgwysVsU+geRrF6flKZ1PkqCkjLSRVKtHzuFnt0kahtQvd2XNUUTMy0/vMErtgQXXXuMsHW5JZ17Jm4JGI= X-Received: by 2002:a9d:7f19:: with SMTP id j25mr11712164otq.129.1585622731419; Mon, 30 Mar 2020 19:45:31 -0700 (PDT) MIME-Version: 1.0 References: <20181113195804.22825-1-me@packi.ch> <20181113195804.22825-3-me@packi.ch> <20181114003730.06f810517a270070734df4ce@kernel.org> <20181115004141.5ed772834fc6bdf3467f244e@kernel.org> <9cdd84b5-6c81-9bfa-5d35-6645f542f71e@packi.ch> In-Reply-To: From: Zong Li Date: Tue, 31 Mar 2020 10:45:21 +0800 Message-ID: Subject: Re: [RFC/RFT 2/2] RISC-V: kprobes/kretprobe support To: =?UTF-8?Q?Patrick_St=C3=A4hlin?= , Masami Hiramatsu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200330_194537_589745_95985C46 X-CRM114-Status: GOOD ( 20.37 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greentime Hu , linux-riscv , Albert Ou , Anders Roxell , Paul Walmsley Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Thu, Dec 19, 2019 at 5:28 PM Zong Li wrote: > > On Wed, Dec 18, 2019 at 9:10 PM Patrick St=C3=A4hlin wrote: > > > > Hi all > > > > On 18.12.19 10:14, Zong Li wrote: > > > On Wed, Dec 18, 2019 at 5:09 PM Zong Li wrote: > > >> > > >> From: mhiramat@kernel.org (Masami Hiramatsu) > > >> > > >> On Wed, 14 Nov 2018 21:52:57 +0100 > > >> Patrick Staehlin wrote: > > >> > > >>> Yeah, I think it's simpler. > > >>> > > >>> And I found that the kprobe_breakpoint_handler() was called without > > >>> checking !user_mode(regs). In that case, you should add the check i= n > > >>> front of kprobe_breakpoint_handler() call. > > >>> > > >>> Thank you, > > >> > > >> Hi all, > > >> > > >> Is there any update? I was wondering if this patch are keep going? I= f > > >> not, I think I could pick it up to go head > > > > I am still working on it, albeit slowly, holiday season coming up here > > in Switzerland may accelerate that a bit. All the feedback I got from > > Masami has been implemented. > > As Masami's suggestion, I don't see stop_machine in your implementation [= 1], > are there some concerns to use it on SMP? Hi all, I introduced the patching code framework. Maybe it is helpful for self-modify code here. (Please see: https://lkml.org/lkml/2020/3/9/679) This patch series is reviewing, maybe we could apply the implementation after it was merged. > > > Additionally I added instruction simulation for everything except memor= y > > accesses. I am currently working on getting compressed instructions > > decoded properly into regular instructions but that is very tedious wor= k. > > I guess I am two or three full days of work away from getting a RFC/RFT > > v2 series ready I guess that will happen in early January. > > Thanks for the efforts. > > > > > What I currently have is at [1], that is mostly untested as of now > > (beware I will rebase/squash that branch regularly). What I could use > > help with in the future (as in for v2), is somebody testing it on real > > hardware, as I've never gotten any testing feedback on my original > > patch-series (that would not have worked properly because of the lackin= g > > cache-flush). > > I give some quick tests by using kprobe sanity test and simple LKM on > Hifive Unleashed board, > it seems to work normally. I could help to test your next version patch a= s well. > > > > > [1] https://github.com/packi/linux/tree/kprobes-riscv > > > > Patrick