mirror of https://gitee.com/openkylin/linux.git
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 <mhiramat@kernel.org> Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: David S . Miller <davem@davemloft.net> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ye Xiaolong <xiaolong.ye@intel.com> Link: http://lkml.kernel.org/r/149076347582.22469.3775133607244923462.stgit@devbox Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
bd0b90676c
commit
129d17e8e8
|
@ -350,11 +350,10 @@ static int is_IF_modifier(kprobe_opcode_t *insn)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy an instruction and adjust the displacement if the instruction
|
* Copy an instruction with recovering modified instruction by kprobes
|
||||||
* uses the %rip-relative addressing mode.
|
* and adjust the displacement if the instruction uses the %rip-relative
|
||||||
* If it does, Return the address of the 32-bit displacement word.
|
* addressing mode.
|
||||||
* If not, return null.
|
* This returns the length of copied instruction, or 0 if it has an error.
|
||||||
* Only applicable to 64-bit x86.
|
|
||||||
*/
|
*/
|
||||||
int __copy_instruction(u8 *dest, u8 *src)
|
int __copy_instruction(u8 *dest, u8 *src)
|
||||||
{
|
{
|
||||||
|
@ -376,6 +375,7 @@ int __copy_instruction(u8 *dest, u8 *src)
|
||||||
memcpy(dest, insn.kaddr, length);
|
memcpy(dest, insn.kaddr, length);
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
|
/* Only x86_64 has RIP relative instructions */
|
||||||
if (insn_rip_relative(&insn)) {
|
if (insn_rip_relative(&insn)) {
|
||||||
s64 newdisp;
|
s64 newdisp;
|
||||||
u8 *disp;
|
u8 *disp;
|
||||||
|
|
Loading…
Reference in New Issue