Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10906585rwl; Mon, 2 Jan 2023 10:05:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXvA8OOuggsQrnxOn0WhUF8Ej5tOr6AqfPE9V2+liOHnTuhWrUe3jYTH8PmcNrDRptnjvhXH X-Received: by 2002:a17:90a:6b08:b0:225:f473:b4c6 with SMTP id v8-20020a17090a6b0800b00225f473b4c6mr28662577pjj.22.1672682742583; Mon, 02 Jan 2023 10:05:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672682742; cv=none; d=google.com; s=arc-20160816; b=IzcrWJb9wO/PZw63RXD+CNEJo1oukVakF/rk5Sc6pSZF93UbP+NvS1vLh5leJRVanR ZyqntThsTthraGY4jD+CZR3o6hVCLfNUK/SnIxvekXwsjdWi9SUlpSIF3v0TSwJrdCFI eii4gIGbEloi/nxHaKRVb60Y0WqpzrgIJA48OmFWemsxxVdPQtxFO205AMKMmgdNc1HF ll/JE3xFQzs+jytB5ufjL3ly3RJFVK2zI63LxRkyMsy+gkh5eCmmQ+hbaNtPemq59Nij Q6eI3ddcmkrcbRMY1ULHsP8SeEkpYEgoCgNeJasyzCncd5WeFJiN16fYj5gdJizrE+ux vDtA== 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 :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=xFB+pqkNVJr5d8mSMRmOujiTSNxhjU4TQhJt9Jg8R8Y=; b=shLr//NnzKsdLv8Vp9yFlxopPIjTSiXXqVkLx0DipWuUSgJ60hHRYyJ7bepETZF1uV rjAvczrrv4Yr+06B+BNKS5+9xgf5VvMqzuYcVj8cy579MR97rY/spLur2X6OO8af62z+ Kw3heCGgCNJz6K2b6+nR+O2Yo9OuScHtPkxWMt833fKnsVzl/5KSlFWsFHMleuxIEDLH eO24N8MOBt+J9yt5Zb73nzV5Y5NieqVPRKb0OZQTrvuKEybxP86+xbnceQyBsBxCZgel ENnufxrkpyQrS4GBHxneRvjbe1Vq91xyn2E/9r06UF5tsSo/dxrNZ0KFTL1HdOHIobWt gZ9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nTlYO3nf; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1-20020a17090a190100b00218a65ab890si13108673pjg.83.2023.01.02.10.05.34; Mon, 02 Jan 2023 10:05:42 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=nTlYO3nf; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236175AbjABSD1 (ORCPT + 61 others); Mon, 2 Jan 2023 13:03:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232629AbjABSDV (ORCPT ); Mon, 2 Jan 2023 13:03:21 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC1C4625D for ; Mon, 2 Jan 2023 10:03:20 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5E40F6106C for ; Mon, 2 Jan 2023 18:03:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 691AFC433D2; Mon, 2 Jan 2023 18:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672682599; bh=xFB+pqkNVJr5d8mSMRmOujiTSNxhjU4TQhJt9Jg8R8Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nTlYO3nfkttQQtNzmo5st0FF1fLUh3JjCaVhN08ZsFu2/Ar3eRDOzfAvEQFgt7sdV 1VwVgLYhgywzHybz+qx+w6R3pBQQ+1xBmPecCZEksyOSyU/mqs03PuEAyj36TqyuFQ ss6xPo+zvoVXRefp20KH+1Ufo3tZcQ8O9Vv2+7bUqV3SGoNlZny2fZSXbXOpKECPOs o/jGZd7b8s0MUGGRqmz/VYLlCulDIq4o+VFIXkQ2rfSod0QNe338OIjxHp+4FjFRGm qe+EkEmhta0pUJSsu1TMvsTcURy5os45fvHYRY7oDp/sJWrxmLQLrlV+ZO9+rH88IT CenFM5oUu0BTQ== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Chen Guokai , paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, rostedt@goodmis.org, mingo@redhat.com, sfr@canb.auug.org.au Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, liaochang1@huawei.com, Chen Guokai Subject: Re: [PATCH v5 1/9] riscv/kprobe: Prepare the skeleton to implement RISCV OPTPROBES feature In-Reply-To: <20221224114315.850130-2-chenguokai17@mails.ucas.ac.cn> References: <20221224114315.850130-1-chenguokai17@mails.ucas.ac.cn> <20221224114315.850130-2-chenguokai17@mails.ucas.ac.cn> Date: Mon, 02 Jan 2023 19:03:17 +0100 Message-ID: <87wn64vmoq.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 Chen Guokai writes: > From: Liao Chang > > Prepare skeleton to implement optimized kprobe on RISCV, it is consist > of Makfile, Kconfig and some architecture specific files: kprobe.h and > opt.c opt.c include some macro, type definition and functions required > by kprobe framework, opt_trampoline.S provide a piece of assembly code > template used to construct the detour buffer as the target of long jump > instruction(s) for each optimzed kprobe. This is pretty much just reiterating what diff-stat says. Please try to explain why a certain change is done, instead of what. What is already in the patch. > Since the jump range of PC-relative instruction JAL is +/-2M, that is > too small to reach the detour buffer, hence the foudamental idea to > address OPTPROBES on RISCV is replace 'EBREAK' with 'AUIPC/JALR'. which > means it needs to clobber one more instruction beside the kprobe > instruction, furthermore, RISCV supports hybird RVI and RVC in single > kernel binary, so in theory a pair of 'AUIPC/JALR' is about to clobber > 10 bytes(3 RVC and 1 RVI, 2 bytes is padding for alignment) at worst > case. The second hardsome problem is looking for one integer register as > the destination of 'AUIPC/JALR' without any side-effect. There are a number of spelling errors, please use a spellchecker and if you reference a file (e.g. Makefile), make sure it is correctly spelled out. The comments above applies to all the commit messages of this series. Bj=C3=B6rn