Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753823AbbLFCHH (ORCPT ); Sat, 5 Dec 2015 21:07:07 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:57799 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097AbbLFCHE (ORCPT ); Sat, 5 Dec 2015 21:07:04 -0500 Subject: Re: [PATCH 5/5] x86: ftrace: fix the comments for ftrace_modify_code_direct To: Steven Rostedt , Thomas Gleixner References: <1449214067-12177-1-git-send-email-huawei.libin@huawei.com> <1449214067-12177-6-git-send-email-huawei.libin@huawei.com> <20151205175233.5a0f75cf@gandalf.local.home> CC: , , "H. Peter Anvin" , From: Li Bin Message-ID: <56639667.3010508@huawei.com> Date: Sun, 6 Dec 2015 09:59:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20151205175233.5a0f75cf@gandalf.local.home> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.23.78] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.56639671.000F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: c41047289216524221fad6fe71549e51 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1671 Lines: 49 on 2015/12/6 6:52, Steven Rostedt wrote: > On Sat, 5 Dec 2015 18:12:57 +0100 (CET) > Thomas Gleixner wrote: > >> On Fri, 4 Dec 2015, Li Bin wrote: >>> --- a/arch/x86/kernel/ftrace.c >>> +++ b/arch/x86/kernel/ftrace.c >>> @@ -106,13 +106,12 @@ ftrace_modify_code_direct(unsigned long ip, unsigned const char *old_code, >>> unsigned char replaced[MCOUNT_INSN_SIZE]; >>> >>> /* >>> - * Note: Due to modules and __init, code can >>> - * disappear and change, we need to protect against faulting >>> - * as well as code changing. We do this by using the >>> - * probe_kernel_* functions. >>> - * >>> - * No real locking needed, this code is run through >>> - * kstop_machine, or before SMP starts. >>> + * Note: >>> + * We are paranoid about modifying text, as if a bug were to happen, it >>> + * could cause us to read or write to someplace that could cause harm. >>> + * Carefully read and modify the code with aarch64_insn_*() which uses >> aarch64_insn_() is related to x86 in which way? >> >> > The original comment is incorrect and we discussed this with the > arm64 code, and said the other archs need the comment updated as > well. But it seems that Li Bin just cut and pasted the arm64 patch for > the other archs, or at least with x86 (haven't looked at the others > yet). This needs to be fixed. Sorry for my mistake, I will modify it. Thanks, Li Bin > -- Steve > > . > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/