Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3713878rwb; Tue, 20 Sep 2022 03:46:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4xNI6aTjnclc2Iho7BmgBTL7IOsBqxiGjhr2W/nCaYR4ILgkn+Vx7JOQ6gSqiw4lq0K/OO X-Received: by 2002:a05:6402:370c:b0:453:9fab:1b53 with SMTP id ek12-20020a056402370c00b004539fab1b53mr14313464edb.28.1663670772209; Tue, 20 Sep 2022 03:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663670772; cv=none; d=google.com; s=arc-20160816; b=Lg94eIJh0WIyUDJpHP1y+amm2pX00V1XvKmu4QiFs539sOreGslJrQMtzwSGh3A7Xz OxI8+MHWawc7QnzoNmUv7HTNruFUw2e2IkyLmx+PkMGrfVikuzX3xoPeihZ7ibT1m2d3 gCA0cupqSnuuUyV9saM8LI7cw5bF0rYWhEcFT6TuMAExpjwALLZycx/p5LTdjunK8BjA tRME5gLEUFNwxpW6HWM6YeXGN+sNoBN0K1O6N4NlM9uqX1AJvIIwqpHyPS/ukLHpGzWv vGrW5CWcH0/koNOPL75a2URNE30LMqyv/VLt+pKU6fMfTWuvMpLxkVl7O8qYV65mSuxx XRjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MXuib7J4fEy1SxRXXQXMXfoIuC7FJU7EX8Iv5/oRUhA=; b=Y6Bg8zn3ZoJv+o9J1PngmD3TVaXY2oVqYClP9bgN3q55ntJmfYNUbTUKrEwFsRCNaY uUmeaykFoKpfTcsJbbTKC6RMKLT29hMbIor0riWHvor7wg4i+UoXtx1dpVN468uGK1+8 IqqJvLS7p9PgGgYrpqqlE7kw7SBjdxhS3hk5q1RZvKzrr9ibCE5K6wDO4y3T5pzMn+4B OJgonAAmSnrpojtbcDKi+tFdGaod1h8Ag36Py6Meh9nRUwEDLh0N6QVclKucdLAZIUhi l7XdzopAFvFTeQ6nViq3eKknxldYqJLNYoyZVblb/T/I6aKqCpv0jvCvb0+Zar4sbOd/ iTYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=eFNIRC3o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d18-20020a170906305200b007123952b00dsi953318ejd.100.2022.09.20.03.45.46; Tue, 20 Sep 2022 03:46:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=eFNIRC3o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230223AbiITKfC (ORCPT + 99 others); Tue, 20 Sep 2022 06:35:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbiITKei (ORCPT ); Tue, 20 Sep 2022 06:34:38 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 421D37436B for ; Tue, 20 Sep 2022 03:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1663669992; x=1695205992; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rLvjKx4Yb1X8lHBkqWwaF6OHYgPt5zI/9dOx67nKFdI=; b=eFNIRC3oVTgZQwK30vQuRPNfh9FPqd8Q/uS2MVHvnETfQGHK8LM5bAgi cEeXrMNOsM1u2fpmk18naIpSAHLjGCF3jUne5YwifQP4ZTHiVG1iEXUip +YSCN9hWgn9w1iyCtaVF6xE0wGYzytXksnJ/zEz+0/SpI2ClG7xiLynxP yyxUS5/PBnz7/U1a/bSbprwi5L3itYlwx/KH10Pu18HmhenHkOFrLvpdl KGXm698uX7f8AHgc8Wv+XSJV5ZRU/WC5Ls6R74vZswJqOJlEfmzz2yeN3 YRcixDZx9OpjYVbFidg1O32Jv6EEqG9nDrjkv7bKICQ2mbW0p//3pycxT w==; X-IronPort-AV: E=Sophos;i="5.93,330,1654585200"; d="scan'208";a="174706509" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Sep 2022 03:32:43 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Tue, 20 Sep 2022 03:32:42 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12 via Frontend Transport; Tue, 20 Sep 2022 03:32:40 -0700 Date: Tue, 20 Sep 2022 11:32:20 +0100 From: Conor Dooley To: Binglei Wang CC: , , , , , Subject: Re: [PATCH] rethook: add riscv rethook implementation. Message-ID: References: <20220920093630.32085-1-wang.binglei@h3c.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220920093630.32085-1-wang.binglei@h3c.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 20, 2022 at 05:36:30PM +0800, Binglei Wang wrote: > From: "wang.binglei" > > Most of the code copied from > arch/riscv/kernel/probes/kprobes_trampoline.S Hey Wang Binglei, Please use the commit log to explain the reasons behind the change you are making: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes > > Signed-off-by: wang.binglei Unfortunately I don't know much about Asian naming, but I assume that the . is not part of your name? > diff --git a/arch/riscv/kernel/probes/kprobes.c b/arch/riscv/kernel/probes/kprobes.c > index e6e950b7c..2c1847921 100644 > --- a/arch/riscv/kernel/probes/kprobes.c > +++ b/arch/riscv/kernel/probes/kprobes.c > @@ -345,6 +345,7 @@ int __init arch_populate_kprobe_blacklist(void) > return ret; > } > > +#ifndef CONFIG_KRETPROBE_ON_RETHOOK This seems quite unusual, other archs don't seem to have ifdef-ery using CONFIG_KRETPROBE_ON_RETHOOK in their arch code so why should RISC-V? > void __kprobes __used *trampoline_probe_handler(struct pt_regs *regs) > { > return (void *)kretprobe_trampoline_handler(regs, NULL); > @@ -357,6 +358,12 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, > ri->fp = NULL; > regs->ra = (unsigned long) &__kretprobe_trampoline; > } > +#else > +void __kprobes *trampoline_probe_handler(struct pt_regs *regs) > +{ > + return NULL; > +} > +#endif > diff --git a/arch/riscv/kernel/probes/rethook_trampoline.S b/arch/riscv/kernel/probes/rethook_trampoline.S > new file mode 100644 > index 000000000..aa79630ac > --- /dev/null > +++ b/arch/riscv/kernel/probes/rethook_trampoline.S > @@ -0,0 +1,94 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * rethook trampoline. > + * Copied from arch/riscv/kernel/probes/kprobes_trampoline.S Is this a 1:1 copy? If so, could the code be shared? > This e-mail and its attachments contain confidential information from New H3C, which is > intended only for the person or entity whose address is listed above. Any use of the > information contained herein in any way (including, but not limited to, total or partial > disclosure, reproduction, or dissemination) by persons other than the intended > recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender > by phone or email immediately and delete it! Uh-oh! You'll have to work with your IT to get this removed before your patches can be accepted: https://lore.kernel.org/all/YgEnxmD9ZE4jVhP5@kroah.com/ The patch does not apply to -next for me either.. Thanks, Conor.