函数逻辑报告 |
Source Code:arch\x86\kernel\alternative.c |
Create Date:2022-07-27 08:44:55 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Replace 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
函数原型:void __init_or_module noinline apply_alternatives(struct alt_instr *start, struct alt_instr *end)
返回类型:void
参数:
类型 | 参数 | 名称 |
---|---|---|
struct alt_instr * | start | |
struct alt_instr * | end |
388 | insn_buff_sz等于0 |
390 | instr = (u8 * ) & original instruction + original instruction |
392 | BUG_ON( length of original instruction > insn_buff的长度) |
393 | BUG_ON( cpuid bit set for replacement >= (N 32-bit words worth of info + N 32-bit bug flags ) * 32) |
394 | 如果非boot_cpu_has( cpuid bit set for replacement )则 |
395 | 如果 length of build-time padding 大于1则"noinline" to cause control flow change and thus invalidate I$ and* cause refetch after modification. |
398 | 继续下一循环 |
401 | DPRINTK("feat: %d*32+%d, old: (%pS (%px) len: %d), repl: (%px, len: %d), pad: %d", cpuid bit set for replacement >> 5, cpuid bit set for replacement & 0x1f, instr, instr, length of original instruction , replacement, length of new instruction , length of build-time padding ) |
407 | DUMP_BYTES(instr, length of original instruction , "%px: old_insn: ", instr) |
408 | DUMP_BYTES(replacement, length of new instruction , "%px: rpl_insn: ", replacement) |
419 | 如果 length of new instruction 恒等于5且insn_buff恒等于0xe8则 |
420 | *insn_buff加1的和加等于replacement减instr |
426 | 如果 length of new instruction 且Are we looking at a near JMP with a 1 or 4-byte displacement.则recompute_jump(a, instr, replacement, insn_buff) |
434 | DUMP_BYTES(insn_buff, insn_buff_sz, "%px: final_insn: ", instr) |
名称 | 描述 |
---|---|
alternative_instructions | |
arch_klp_init_object_loaded | Apply per-object alternatives. Based on x86 module_finalize() |
module_finalize |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |