[PATCHv7 7/7] liveupdate: kho: move kho debugfs directory to liveupdate

Pasha Tatashin posted 7 patches 3 months, 3 weeks ago
There is a newer version of this series
[PATCHv7 7/7] liveupdate: kho: move kho debugfs directory to liveupdate
Posted by Pasha Tatashin 3 months, 3 weeks ago
Now, that LUO and KHO both live under kernel/liveupdate, it makes
sense to also move the kho debugfs files to liveupdate/

The old names:
/sys/kernel/debug/kho/out/
/sys/kernel/debug/kho/in/

The new names:
/sys/kernel/debug/liveupdate/kho_out/
/sys/kernel/debug/liveupdate/kho_in/

Also, export the liveupdate_debufs_root, so future LUO selftests could
use it as well.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
---
 kernel/liveupdate/kexec_handover_debugfs.c  | 10 +++++-----
 kernel/liveupdate/kexec_handover_internal.h |  2 ++
 tools/testing/selftests/kho/init.c          |  2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/kernel/liveupdate/kexec_handover_debugfs.c b/kernel/liveupdate/kexec_handover_debugfs.c
index 46e9e6c0791f..454b7d34ddc3 100644
--- a/kernel/liveupdate/kexec_handover_debugfs.c
+++ b/kernel/liveupdate/kexec_handover_debugfs.c
@@ -15,7 +15,7 @@
 #include <linux/mm.h>
 #include "kexec_handover_internal.h"
 
-static struct dentry *debugfs_root;
+struct dentry *liveupdate_debugfs_root;
 
 struct fdt_debugfs {
 	struct list_head list;
@@ -118,7 +118,7 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt)
 
 	INIT_LIST_HEAD(&dbg->fdt_list);
 
-	dir = debugfs_create_dir("in", debugfs_root);
+	dir = debugfs_create_dir("kho_in", liveupdate_debugfs_root);
 	if (IS_ERR(dir)) {
 		err = PTR_ERR(dir);
 		goto err_out;
@@ -178,7 +178,7 @@ __init int kho_out_debugfs_init(struct kho_debugfs *dbg)
 
 	INIT_LIST_HEAD(&dbg->fdt_list);
 
-	dir = debugfs_create_dir("out", debugfs_root);
+	dir = debugfs_create_dir("kho_out", liveupdate_debugfs_root);
 	if (IS_ERR(dir))
 		return -ENOMEM;
 
@@ -212,8 +212,8 @@ __init int kho_out_debugfs_init(struct kho_debugfs *dbg)
 
 __init int kho_debugfs_init(void)
 {
-	debugfs_root = debugfs_create_dir("kho", NULL);
-	if (IS_ERR(debugfs_root))
+	liveupdate_debugfs_root = debugfs_create_dir("liveupdate", NULL);
+	if (IS_ERR(liveupdate_debugfs_root))
 		return -ENOENT;
 	return 0;
 }
diff --git a/kernel/liveupdate/kexec_handover_internal.h b/kernel/liveupdate/kexec_handover_internal.h
index 17ae101dc6ae..92798346fa5a 100644
--- a/kernel/liveupdate/kexec_handover_internal.h
+++ b/kernel/liveupdate/kexec_handover_internal.h
@@ -15,6 +15,8 @@ struct kho_debugfs {
 	struct list_head fdt_list;
 };
 
+extern struct dentry *liveupdate_debugfs_root;
+
 #else
 struct kho_debugfs {};
 #endif
diff --git a/tools/testing/selftests/kho/init.c b/tools/testing/selftests/kho/init.c
index 6d9e91d55d68..f0136a30ce8b 100644
--- a/tools/testing/selftests/kho/init.c
+++ b/tools/testing/selftests/kho/init.c
@@ -11,7 +11,7 @@
 /* from arch/x86/include/asm/setup.h */
 #define COMMAND_LINE_SIZE	2048
 
-#define KHO_FINALIZE "/debugfs/kho/out/finalize"
+#define KHO_FINALIZE "/debugfs/liveupdate/kho_out/finalize"
 #define KERNEL_IMAGE "/kernel"
 
 static int mount_filesystems(void)
-- 
2.51.0.915.g61a8936c21-goog
Re: [PATCHv7 7/7] liveupdate: kho: move kho debugfs directory to liveupdate
Posted by Mike Rapoport 3 months, 2 weeks ago
On Tue, Oct 21, 2025 at 08:57:19PM -0400, Pasha Tatashin wrote:
> Now, that LUO and KHO both live under kernel/liveupdate, it makes
> sense to also move the kho debugfs files to liveupdate/

But we don't have LUO yet :/
 
> The old names:
> /sys/kernel/debug/kho/out/
> /sys/kernel/debug/kho/in/
> 
> The new names:
> /sys/kernel/debug/liveupdate/kho_out/
> /sys/kernel/debug/liveupdate/kho_in/
> 
> Also, export the liveupdate_debufs_root, so future LUO selftests could
> use it as well.

Let's postpone this change until then.
TBH, I don't see anything wrong with KHO and LUO selftest debugfs files living at the top
level, i.e

/sys/kernel/debug/kho/
/sys/kernel/debug/luo_selftest

-- 
Sincerely yours,
Mike.
Re: [PATCHv7 7/7] liveupdate: kho: move kho debugfs directory to liveupdate
Posted by Pasha Tatashin 3 months, 2 weeks ago
On Thu, Oct 23, 2025 at 3:32 AM Mike Rapoport <rppt@kernel.org> wrote:
>
> On Tue, Oct 21, 2025 at 08:57:19PM -0400, Pasha Tatashin wrote:
> > Now, that LUO and KHO both live under kernel/liveupdate, it makes
> > sense to also move the kho debugfs files to liveupdate/
>
> But we don't have LUO yet :/

Yes, I need to update the comment :-)

>
> > The old names:
> > /sys/kernel/debug/kho/out/
> > /sys/kernel/debug/kho/in/
> >
> > The new names:
> > /sys/kernel/debug/liveupdate/kho_out/
> > /sys/kernel/debug/liveupdate/kho_in/
> >
> > Also, export the liveupdate_debufs_root, so future LUO selftests could
> > use it as well.
>
> Let's postpone this change until then.
> TBH, I don't see anything wrong with KHO and LUO selftest debugfs files living at the top
> level, i.e

It is not only about selftests, we are planning to add kexec telemetry
that is going to be using KHO, and that should also be placed in the
same directory. Let's keep them neatly in the same root directory, so
we can use them for LUO/KHO/Telemetry and perhaps for other reasons.

I also think, this patch is small, so it would be beneficial to land
it now, and make it easier for LUO, and soon to be sent out the
Telemetry series.

Pasha