Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12964386rwl; Wed, 4 Jan 2023 01:15:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXsRcJvA4BviCbdXuYDoeT38fJ7lIq2ovT7y6UVIxlwZxmZR/D1lgzO34XUbAT2KCjtXwddh X-Received: by 2002:a17:90a:7e14:b0:219:eeb9:943f with SMTP id i20-20020a17090a7e1400b00219eeb9943fmr49591062pjl.49.1672823725706; Wed, 04 Jan 2023 01:15:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672823725; cv=none; d=google.com; s=arc-20160816; b=IYGIptkPLY/RR+IJrRbELDdsgOkLhMtfMu031W4piTg7mFz1Q3zgN3mM/O7kbz1qTB siXJQAMJyJ+Fn6i8kmxq6NeX006PGO+oVeMjXYEYBCd4hUmbLTSPaxM+CCMbP+TCYqVD D2OVS/dt0MqI1tsK8OrMXOpVvDyTs7FyYnAHETpYBB5pI1jmecy2RVqbMpcpT5ZRAQEh V0bX2X2MGf2dVdfXiVSnKbc51mpLh8S49zV3IK04wkc1mh51x/SaG98DiSQ4gyJwDpy5 +xjzpvHohik6bqRCvbxQtXKY3VoBon4R7ycFO+6vg2fjHn0Qxd/nC/mQq3CasQcm6gML Tf6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=bvNXp/Sa+tkL0T9Fg/2tqFwbSlVujzma1rCMPBXajwY=; b=kN98v99QGrix1pujwj81EFOUkjLSeo5X06oBCRioCzvYO3xYg2AlZAFCduSFpa3KnY 1j3kDJtv/SzWEivk13h9/wJaGp1bwJvuepPUusyhPcqEuROqI9YFoFRku5TnbgOmuy8t Q+y2fB3EaZ5BSi85CbKIVh09akQ1o36JO0VOhEm1DFmDKJWdsHsN29YHnyDXkgmrq9Py SF+ybeApUw/dwTImfIJJflictum8ddmH1RbN0e1HRtHdJFpKWREth/Ph3pq6P6fO5vIo H2HvLcGUjFACAJuqhELPPRLLi2HC2J4T+jRiTL3HBxOnJ5tZH0IaigZUG1XVDfrNlfvz hQQw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pm12-20020a17090b3c4c00b00225f76112b5si24451170pjb.63.2023.01.04.01.15.18; Wed, 04 Jan 2023 01:15:25 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233991AbjADIee (ORCPT + 57 others); Wed, 4 Jan 2023 03:34:34 -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 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 在 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