提交 a9fdad35 编写于 作者: Y Ye Weihua 提交者: Zheng Zengkai

livepatch: Add state describe for force

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

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

The force field is divided into three states. KLP_NORMAL_FORCE
indicates that a hot patch is installed according to the initial
rule. KLP_ENFORCMENT indicates that the hot patch of the function
must be installed. KLP_STACK_OPTIMIZE is prepared for stack
optimization policy.
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>
上级 17ca3935
......@@ -99,7 +99,7 @@ static int klp_check_activeness_func(struct stackframe *frame, void *data)
for (obj = patch->objs; obj->funcs; obj++) {
for (func = obj->funcs; func->old_name; func++) {
if (args->enable) {
if (func->force)
if (func->force == KLP_ENFORCEMENT)
continue;
/*
* When enable, checking the currently
......
......@@ -104,7 +104,7 @@ static bool klp_check_activeness_func(void *data, unsigned long pc)
for (obj = patch->objs; obj->funcs; obj++) {
for (func = obj->funcs; func->old_name; func++) {
if (args->enable) {
if (func->force)
if (func->force == KLP_ENFORCEMENT)
continue;
/*
* When enable, checking the currently
......
......@@ -93,7 +93,7 @@ static int klp_check_activeness_func(struct stackframe *frame, void *data)
for (obj = patch->objs; obj->funcs; obj++) {
for (func = obj->funcs; func->old_name; func++) {
if (args->enable) {
if (func->force)
if (func->force == KLP_ENFORCEMENT)
continue;
/*
* When enable, checking the currently
......
......@@ -132,7 +132,7 @@ static int klp_check_activeness_func(struct stackframe *frame, void *data)
/* Check func address in stack */
if (args->enable) {
if (func->force)
if (func->force == KLP_ENFORCEMENT)
continue;
/*
* When enable, checking the currently
......
......@@ -90,7 +90,7 @@ static int klp_check_stack_func(struct klp_func *func,
#endif
if (enable) {
if (func->force)
if (func->force == KLP_ENFORCEMENT)
continue;
/*
* When enable, checking the currently active
......
......@@ -23,6 +23,10 @@
#define KLP_UNPATCHED 0
#define KLP_PATCHED 1
#define KLP_NORMAL_FORCE 0
#define KLP_ENFORCEMENT 1
#define KLP_STACK_OPTIMIZE 2
/**
* struct klp_func - function structure for live patching
* @old_name: name of the function to be patched
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册