tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: c8dbb3a6e214ad66d5d6099bf76e1f1c6eefc06f commit: 6b65db0bde760a026bd93ae93f5bcacfece087cb [2544/2544] livepatch: Fix huge_depth in arch_klp_check_activeness_func() config: x86_64-randconfig-123-20241205 (https://download.01.org/0day-ci/archive/20241208/202412080615.LTPtfUgh-lkp@i...) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241208/202412080615.LTPtfUgh-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202412080615.LTPtfUgh-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from arch/x86/kernel/livepatch.c:21: In file included from include/linux/kallsyms.h:12: In file included from include/linux/mm.h:1581: include/linux/vmstat.h:431:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 431 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~
arch/x86/kernel/livepatch.c:55:6: warning: no previous prototype for function 'arch_check_jump_insn' [-Wmissing-prototypes]
55 | bool arch_check_jump_insn(unsigned long func_addr) | ^ arch/x86/kernel/livepatch.c:55:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 55 | bool arch_check_jump_insn(unsigned long func_addr) | ^ | static arch/x86/kernel/livepatch.c:224:5: warning: no previous prototype for function 'arch_klp_check_calltrace' [-Wmissing-prototypes] 224 | int arch_klp_check_calltrace(bool (*check_func)(void *, int *, unsigned long), void *data) | ^ arch/x86/kernel/livepatch.c:224:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 224 | int arch_klp_check_calltrace(bool (*check_func)(void *, int *, unsigned long), void *data) | ^ | static arch/x86/kernel/livepatch.c:309:6: warning: no previous prototype for function 'arch_klp_code_modify_prepare' [-Wmissing-prototypes] 309 | void arch_klp_code_modify_prepare(void) | ^ arch/x86/kernel/livepatch.c:309:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 309 | void arch_klp_code_modify_prepare(void) | ^ | static arch/x86/kernel/livepatch.c:315:6: warning: no previous prototype for function 'arch_klp_code_modify_post_process' [-Wmissing-prototypes] 315 | void arch_klp_code_modify_post_process(void) | ^ arch/x86/kernel/livepatch.c:315:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 315 | void arch_klp_code_modify_post_process(void) | ^ | static 5 warnings generated. -- In file included from kernel/livepatch/core.c:16: In file included from include/linux/kallsyms.h:12: In file included from include/linux/mm.h:1581: include/linux/vmstat.h:431:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 431 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ kernel/livepatch/core.c:71:16: warning: no previous prototype for function 'klp_check_patch_kprobed' [-Wmissing-prototypes] 71 | struct kprobe *klp_check_patch_kprobed(struct klp_patch *patch) | ^ kernel/livepatch/core.c:71:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 71 | struct kprobe *klp_check_patch_kprobed(struct klp_patch *patch) | ^ | static kernel/livepatch/core.c:942:12: warning: no previous prototype for function 'arch_klp_init_func' [-Wmissing-prototypes] 942 | int __weak arch_klp_init_func(struct klp_object *obj, struct klp_func *func) | ^ kernel/livepatch/core.c:942:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 942 | int __weak arch_klp_init_func(struct klp_object *obj, struct klp_func *func) | ^ | static kernel/livepatch/core.c:1342:12: warning: no previous prototype for function 'arch_klp_check_calltrace' [-Wmissing-prototypes] 1342 | int __weak arch_klp_check_calltrace(bool (*fn)(void *, int *, unsigned long), void *data) | ^ kernel/livepatch/core.c:1342:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1342 | int __weak arch_klp_check_calltrace(bool (*fn)(void *, int *, unsigned long), void *data) | ^ | static
kernel/livepatch/core.c:1347:13: warning: no previous prototype for function 'arch_check_jump_insn' [-Wmissing-prototypes]
1347 | bool __weak arch_check_jump_insn(unsigned long func_addr) | ^ kernel/livepatch/core.c:1347:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1347 | bool __weak arch_check_jump_insn(unsigned long func_addr) | ^ | static kernel/livepatch/core.c:1352:12: warning: no previous prototype for function 'arch_klp_check_activeness_func' [-Wmissing-prototypes] 1352 | int __weak arch_klp_check_activeness_func(struct klp_func *func, int enable, | ^ kernel/livepatch/core.c:1352:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1352 | int __weak arch_klp_check_activeness_func(struct klp_func *func, int enable, | ^ | static kernel/livepatch/core.c:1621:5: warning: no previous prototype for function 'klp_try_disable_patch' [-Wmissing-prototypes] 1621 | int klp_try_disable_patch(void *data) | ^ kernel/livepatch/core.c:1621:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1621 | int klp_try_disable_patch(void *data) | ^ | static kernel/livepatch/core.c:1655:13: warning: no previous prototype for function 'arch_klp_code_modify_prepare' [-Wmissing-prototypes] 1655 | void __weak arch_klp_code_modify_prepare(void) | ^ kernel/livepatch/core.c:1655:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1655 | void __weak arch_klp_code_modify_prepare(void) | ^ | static kernel/livepatch/core.c:1659:13: warning: no previous prototype for function 'arch_klp_code_modify_post_process' [-Wmissing-prototypes] 1659 | void __weak arch_klp_code_modify_post_process(void) | ^ kernel/livepatch/core.c:1659:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1659 | void __weak arch_klp_code_modify_post_process(void) | ^ | static kernel/livepatch/core.c:1663:14: warning: no previous prototype for function 'arch_klp_mem_alloc' [-Wmissing-prototypes] 1663 | void __weak *arch_klp_mem_alloc(size_t size) | ^ kernel/livepatch/core.c:1663:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1663 | void __weak *arch_klp_mem_alloc(size_t size) | ^ | static kernel/livepatch/core.c:1668:13: warning: no previous prototype for function 'arch_klp_mem_free' [-Wmissing-prototypes] 1668 | void __weak arch_klp_mem_free(void *mem) | ^ kernel/livepatch/core.c:1668:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1668 | void __weak arch_klp_mem_free(void *mem) | ^ | static kernel/livepatch/core.c:1696:13: warning: no previous prototype for function 'arch_klp_set_brk_func' [-Wmissing-prototypes] 1696 | void __weak arch_klp_set_brk_func(struct klp_func_node *func_node, void *new_func) | ^ kernel/livepatch/core.c:1696:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1696 | void __weak arch_klp_set_brk_func(struct klp_func_node *func_node, void *new_func) | ^ | static kernel/livepatch/core.c:2108:5: warning: no previous prototype for function 'klp_try_enable_patch' [-Wmissing-prototypes] 2108 | int klp_try_enable_patch(void *data) | ^ kernel/livepatch/core.c:2108:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 2108 | int klp_try_enable_patch(void *data) | ^ | static 13 warnings generated.
vim +/arch_check_jump_insn +55 arch/x86/kernel/livepatch.c
54
55 bool arch_check_jump_insn(unsigned long func_addr)
56 { 57 int len = JMP_E9_INSN_SIZE; 58 struct insn insn; 59 u8 *addr = (u8*)func_addr; 60 61 do { 62 if (is_jump_insn(addr)) 63 return true; 64 insn_init(&insn, addr, MAX_INSN_SIZE, 1); 65 insn_get_length(&insn); 66 if (!insn.length || !insn_complete(&insn)) 67 return true; 68 len -= insn.length; 69 addr += insn.length; 70 } while (len > 0); 71 72 return false; 73 } 74