函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\alternative.c Create Date:2022-07-27 08:44:52
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:recompute_jump

函数原型:static void __init_or_module recompute_jump(struct alt_instr *a, u8 *orig_insn, u8 *repl_insn, u8 *insn_buff)

返回类型:void

参数:

类型参数名称
struct alt_instr *a
u8 *orig_insn
u8 *repl_insn
u8 *insn_buff
288  如果 length of new instruction 不等于5则返回
291  o_dspl等于*insn_buff加1的和
294  next_rip等于repl_insn length of new instruction
296  tgt_rip等于next_ripo_dspl
297  n_dspl等于tgt_riporig_insn
299  DPRINTK("target RIP: %px, new_displ: 0x%x", tgt_rip, n_dspl)
301  如果tgt_riporig_insn大于等于0则
302  如果n_dspl减2小于等于127则转到:two_byte_jmp
304  否则转到:five_byte_jmp
307  否则
308  如果n_dspl减2按位与0xff的值恒等于n_dspl减2则转到:two_byte_jmp
310  否则转到:five_byte_jmp
314  two_byte_jmp :
315  n_dspl减等于2
317  insn_buff[0]等于0xeb
318  insn_buff[1]等于n_dspl
319  Use this to add nops to a buffer, then text_poke the whole buffer.
321  repl_len等于2
322  转到:done
324  five_byte_jmp :
325  n_dspl减等于5
327  insn_buff[0]等于0xe9
328  * (s32 * ) & insn_buff[1] = n_dspl
330  repl_len等于5
332  done :
334  DPRINTK("final displ: 0x%08x, JMP 0x%lx", n_dspl, (unsignedlong)orig_insn + n_dspl + repl_len)
调用者
名称描述
apply_alternativesReplace instructions with better alternatives for this CPU type. This runs* before SMP is initialized to avoid SMP problems with self modifying code.* This implies that asymmetric systems where APs have less capabilities than