hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8MGE6
--------------------------------
For the ARM architecture, need to register the callback function for processing BRK exception in advance. Therefore, the architecture-related init interface needs to be provided.
Signed-off-by: Yang Jihong yangjihong1@huawei.com Signed-off-by: Zheng Yejian zhengyejian1@huawei.com --- include/linux/livepatch.h | 2 ++ kernel/livepatch/core.c | 6 ++++++ 2 files changed, 8 insertions(+)
diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index bc2f1ba9b766..e6d9a794ad77 100644 --- a/include/linux/livepatch.h +++ b/include/linux/livepatch.h @@ -282,6 +282,8 @@ int klp_compare_address(unsigned long pc, unsigned long func_addr, return 0; }
+void arch_klp_init(void); + typedef int (*klp_add_func_t)(struct list_head *func_list, unsigned long func_addr, unsigned long func_size, const char *func_name, int force); diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 0633fe1c20d9..35a016c83ae2 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -2003,6 +2003,10 @@ long __weak arch_klp_save_old_code(struct arch_klp_data *arch_data, void *old_fu return -EINVAL; }
+void __weak arch_klp_init(void) +{ +} + int __weak arch_klp_check_breakpoint(struct arch_klp_data *arch_data, void *old_func) { return 0; @@ -2794,6 +2798,8 @@ static int __init klp_init(void) if (!klp_root_kobj) goto error_remove_state;
+ arch_klp_init(); + return 0;
error_remove_state: