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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60296C4332F for ; Wed, 4 Jan 2023 08:34:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233999AbjADIef (ORCPT ); Wed, 4 Jan 2023 03:34:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233975AbjADIeb (ORCPT ); Wed, 4 Jan 2023 03:34:31 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83BA11A066 for ; Wed, 4 Jan 2023 00:34:30 -0800 (PST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Nn2q72YyDzJpwR; Wed, 4 Jan 2023 16:30:27 +0800 (CST) Received: from [10.67.110.108] (10.67.110.108) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 4 Jan 2023 16:34:26 +0800 Message-ID: Date: Wed, 4 Jan 2023 16:34:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v5 1/9] riscv/kprobe: Prepare the skeleton to implement RISCV OPTPROBES feature To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Chen Guokai , , , , , , CC: , References: <20221224114315.850130-1-chenguokai17@mails.ucas.ac.cn> <20221224114315.850130-2-chenguokai17@mails.ucas.ac.cn> <87wn64vmoq.fsf@all.your.base.are.belong.to.us> From: "liaochang (A)" In-Reply-To: <87wn64vmoq.fsf@all.your.base.are.belong.to.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.108] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2023/1/3 2:03, Björn Töpel 写道: > 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. Thanks for your suggestion, i will explain further in next revision. > >> 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. Thanks for reviewing, i will correct these spelling errors. > > > Björn -- BR, Liao, Chang