[PATCH V3] selftests: livepatch: add test cases of stack_order sysfs interface

2024-10-25 Thread Wardenjohn
Add selftest test cases to sysfs attribute 'stack_order'. Suggested-by: Petr Mladek Signed-off-by: Wardenjohn --- .../testing/selftests/livepatch/test-sysfs.sh | 71 +++ 1 file changed, 71 insertions(+) diff --git a/tools/testing/selftests/livepatch/test-sysfs.s

[PATCH V2] selftests: livepatch: add test cases of stack_order sysfs interface

2024-10-24 Thread Wardenjohn
Add selftest test cases to sysfs attribute 'stack_order'. Suggested-by: Petr Mladek Signed-off-by: Wardenjohn --- .../testing/selftests/livepatch/test-sysfs.sh | 71 +++ 1 file changed, 71 insertions(+) diff --git a/tools/testing/selftests/livepatch/test-sysfs.s

[PATCH V5 1/1] livepatch: Add stack_order sysfs attribute

2024-10-23 Thread Wardenjohn
patch applied cat /sys/kernel/livepatch/livepatch_module/stack_order -> N means that livepatch_module is the Nth live patch applied Suggested-by: Petr Mladek Suggested-by: Miroslav Benes Suggested-by: Josh Poimboeuf Signed-off-by: Wardenjohn --- .../ABI/testing/sysfs-kernel-livep

[PATCH] selftests: livepatch: add test cases of stack_order sysfs interface

2024-10-11 Thread Wardenjohn
Add selftest test cases to sysfs attribute 'stack_order'. Signed-off-by: Wardenjohn --- .../testing/selftests/livepatch/test-sysfs.sh | 74 +++ 1 file changed, 74 insertions(+) diff --git a/tools/testing/selftests/livepatch/test-sysfs.sh b/tools/testing/selftests

[PATCH 0/1] selftests: livepatch: add test cases of stack_order sysfs

2024-10-11 Thread Wardenjohn
This patch add self test cases to 'stack_order' sysfs interface. I found some existing test modules dont set '.replace=true', which can be used in 'stack_order' test. So, use the existing module for selftests. Regards. Wardenjohn.

[PATCH 1/1] selftests: livepatch: add test cases of stack_order sysfs interface

2024-10-08 Thread Wardenjohn
Add selftest test cases to sysfs attribute 'stack_order'. Signed-off-by: Wardenjohn --- .../testing/selftests/livepatch/test-sysfs.sh | 71 +++ .../selftests/livepatch/test_modules/Makefile | 5 +- .../test_klp_livepatch_noreplace.c

[PATCH 0/1] selftests: livepatch: add test cases of stack_order sysfs

2024-10-08 Thread Wardenjohn
This patch add self test cases to 'stack_order' sysfs interface. Reuse test module of 'test_klp_livepatch'. However, some module in test_module have '.replace' enable. So, I set the replace value of the stack_order test module to false. Regards. Wardenjohn.

[PATCH V5 1/1] livepatch: Add stack_order sysfs attribute

2024-10-07 Thread Wardenjohn
patch applied cat /sys/kernel/livepatch/livepatch_module/stack_order -> N means that livepatch_module is the Nth live patch applied Suggested-by: Petr Mladek Suggested-by: Miroslav Benes Suggested-by: Josh Poimboeuf Signed-off-by: Wardenjohn --- .../ABI/testing/sysfs-kernel-livep

[PATCH V5 0/1] livepatch: Add "stack_order" sysfs attribute

2024-10-07 Thread Wardenjohn
ription of ABI Document Description. (Suggested by Petr & Josh) V4 -> V5: 1. Fix the typos from 'module' to 'modules' (found by Josh) Regards. Wardenjohn.

[PATCH V4 1/1] livepatch: Add stack_order sysfs attribute

2024-10-07 Thread Wardenjohn
patch applied cat /sys/kernel/livepatch/livepatch_module/stack_order -> N means that livepatch_module is the Nth live patch applied Suggested-by: Petr Mladek Suggested-by: Miroslav Benes Suggested-by: Josh Poimboeuf Signed-off-by: Wardenjohn --- .../ABI/testing/sysfs-kernel-livep

[PATCH V5 0/1] livepatch: Add "stack_order" sysfs attribute

2024-10-07 Thread Wardenjohn
ription of ABI Document Description. (Suggested by Petr & Josh) V4 -> V5: 1. Fix the typos from 'module' to 'modules' (found by Josh) Regards. Wardenjohn.

[PATCH] selftests: livepatch: add test case of stack_order sysfs interface

2024-10-07 Thread Wardenjohn
Add test case of stack_order sysfs interface of livepatch. Signed-off-by: Wardenjohn --- .../testing/selftests/livepatch/test-sysfs.sh | 24 +++ 1 file changed, 24 insertions(+) diff --git a/tools/testing/selftests/livepatch/test-sysfs.sh b/tools/testing/selftests/livepatch

[PATCH V4 1/1] livepatch: Add stack_order sysfs attribute

2024-10-07 Thread Wardenjohn
patch applied cat /sys/kernel/livepatch/livepatch_module/stack_order -> N means that livepatch_module is the Nth live patch applied Suggested-by: Petr Mladek Suggested-by: Miroslav Benes Suggested-by: Josh Poimboeuf Signed-off-by: Wardenjohn --- .../ABI/testing/sysfs-kernel-livep

[PATCH V4 0/1] livepatch: Add "stack_order" sysfs attribute

2024-10-07 Thread Wardenjohn
cription of ABI Document Description. (Suggested by Petr & Josh) Regards. Wardenjohn.

[PATCH V3 1/1] livepatch: Add "stack_order" sysfs attribute

2024-09-29 Thread Wardenjohn
patch applied cat /sys/kernel/livepatch/livepatch_module/stack_order -> N means that livepatch_module is the Nth live patch applied Suggested-by: Petr Mladek Suggested-by: Miroslav Benes Suggested-by: Josh Poimboeuf Signed-off-by: Wardenjohn --- .../ABI/testing/sysfs-kernel-livep

[PATCH V3 0/1] livepatch: Add "stack_order" sysfs attribute

2024-09-29 Thread Wardenjohn
ash 2 patches into 1. Update description of stack_order in ABI Document. (Suggested by Miroslav) 2. Update subject and commit log. (Suggested by Miroslav) 3. Update code format for some line of the patch. (Suggested by Miroslav) Regards. Wardenjohn.

[PATCH] Documentation: Add description to stack_order interface

2024-09-24 Thread Wardenjohn
Update description of klp_patch stack_order sysfs interface to livepatch ABI documentation. Signed-off-by: Wardenjohn diff --git a/Documentation/ABI/testing/sysfs-kernel-livepatch b/Documentation/ABI/testing/sysfs-kernel-livepatch index a5df9b4910dc..9cad725a69c7 100644 --- a/Documentation/ABI

[PATCH] livepatch: introduce 'stack_order' sysfs interface to klp_patch

2024-09-24 Thread Wardenjohn
gested-by: Petr Mladek Suggested-by: Miroslav Benes Suggested-by: Josh Poimboeuf Signed-off-by: Wardenjohn diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index ecbc9b6aba3a..914b7cabf8fe 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -346,6 +346,7

[PATCH 0/2] livepatch: introduce 'stack_order' sysfs interface to klp_patch

2024-09-24 Thread Wardenjohn
e suggestion from Petr, to make the meaning more clear, rename 'order' to 'stack_order'. 2. According to the suggestion from Petr and Miroslav, this patch now move the calculating process to stack_order_show function. Adding klp_mutex lock protection. Regards. Wardenjohn.

[PATCH 2/2] Documentation: Add description to klp_patch order interface

2024-09-20 Thread Wardenjohn
Update description of klp_patch order sysfs interface to livepatch ABI documentation. Signed-off-by: Wardenjohn diff --git a/Documentation/ABI/testing/sysfs-kernel-livepatch b/Documentation/ABI/testing/sysfs-kernel-livepatch index 3735d868013d..14218419b9ea 100644 --- a/Documentation/ABI

[PATCH 1/2] livepatch: introduce 'order' sysfs interface to klp_patch

2024-09-20 Thread Wardenjohn
: Petr Mladek Suggested-by: Miroslav Benes Suggested-by: Josh Poimboeuf Signed-off-by: Wardenjohn diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index 51a258c24ff5..0fbbc1636ebe 100644 --- a/include/linux/livepatch.h +++ b/include/linux/livepatch.h @@ -154,6 +154,7 @@

[PATCH 0/2] livepatch: introduce 'order' sysfs interface to klp_patch

2024-09-20 Thread Wardenjohn
'using' feature to klp_func. But now, we don't support 'using' feature to klp_func and make 'klp_ops' patch not necessary. Therefore, this new version is only introduce the sysfs feature of klp_patch 'order'. Regards. Wardenjohn.

[PATCH v4 2/2] livepatch: Add using attribute to klp_func for using function show

2024-08-27 Thread Wardenjohn
nction1 of patchN is under transition and unknown. Signed-off-by: Wardenjohn diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index d874aecc817b..5a6bacebd66f 100644 --- a/include/linux/livepatch.h +++ b/include/linux/livepatch.h @@ -57,6 +57,7 @@ struct klp_ops { * @nop:te

[PATCH v4 1/2] Introduce klp_ops into klp_func structure

2024-08-27 Thread Wardenjohn
ct klp_ops into include/linux/livepatch.h With this changes, we can get klp_ops of a klp_func easily. klp_find_ops can also be simple and straightforward. And we do not need to maintain one global list for now. Signed-off-by: Wardenjohn diff --git a/include/linux/livepatch.h b/include/linux/l

[PATCH v4 0/2] livepatch: Add using attribute to klp_func for using function

2024-08-27 Thread Wardenjohn
This patch introduce one sysfs attribute of "using" to klp_func. For example, if there are serval patches make changes to function "meminfo_proc_show", the attribute "enabled" of all the patch is 1. With this attribute, we can easily know the version enabling belongs to which patch. Changes v1 =>

[PATCH v3 2/2] livepatch: Add using attribute to klp_func for using function show

2024-08-21 Thread Wardenjohn
nction1 of patchN is under transition and unknown. Signed-off-by: Wardenjohn diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index d874aecc817b..5a6bacebd66f 100644 --- a/include/linux/livepatch.h +++ b/include/linux/livepatch.h @@ -57,6 +57,7 @@ struct klp_ops { * @nop:te

[PATCH v3 1/2] Introduce klp_ops into klp_func structure

2024-08-21 Thread Wardenjohn
1. Move klp_ops into klp_func structure. Rewrite the logic of klp_find_ops and other logic to get klp_ops of a function. 2. Move definition of struct klp_ops into include/linux/livepatch.h Signed-off-by: Wardenjohn diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index

[PATCH v3 0/2] livepatch: Add using attribute to klp_func for using function

2024-08-21 Thread Wardenjohn
This patch introduce one sysfs attribute of "using" to klp_func. For example, if there are serval patches make changes to function "meminfo_proc_show", the attribute "enabled" of all the patch is 1. With this attribute, we can easily know the version enabling belongs to which patch. Changes v1 =>

[PATCH] livepatch: introduce klp_func called interface

2024-05-19 Thread Wardenjohn
can easily find out which function is successfully called. Any testing process can make sure they have successfully cover all the patched function that changed with the help of this interface. Signed-off-by: Wardenjohn --- include/linux/livepatch.h | 2 ++ kernel/livepatch/core.c | 18 ++

[PATCH] livepatch: introduce klp_func called interface

2024-05-19 Thread Wardenjohn
Livepatch module usually used to modify kernel functions. If the patched function have bug, it may cause serious result such as kernel crash. This commit introduce a read only interface of livepatch sysfs interface. If a livepatch function is called, this sysfs interface "called" of the patched fu