livepatch: checks only if the replaced instruction is on the stack
hulk inclusion category: feature bugzilla: 119440 https://gitee.com/openeuler/kernel/issues/I4DDEL -------------------------------- When the CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY macro is turned on, the system checks whether the function to patch is on the stack under the stop_machine. If the function is on the stack, the livepatch cannot be patched and returns a busy signal. Hotspot functions are easily on the stack under the stop_machine condition. As a result, the livpatch success rate is low when the patch includes a hot function. For the repalced function, only the first seceral instructions are rewritten, and the rest of the instructions are the same as the original ones. Therefore, if the force flag is KLP_STACK_OPTIMIZE, only need to check whether the replaced instructions are on the stack. Signed-off-by: NYe Weihua <yeweihua4@huawei.com> Reviewed-by: NKuohai Xu <xukuohai@huawei.com> Signed-off-by: NChen Jun <chenjun102@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录