From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753368AbdDLHia (ORCPT ); Wed, 12 Apr 2017 03:38:30 -0400 Received: from terminus.zytor.com ([65.50.211.136]:35773 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752349AbdDLHi1 (ORCPT ); Wed, 12 Apr 2017 03:38:27 -0400 Date: Wed, 12 Apr 2017 00:32:30 -0700 From: tip-bot for Masami Hiramatsu Message-ID: Cc: hpa@zytor.com, ananth@linux.vnet.ibm.com, bp@alien8.de, xiaolong.ye@intel.com, brgerst@gmail.com, dvlasenk@redhat.com, linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, jpoimboe@redhat.com, aryabinin@virtuozzo.com, mhiramat@kernel.org, tglx@linutronix.de, anil.s.keshavamurthy@intel.com, davem@davemloft.net, torvalds@linux-foundation.org Reply-To: torvalds@linux-foundation.org, anil.s.keshavamurthy@intel.com, tglx@linutronix.de, davem@davemloft.net, mhiramat@kernel.org, aryabinin@virtuozzo.com, jpoimboe@redhat.com, peterz@infradead.org, mingo@kernel.org, dvlasenk@redhat.com, linux-kernel@vger.kernel.org, brgerst@gmail.com, ananth@linux.vnet.ibm.com, xiaolong.ye@intel.com, bp@alien8.de, hpa@zytor.com In-Reply-To: <149076347582.22469.3775133607244923462.stgit@devbox> References: <149076347582.22469.3775133607244923462.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] kprobes/x86: Fix the description of __copy_instruction() Git-Commit-ID: 129d17e8e8daf50f8aff4941fb4a9cda027ab9cf X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 129d17e8e8daf50f8aff4941fb4a9cda027ab9cf Gitweb: http://git.kernel.org/tip/129d17e8e8daf50f8aff4941fb4a9cda027ab9cf Author: Masami Hiramatsu AuthorDate: Wed, 29 Mar 2017 13:58:06 +0900 Committer: Ingo Molnar CommitDate: Wed, 12 Apr 2017 09:23:45 +0200 kprobes/x86: Fix the description of __copy_instruction() Fix the description comment of __copy_instruction() function since it has already been changed to return the length of the copied instruction. Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Andrey Ryabinin Cc: Anil S Keshavamurthy Cc: Borislav Petkov Cc: Brian Gerst Cc: David S . Miller Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ye Xiaolong Link: http://lkml.kernel.org/r/149076347582.22469.3775133607244923462.stgit@devbox Signed-off-by: Ingo Molnar --- arch/x86/kernel/kprobes/core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 9eae5a6..81d4dc7 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -350,11 +350,10 @@ static int is_IF_modifier(kprobe_opcode_t *insn) } /* - * Copy an instruction and adjust the displacement if the instruction - * uses the %rip-relative addressing mode. - * If it does, Return the address of the 32-bit displacement word. - * If not, return null. - * Only applicable to 64-bit x86. + * Copy an instruction with recovering modified instruction by kprobes + * and adjust the displacement if the instruction uses the %rip-relative + * addressing mode. + * This returns the length of copied instruction, or 0 if it has an error. */ int __copy_instruction(u8 *dest, u8 *src) { @@ -376,6 +375,7 @@ int __copy_instruction(u8 *dest, u8 *src) memcpy(dest, insn.kaddr, length); #ifdef CONFIG_X86_64 + /* Only x86_64 has RIP relative instructions */ if (insn_rip_relative(&insn)) { s64 newdisp; u8 *disp;