diff options
Diffstat (limited to 'include/linux/livepatch.h')
-rw-r--r-- | include/linux/livepatch.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index 31db7a05dd36..a8828652f794 100644 --- a/include/linux/livepatch.h +++ b/include/linux/livepatch.h | |||
@@ -37,8 +37,9 @@ enum klp_state { | |||
37 | * struct klp_func - function structure for live patching | 37 | * struct klp_func - function structure for live patching |
38 | * @old_name: name of the function to be patched | 38 | * @old_name: name of the function to be patched |
39 | * @new_func: pointer to the patched function code | 39 | * @new_func: pointer to the patched function code |
40 | * @old_addr: a hint conveying at what address the old function | 40 | * @old_sympos: a hint indicating which symbol position the old function |
41 | * can be found (optional, vmlinux patches only) | 41 | * can be found (optional) |
42 | * @old_addr: the address of the function being patched | ||
42 | * @kobj: kobject for sysfs resources | 43 | * @kobj: kobject for sysfs resources |
43 | * @state: tracks function-level patch application state | 44 | * @state: tracks function-level patch application state |
44 | * @stack_node: list node for klp_ops func_stack list | 45 | * @stack_node: list node for klp_ops func_stack list |
@@ -48,16 +49,16 @@ struct klp_func { | |||
48 | const char *old_name; | 49 | const char *old_name; |
49 | void *new_func; | 50 | void *new_func; |
50 | /* | 51 | /* |
51 | * The old_addr field is optional and can be used to resolve | 52 | * The old_sympos field is optional and can be used to resolve |
52 | * duplicate symbol names in the vmlinux object. If this | 53 | * duplicate symbol names in livepatch objects. If this field is zero, |
53 | * information is not present, the symbol is located by name | 54 | * it is expected the symbol is unique, otherwise patching fails. If |
54 | * with kallsyms. If the name is not unique and old_addr is | 55 | * this value is greater than zero then that occurrence of the symbol |
55 | * not provided, the patch application fails as there is no | 56 | * in kallsyms for the given object is used. |
56 | * way to resolve the ambiguity. | ||
57 | */ | 57 | */ |
58 | unsigned long old_addr; | 58 | unsigned long old_sympos; |
59 | 59 | ||
60 | /* internal */ | 60 | /* internal */ |
61 | unsigned long old_addr; | ||
61 | struct kobject kobj; | 62 | struct kobject kobj; |
62 | enum klp_state state; | 63 | enum klp_state state; |
63 | struct list_head stack_node; | 64 | struct list_head stack_node; |
@@ -66,8 +67,7 @@ struct klp_func { | |||
66 | /** | 67 | /** |
67 | * struct klp_reloc - relocation structure for live patching | 68 | * struct klp_reloc - relocation structure for live patching |
68 | * @loc: address where the relocation will be written | 69 | * @loc: address where the relocation will be written |
69 | * @val: address of the referenced symbol (optional, | 70 | * @sympos: position in kallsyms to disambiguate symbols (optional) |
70 | * vmlinux patches only) | ||
71 | * @type: ELF relocation type | 71 | * @type: ELF relocation type |
72 | * @name: name of the referenced symbol (for lookup/verification) | 72 | * @name: name of the referenced symbol (for lookup/verification) |
73 | * @addend: offset from the referenced symbol | 73 | * @addend: offset from the referenced symbol |
@@ -75,7 +75,7 @@ struct klp_func { | |||
75 | */ | 75 | */ |
76 | struct klp_reloc { | 76 | struct klp_reloc { |
77 | unsigned long loc; | 77 | unsigned long loc; |
78 | unsigned long val; | 78 | unsigned long sympos; |
79 | unsigned long type; | 79 | unsigned long type; |
80 | const char *name; | 80 | const char *name; |
81 | int addend; | 81 | int addend; |