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
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 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
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
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.
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
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 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
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 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
ription of ABI Document Description. (Suggested by Petr &
Josh)
V4 -> V5:
1. Fix the typos from 'module' to 'modules' (found by Josh)
Regards.
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 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
cription of ABI Document Description. (Suggested by Petr &
Josh)
Regards.
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
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.
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
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
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.
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
: 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 @@
'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.
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
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
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 =>
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
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
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 =>
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 ++
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
30 matches
Mail list logo