Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\kprobes\opt.c Create Date:2022-07-28 08:39:14
Last Modify:2022-05-22 07:44:06 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:copy_optimized_instructions

Proto:static int copy_optimized_instructions(u8 *dest, u8 *src, u8 *real)

Type:int

Parameter:

TypeParameterName
u8 *dest
u8 *src
u8 *real
180  len = 0
182  When len < RELATIVEJUMP_SIZE cycle
183  ret = Copy an instruction with recovering modified instruction by kprobes* and adjust the displacement if the instruction uses the %rip-relative* addressing mode. Note that since @real will be the final place of copied
184  If Not ret || Not Returns non-zero if INSN is boostable.* RIP relative instructions are adjusted at copying time in 64 bits mode Then Return -EINVAL
186  len += ret
189  If ftrace_text_reserved(src, src + len - 1) || alternatives_text_reserved(src, src + len - 1) || jump_label_text_reserved(src, src + len - 1) Then Return -EBUSY
194  Return len
Caller
NameDescribe
arch_prepare_optimized_kprobeCopy replacing target instructions* Target instructions MUST be relocatable (checked inside)* This is called when new aggr(opt)probe is allocated or reused.