提交 8dfbc4e3 编写于 作者: Y Yang Jihong 提交者: Zheng Zengkai

livepatch: Add arch_klp_init

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5CJ7X

--------------------------------

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: NYang Jihong <yangjihong1@huawei.com>
Reviewed-by: NXu Kuohai <xukuohai@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a0f76f56
...@@ -256,6 +256,8 @@ int klp_compare_address(unsigned long pc, unsigned long func_addr, ...@@ -256,6 +256,8 @@ int klp_compare_address(unsigned long pc, unsigned long func_addr,
return 0; return 0;
} }
void arch_klp_init(void);
#endif #endif
int klp_apply_section_relocs(struct module *pmod, Elf_Shdr *sechdrs, int klp_apply_section_relocs(struct module *pmod, Elf_Shdr *sechdrs,
......
...@@ -1403,6 +1403,10 @@ long __weak arch_klp_save_old_code(struct arch_klp_data *arch_data, void *old_fu ...@@ -1403,6 +1403,10 @@ long __weak arch_klp_save_old_code(struct arch_klp_data *arch_data, void *old_fu
return -ENOSYS; return -ENOSYS;
} }
void __weak arch_klp_init(void)
{
}
int __weak arch_klp_check_breakpoint(struct arch_klp_data *arch_data, void *old_func) int __weak arch_klp_check_breakpoint(struct arch_klp_data *arch_data, void *old_func)
{ {
return 0; return 0;
...@@ -2293,6 +2297,9 @@ static int __init klp_init(void) ...@@ -2293,6 +2297,9 @@ static int __init klp_init(void)
if (!klp_root_kobj) if (!klp_root_kobj)
goto error_remove; goto error_remove;
#ifdef CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY
arch_klp_init();
#endif
return 0; return 0;
error_remove: error_remove:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册