livepatch: Narrow the scope of the 'text_mutex' lock
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6NVPT -------------------------------- Currently, arch_klp_code_modify_{prepare, post_process} is implemented only in the x86 architecture. It is used to hold the 'text_mutex' lock before entering the stop_machine and modifying the code, and to release the lock after exiting the stop_machine. klp_mem_prepare() needs to hold the 'text_mutex' lock only when saving old instruction code on x86 to ensure that it holds valid instructions. Place klp_mem_prepare() before arch_klp_code_modify_prepare() and lock the save instruction action separately to narrow the 'text_mutex' lock. Signed-off-by:Li Huafei <lihuafei1@huawei.com> Reviewed-by:
Xu Kuohai <xukuohai@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com> Signed-off-by:
Zheng Yejian <zhengyejian1@huawei.com> Reviewed-by:
Xu Kuohai <xukuohai@huawei.com> Signed-off-by:
Jialin Zhang <zhangjialin11@huawei.com>
Loading
Please sign in to comment