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 CD2F9C433FE for ; Tue, 26 Apr 2022 09:37:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348925AbiDZJkv (ORCPT ); Tue, 26 Apr 2022 05:40:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348050AbiDZJPH (ORCPT ); Tue, 26 Apr 2022 05:15:07 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58C171900B3 for ; Tue, 26 Apr 2022 01:52:58 -0700 (PDT) Received: from kwepemi500024.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KnbDr2r5kzGpRl; Tue, 26 Apr 2022 16:50:20 +0800 (CST) Received: from kwepemm600010.china.huawei.com (7.193.23.86) by kwepemi500024.china.huawei.com (7.221.188.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Apr 2022 16:52:56 +0800 Received: from [10.67.110.237] (10.67.110.237) by kwepemm600010.china.huawei.com (7.193.23.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Apr 2022 16:52:55 +0800 Subject: Re: [PATCH 1/2] riscv: ftrace: Fix the comments about the number of ftrace instruction To: Guo Ren CC: Masami Hiramatsu , Palmer Dabbelt , Steven Rostedt , Ingo Molnar , Paul Walmsley , Albert Ou , "Naveen N . Rao" , "Anil S Keshavamurthy" , David Miller , , Peter Zijlstra , , =?UTF-8?Q?Patrick_St=c3=a4hlin?= , Pekka Enberg , linux-riscv , "Linux Kernel Mailing List" References: <20220426015751.88582-1-lihuafei1@huawei.com> From: Li Huafei Message-ID: <3bf77687-61c1-6d05-eea8-afe11a268421@huawei.com> Date: Tue, 26 Apr 2022 16:52:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.67.110.237] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600010.china.huawei.com (7.193.23.86) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/4/26 14:22, Guo Ren wrote: > On Tue, Apr 26, 2022 at 9:59 AM Li Huafei wrote: >> When DYNAMIC_FTRACE is enabled, we put four instructions in front of the >> function for ftrace use, not five. >> >> Signed-off-by: Li Huafei >> --- >> arch/riscv/kernel/ftrace.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/riscv/kernel/ftrace.c b/arch/riscv/kernel/ftrace.c >> index 4716f4cdc038..63f457650fa4 100644 >> --- a/arch/riscv/kernel/ftrace.c >> +++ b/arch/riscv/kernel/ftrace.c >> @@ -73,7 +73,7 @@ static int __ftrace_modify_call(unsigned long hook_pos, unsigned long target, >> } >> >> /* >> - * Put 5 instructions with 16 bytes at the front of function within >> + * Put 4 instructions with 16 bytes at the front of function within > Yeah, 5 instructions are for mcount, -fpatchable-function-entry=8 > cause 8 16bit instructions. I misunderstood, thanks for the clarification. > > Fixes: afc76b8b8011 ("riscv: Using PATCHABLE_FUNCTION_ENTRY instead of MCOUNT") There is no functional fix here, do we need to add the fix tag? > > I recommend just delete "4 instructions with" > - * Put 5 instructions with 16 bytes at the front of function within > - * patchable function entry nops' area. > + * Put 16 bytes at the front of the function within the patchable > + * function entry nops' area. I agree and will use this modification for the next version, thanks! Huafei > >> * patchable function entry nops' area. >> * >> * 0: REG_S ra, -SZREG(sp) >> -- >> 2.17.1 >> >