Commit a56f1237 authored by Zheng Yejian's avatar Zheng Yejian Committed by Zheng Zengkai
Browse files

livepatch: Use 'old_insns' to replace 'old_insn'

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



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

Structure 'arch_klp_data' contains fields which are used to save codes of
a function before patching. In arm, they are 'old_insns' and 'old_insn'
(depending on CONFIG_ARM_MODULE_PLTS enabled or not):
    struct arch_klp_data {
    #ifdef CONFIG_ARM_MODULE_PLTS
            u32 old_insns[LJMP_INSN_SIZE];
    #else
            u32 old_insn;
    #endif
    };

We can use array 'old_insns' to replace 'old_insn' so that no need to
depend on CONFIG_ARM_MODULE_PLTS.

The similar scenario exists in arm64, so we also do the optimization.

Suggested-by: default avatarXu Kuohai <xukuohai@huawei.com>
Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
Reviewed-by: default avatarKuohai Xu <xukuohai@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 1f9c1537
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment