Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] kho: housekeeping
@ 2026-11-27 12:25 Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 1/6] kho: build KHO objects into a single kho.o Pratyush Yadav
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Pratyush Yadav @ 2026-11-27 12:25 UTC (permalink / raw)
  To: Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Alexander Graf,
	Jonathan Corbet, Shuah Khan, Randy Dunlap, David Matlack,
	Bjorn Helgaas
  Cc: kexec, linux-mm, linux-doc, linux-kernel, linux-pci

From: "Pratyush Yadav (Google)" <pratyush@kernel.org>

Hi,

This series is a collection of miscellaneous cleanups for KHO. The
patches are all independent of each other for the most part. They are
kept in a series mainly to keep things easier to track and manage.

Patch 1 is lifted from [0]. All others are new.

[0] https://lore.kernel.org/kexec/20261116134013.1636689-3-pratyush@kernel.org/

Regards,
Pratyush Yadav

Pratyush Yadav (Google) (6):
  kho: build KHO objects into a single kho.o
  kho: use acronym for KHO .c files
  kho: move kho_{block,radix_tree}.h into include/linux/kho/
  kho: use unsigned long for kho_preserve_pages() and co when KHO=n
  kho: fix kernel-doc return for kho_alloc_preserve()
  kho: don't reference subtree blobs as FDTs

 Documentation/core-api/kho/index.rst          |  6 +--
 MAINTAINERS                                   |  3 +-
 drivers/pci/liveupdate.c                      |  2 +-
 include/linux/kexec_handover.h                |  6 +--
 include/linux/{kho_block.h => kho/block.h}    |  0
 .../{kho_radix_tree.h => kho/radix_tree.h}    |  0
 kernel/liveupdate/Makefile                    | 12 +++--
 kernel/liveupdate/kho_block.c                 |  2 +-
 .../{kexec_handover.c => kho_core.c}          |  8 +--
 ...kexec_handover_debugfs.c => kho_debugfs.c} | 54 +++++++++----------
 ...xec_handover_internal.h => kho_internal.h} | 10 ++--
 kernel/liveupdate/luo_core.c                  |  2 +-
 kernel/liveupdate/luo_internal.h              |  2 +-
 kernel/liveupdate/luo_session.c               |  2 +-
 14 files changed, 56 insertions(+), 53 deletions(-)
 rename include/linux/{kho_block.h => kho/block.h} (100%)
 rename include/linux/{kho_radix_tree.h => kho/radix_tree.h} (100%)
 rename kernel/liveupdate/{kexec_handover.c => kho_core.c} (99%)
 rename kernel/liveupdate/{kexec_handover_debugfs.c => kho_debugfs.c} (75%)
 rename kernel/liveupdate/{kexec_handover_internal.h => kho_internal.h} (87%)


base-commit: fcddbfa7a3693f1225a4d32b28401543b3bbedaf
-- 
2.56.1.839.g22a8290db9-goog



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/6] kho: build KHO objects into a single kho.o
  2026-11-27 12:25 [PATCH 0/6] kho: housekeeping Pratyush Yadav
@ 2026-11-27 12:25 ` Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 2/6] kho: use acronym for KHO .c files Pratyush Yadav
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Pratyush Yadav @ 2026-11-27 12:25 UTC (permalink / raw)
  To: Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Alexander Graf,
	Jonathan Corbet, Shuah Khan, Randy Dunlap, David Matlack,
	Bjorn Helgaas
  Cc: kexec, linux-mm, linux-doc, linux-kernel, linux-pci

From: "Pratyush Yadav (Google)" <pratyush@kernel.org>

kho_block.o is part of the KHO infrastructure, but is currently built as
part of luo.o, which ties it to CONFIG_LIVEUPDATE.

Group all KHO objects into a composite kho.o, built for
CONFIG_KEXEC_HANDOVER, the same way the LUO objects are grouped into
luo.o. This also gives a single place to add new KHO objects.

Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
---
 kernel/liveupdate/Makefile | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/kernel/liveupdate/Makefile b/kernel/liveupdate/Makefile
index d9f469462556..bc679905ce3f 100644
--- a/kernel/liveupdate/Makefile
+++ b/kernel/liveupdate/Makefile
@@ -1,13 +1,17 @@
 # SPDX-License-Identifier: GPL-2.0
 
+kho-y :=								\
+		kexec_handover.o				\
+		kho_block.o
+
+kho-$(CONFIG_KEXEC_HANDOVER_DEBUGFS) += kexec_handover_debugfs.o
+
+obj-$(CONFIG_KEXEC_HANDOVER)		+= kho.o
+
 luo-y :=								\
-		kho_block.o						\
 		luo_core.o						\
 		luo_file.o						\
 		luo_flb.o						\
 		luo_session.o
 
-obj-$(CONFIG_KEXEC_HANDOVER)		+= kexec_handover.o
-obj-$(CONFIG_KEXEC_HANDOVER_DEBUGFS)	+= kexec_handover_debugfs.o
-
 obj-$(CONFIG_LIVEUPDATE)		+= luo.o
-- 
2.56.1.839.g22a8290db9-goog



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/6] kho: use acronym for KHO .c files
  2026-11-27 12:25 [PATCH 0/6] kho: housekeeping Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 1/6] kho: build KHO objects into a single kho.o Pratyush Yadav
@ 2026-11-27 12:25 ` Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 3/6] kho: move kho_{block,radix_tree}.h into include/linux/kho/ Pratyush Yadav
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Pratyush Yadav @ 2026-11-27 12:25 UTC (permalink / raw)
  To: Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Alexander Graf,
	Jonathan Corbet, Shuah Khan, Randy Dunlap, David Matlack,
	Bjorn Helgaas
  Cc: kexec, linux-mm, linux-doc, linux-kernel, linux-pci

From: "Pratyush Yadav (Google)" <pratyush@kernel.org>

KHO started its life in kernel/. At the time, its name matched the
pattern of other kexec files like kexec_core.c or kexec_file.c.

Commit 48a1b2321d76 ("liveupdate: kho: move to kernel/liveupdate") moved
into liveupdate/. Files in liveupdate/ use acronyms like luo_core.c,
mainly because the wider context is already available in the directory
name.

Save some keystrokes and rename the kexec_handover_* files to kho_*.

Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
---
 Documentation/core-api/kho/index.rst                        | 2 +-
 MAINTAINERS                                                 | 2 +-
 kernel/liveupdate/Makefile                                  | 4 ++--
 kernel/liveupdate/{kexec_handover.c => kho_core.c}          | 4 ++--
 .../liveupdate/{kexec_handover_debugfs.c => kho_debugfs.c}  | 4 ++--
 .../{kexec_handover_internal.h => kho_internal.h}           | 6 +++---
 kernel/liveupdate/luo_core.c                                | 2 +-
 7 files changed, 12 insertions(+), 12 deletions(-)
 rename kernel/liveupdate/{kexec_handover.c => kho_core.c} (99%)
 rename kernel/liveupdate/{kexec_handover_debugfs.c => kho_debugfs.c} (97%)
 rename kernel/liveupdate/{kexec_handover_internal.h => kho_internal.h} (91%)

diff --git a/Documentation/core-api/kho/index.rst b/Documentation/core-api/kho/index.rst
index ce2bf9cf6651..fc759213ddb9 100644
--- a/Documentation/core-api/kho/index.rst
+++ b/Documentation/core-api/kho/index.rst
@@ -89,7 +89,7 @@ Kexec Handover Radix Tree
 Public API
 ==========
 
-.. kernel-doc:: kernel/liveupdate/kexec_handover.c
+.. kernel-doc:: kernel/liveupdate/kho_core.c
   :export:
 
 KHO Serialization Blocks API
diff --git a/MAINTAINERS b/MAINTAINERS
index a946fbbd74f0..fa9ee8051139 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14785,7 +14785,7 @@ F:	include/asm-generic/kexec_handover.h
 F:	include/linux/kexec_handover.h
 F:	include/linux/kho/
 F:	include/linux/kho_block.h
-F:	kernel/liveupdate/kexec_handover*
+F:	kernel/liveupdate/kho_*
 F:	lib/test_kho.c
 F:	tools/testing/selftests/kho/
 
diff --git a/kernel/liveupdate/Makefile b/kernel/liveupdate/Makefile
index bc679905ce3f..b73e19587f7f 100644
--- a/kernel/liveupdate/Makefile
+++ b/kernel/liveupdate/Makefile
@@ -1,10 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
 
 kho-y :=								\
-		kexec_handover.o				\
+		kho_core.o					\
 		kho_block.o
 
-kho-$(CONFIG_KEXEC_HANDOVER_DEBUGFS) += kexec_handover_debugfs.o
+kho-$(CONFIG_KEXEC_HANDOVER_DEBUGFS) += kho_debugfs.o
 
 obj-$(CONFIG_KEXEC_HANDOVER)		+= kho.o
 
diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kho_core.c
similarity index 99%
rename from kernel/liveupdate/kexec_handover.c
rename to kernel/liveupdate/kho_core.c
index 38e65d210cb9..7544bc0b99e5 100644
--- a/kernel/liveupdate/kexec_handover.c
+++ b/kernel/liveupdate/kho_core.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * kexec_handover.c - kexec handover metadata processing
+ * kho_core.c - kexec handover metadata processing
  * Copyright (C) 2023 Alexander Graf <graf@amazon.com>
  * Copyright (C) 2025 Microsoft Corporation, Mike Rapoport <rppt@kernel.org>
  * Copyright (C) 2025 Google LLC, Changyuan Lyu <changyuanl@google.com>
@@ -39,7 +39,7 @@
 #include "../../mm/mm_init.h"
 #include "../../mm/vmalloc.h"
 #include "../kexec_internal.h"
-#include "kexec_handover_internal.h"
+#include "kho_internal.h"
 
 /*
  * This is the minimal alignment required by deferred struct page init.
diff --git a/kernel/liveupdate/kexec_handover_debugfs.c b/kernel/liveupdate/kho_debugfs.c
similarity index 97%
rename from kernel/liveupdate/kexec_handover_debugfs.c
rename to kernel/liveupdate/kho_debugfs.c
index 3a91c47ad7a6..8d04368c1978 100644
--- a/kernel/liveupdate/kexec_handover_debugfs.c
+++ b/kernel/liveupdate/kho_debugfs.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * kexec_handover_debugfs.c - kexec handover debugfs interfaces
+ * kho_debugfs.c - kexec handover debugfs interfaces
  * Copyright (C) 2023 Alexander Graf <graf@amazon.com>
  * Copyright (C) 2025 Microsoft Corporation, Mike Rapoport <rppt@kernel.org>
  * Copyright (C) 2025 Google LLC, Changyuan Lyu <changyuanl@google.com>
@@ -13,7 +13,7 @@
 #include <linux/libfdt.h>
 #include <linux/mm.h>
 #include <linux/kho/abi/kexec_handover.h>
-#include "kexec_handover_internal.h"
+#include "kho_internal.h"
 
 static struct dentry *debugfs_root;
 
diff --git a/kernel/liveupdate/kexec_handover_internal.h b/kernel/liveupdate/kho_internal.h
similarity index 91%
rename from kernel/liveupdate/kexec_handover_internal.h
rename to kernel/liveupdate/kho_internal.h
index e9685e1ef6d7..5b349f451cf6 100644
--- a/kernel/liveupdate/kexec_handover_internal.h
+++ b/kernel/liveupdate/kho_internal.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef LINUX_KEXEC_HANDOVER_INTERNAL_H
-#define LINUX_KEXEC_HANDOVER_INTERNAL_H
+#ifndef LINUX_KHO_INTERNAL_H
+#define LINUX_KHO_INTERNAL_H
 
 #include <linux/kexec_handover.h>
 #include <linux/list.h>
@@ -41,4 +41,4 @@ static inline void kho_debugfs_blob_remove(struct kho_debugfs *dbg,
 					   void *blob) { }
 #endif /* CONFIG_KEXEC_HANDOVER_DEBUGFS */
 
-#endif /* LINUX_KEXEC_HANDOVER_INTERNAL_H */
+#endif /* LINUX_KHO_INTERNAL_H */
diff --git a/kernel/liveupdate/luo_core.c b/kernel/liveupdate/luo_core.c
index 1b2bda22902d..a9215eca9e7e 100644
--- a/kernel/liveupdate/luo_core.c
+++ b/kernel/liveupdate/luo_core.c
@@ -61,7 +61,7 @@
 #include <linux/sizes.h>
 #include <linux/string.h>
 
-#include "kexec_handover_internal.h"
+#include "kho_internal.h"
 #include "luo_internal.h"
 
 static struct {
-- 
2.56.1.839.g22a8290db9-goog



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/6] kho: move kho_{block,radix_tree}.h into include/linux/kho/
  2026-11-27 12:25 [PATCH 0/6] kho: housekeeping Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 1/6] kho: build KHO objects into a single kho.o Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 2/6] kho: use acronym for KHO .c files Pratyush Yadav
@ 2026-11-27 12:25 ` Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 4/6] kho: use unsigned long for kho_preserve_pages() and co when KHO=n Pratyush Yadav
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Pratyush Yadav @ 2026-11-27 12:25 UTC (permalink / raw)
  To: Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Alexander Graf,
	Jonathan Corbet, Shuah Khan, Randy Dunlap, David Matlack,
	Bjorn Helgaas
  Cc: kexec, linux-mm, linux-doc, linux-kernel, linux-pci

From: "Pratyush Yadav (Google)" <pratyush@kernel.org>

Hierarchical file systems have been around for a while now. Let's use
them.

Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
---
 Documentation/core-api/kho/index.rst                 | 4 ++--
 MAINTAINERS                                          | 1 -
 drivers/pci/liveupdate.c                             | 2 +-
 include/linux/{kho_block.h => kho/block.h}           | 0
 include/linux/{kho_radix_tree.h => kho/radix_tree.h} | 0
 kernel/liveupdate/kho_block.c                        | 2 +-
 kernel/liveupdate/kho_core.c                         | 2 +-
 kernel/liveupdate/luo_internal.h                     | 2 +-
 kernel/liveupdate/luo_session.c                      | 2 +-
 9 files changed, 7 insertions(+), 8 deletions(-)
 rename include/linux/{kho_block.h => kho/block.h} (100%)
 rename include/linux/{kho_radix_tree.h => kho/radix_tree.h} (100%)

diff --git a/Documentation/core-api/kho/index.rst b/Documentation/core-api/kho/index.rst
index fc759213ddb9..b09547e10ba2 100644
--- a/Documentation/core-api/kho/index.rst
+++ b/Documentation/core-api/kho/index.rst
@@ -83,7 +83,7 @@ the next KHO, because kexec can overwrite even the original kernel.
 Kexec Handover Radix Tree
 =========================
 
-.. kernel-doc:: include/linux/kho_radix_tree.h
+.. kernel-doc:: include/linux/kho/radix_tree.h
   :doc: Kexec Handover Radix Tree
 
 Public API
@@ -98,7 +98,7 @@ KHO Serialization Blocks API
 .. kernel-doc:: kernel/liveupdate/kho_block.c
   :doc: KHO Serialization Blocks
 
-.. kernel-doc:: include/linux/kho_block.h
+.. kernel-doc:: include/linux/kho/block.h
 
 .. kernel-doc:: kernel/liveupdate/kho_block.c
   :internal:
diff --git a/MAINTAINERS b/MAINTAINERS
index fa9ee8051139..4469f9978ecd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14784,7 +14784,6 @@ F:	Documentation/core-api/kho/*
 F:	include/asm-generic/kexec_handover.h
 F:	include/linux/kexec_handover.h
 F:	include/linux/kho/
-F:	include/linux/kho_block.h
 F:	kernel/liveupdate/kho_*
 F:	lib/test_kho.c
 F:	tools/testing/selftests/kho/
diff --git a/drivers/pci/liveupdate.c b/drivers/pci/liveupdate.c
index 76e939ea52eb..d99d2eb4e2ad 100644
--- a/drivers/pci/liveupdate.c
+++ b/drivers/pci/liveupdate.c
@@ -207,7 +207,7 @@
 #include <linux/io.h>
 #include <linux/kexec_handover.h>
 #include <linux/kho/abi/pci.h>
-#include <linux/kho_block.h>
+#include <linux/kho/block.h>
 #include <linux/liveupdate.h>
 #include <linux/mm.h>
 #include <linux/mutex.h>
diff --git a/include/linux/kho_block.h b/include/linux/kho/block.h
similarity index 100%
rename from include/linux/kho_block.h
rename to include/linux/kho/block.h
diff --git a/include/linux/kho_radix_tree.h b/include/linux/kho/radix_tree.h
similarity index 100%
rename from include/linux/kho_radix_tree.h
rename to include/linux/kho/radix_tree.h
diff --git a/kernel/liveupdate/kho_block.c b/kernel/liveupdate/kho_block.c
index 0d2a342ef422..6cedcd36bfd2 100644
--- a/kernel/liveupdate/kho_block.c
+++ b/kernel/liveupdate/kho_block.c
@@ -23,7 +23,7 @@
 #include <linux/io.h>
 #include <linux/kexec_handover.h>
 #include <linux/kho/abi/block.h>
-#include <linux/kho_block.h>
+#include <linux/kho/block.h>
 #include <linux/slab.h>
 
 /*
diff --git a/kernel/liveupdate/kho_core.c b/kernel/liveupdate/kho_core.c
index 7544bc0b99e5..3f9d408b9d29 100644
--- a/kernel/liveupdate/kho_core.c
+++ b/kernel/liveupdate/kho_core.c
@@ -18,7 +18,7 @@
 #include <linux/kasan.h>
 #include <linux/kexec.h>
 #include <linux/kexec_handover.h>
-#include <linux/kho_radix_tree.h>
+#include <linux/kho/radix_tree.h>
 #include <linux/utsname.h>
 #include <linux/kho/abi/kexec_handover.h>
 #include <linux/kho/abi/kexec_metadata.h>
diff --git a/kernel/liveupdate/luo_internal.h b/kernel/liveupdate/luo_internal.h
index dac6644bfb18..6c034be2d390 100644
--- a/kernel/liveupdate/luo_internal.h
+++ b/kernel/liveupdate/luo_internal.h
@@ -10,7 +10,7 @@
 
 #include <linux/liveupdate.h>
 #include <linux/uaccess.h>
-#include <linux/kho_block.h>
+#include <linux/kho/block.h>
 
 struct luo_ucmd {
 	void __user *ubuffer;
diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_session.c
index f1b86f701238..1ed914db513d 100644
--- a/kernel/liveupdate/luo_session.c
+++ b/kernel/liveupdate/luo_session.c
@@ -90,7 +90,7 @@
 #include <linux/fs.h>
 #include <linux/io.h>
 #include <linux/kexec_handover.h>
-#include <linux/kho_block.h>
+#include <linux/kho/block.h>
 #include <linux/kho/abi/luo.h>
 #include <linux/list.h>
 #include <linux/liveupdate.h>
-- 
2.56.1.839.g22a8290db9-goog



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/6] kho: use unsigned long for kho_preserve_pages() and co when KHO=n
  2026-11-27 12:25 [PATCH 0/6] kho: housekeeping Pratyush Yadav
                   ` (2 preceding siblings ...)
  2026-11-27 12:25 ` [PATCH 3/6] kho: move kho_{block,radix_tree}.h into include/linux/kho/ Pratyush Yadav
@ 2026-11-27 12:25 ` Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 5/6] kho: fix kernel-doc return for kho_alloc_preserve() Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 6/6] kho: don't reference subtree blobs as FDTs Pratyush Yadav
  5 siblings, 0 replies; 7+ messages in thread
From: Pratyush Yadav @ 2026-11-27 12:25 UTC (permalink / raw)
  To: Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Alexander Graf,
	Jonathan Corbet, Shuah Khan, Randy Dunlap, David Matlack,
	Bjorn Helgaas
  Cc: kexec, linux-mm, linux-doc, linux-kernel, linux-pci

From: "Pratyush Yadav (Google)" <pratyush@kernel.org>

Commit 840fe43d371f ("kho: use unsigned long for nr_pages") changed
nr_pages to unsigned long, but it forgot to update the KEXEC_HANDOVER=n
stubs.

Fixes: 840fe43d371f ("kho: use unsigned long for nr_pages")
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>

---

I don't think this is stable material since there is no problem in
practice.
---
 include/linux/kexec_handover.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/kexec_handover.h b/include/linux/kexec_handover.h
index ef2b188c8ed0..a20456b8da20 100644
--- a/include/linux/kexec_handover.h
+++ b/include/linux/kexec_handover.h
@@ -66,12 +66,12 @@ static inline int kho_preserve_folio(struct folio *folio)
 
 static inline void kho_unpreserve_folio(struct folio *folio) { }
 
-static inline int kho_preserve_pages(struct page *page, unsigned int nr_pages)
+static inline int kho_preserve_pages(struct page *page, unsigned long nr_pages)
 {
 	return -EOPNOTSUPP;
 }
 
-static inline void kho_unpreserve_pages(struct page *page, unsigned int nr_pages) { }
+static inline void kho_unpreserve_pages(struct page *page, unsigned long nr_pages) { }
 
 static inline int kho_preserve_vmalloc(void *ptr,
 				       struct kho_vmalloc *preservation)
@@ -95,7 +95,7 @@ static inline struct folio *kho_restore_folio(phys_addr_t phys)
 }
 
 static inline struct page *kho_restore_pages(phys_addr_t phys,
-					     unsigned int nr_pages)
+					     unsigned long nr_pages)
 {
 	return NULL;
 }
-- 
2.56.1.839.g22a8290db9-goog



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/6] kho: fix kernel-doc return for kho_alloc_preserve()
  2026-11-27 12:25 [PATCH 0/6] kho: housekeeping Pratyush Yadav
                   ` (3 preceding siblings ...)
  2026-11-27 12:25 ` [PATCH 4/6] kho: use unsigned long for kho_preserve_pages() and co when KHO=n Pratyush Yadav
@ 2026-11-27 12:25 ` Pratyush Yadav
  2026-11-27 12:25 ` [PATCH 6/6] kho: don't reference subtree blobs as FDTs Pratyush Yadav
  5 siblings, 0 replies; 7+ messages in thread
From: Pratyush Yadav @ 2026-11-27 12:25 UTC (permalink / raw)
  To: Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Alexander Graf,
	Jonathan Corbet, Shuah Khan, Randy Dunlap, David Matlack,
	Bjorn Helgaas
  Cc: kexec, linux-mm, linux-doc, linux-kernel, linux-pci

From: "Pratyush Yadav (Google)" <pratyush@kernel.org>

kernel-doc complains:

  No description found for return value of 'kho_alloc_preserve'

It does not recognize '@return'. Use 'Return' instead.

Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
---
 kernel/liveupdate/kho_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/liveupdate/kho_core.c b/kernel/liveupdate/kho_core.c
index 3f9d408b9d29..580cdb3ea070 100644
--- a/kernel/liveupdate/kho_core.c
+++ b/kernel/liveupdate/kho_core.c
@@ -1584,7 +1584,7 @@ EXPORT_SYMBOL_GPL(kho_restore_vmalloc);
  * Note: The actual allocated size will be rounded up to the nearest
  * power-of-two page boundary.
  *
- * @return A virtual pointer to the allocated and preserved memory on success,
+ * Return: A virtual pointer to the allocated and preserved memory on success,
  * or an ERR_PTR() encoded error on failure.
  */
 void *kho_alloc_preserve(size_t size)
-- 
2.56.1.839.g22a8290db9-goog



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 6/6] kho: don't reference subtree blobs as FDTs
  2026-11-27 12:25 [PATCH 0/6] kho: housekeeping Pratyush Yadav
                   ` (4 preceding siblings ...)
  2026-11-27 12:25 ` [PATCH 5/6] kho: fix kernel-doc return for kho_alloc_preserve() Pratyush Yadav
@ 2026-11-27 12:25 ` Pratyush Yadav
  5 siblings, 0 replies; 7+ messages in thread
From: Pratyush Yadav @ 2026-11-27 12:25 UTC (permalink / raw)
  To: Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Alexander Graf,
	Jonathan Corbet, Shuah Khan, Randy Dunlap, David Matlack,
	Bjorn Helgaas
  Cc: kexec, linux-mm, linux-doc, linux-kernel, linux-pci

From: "Pratyush Yadav (Google)" <pratyush@kernel.org>

KHO started out with using FDT for all subtrees. This is why debugfs
used "sub_fdts" as the directory name and in the code. Since then, KHO
subtrees started also using raw C structs for serialization. Commit
4916ae386760 ("kho: rename fdt parameter to blob in
kho_add/remove_subtree()") updated some of the code to match this
reality.

Still, references to sub FDTs were left around. The data structure to
track the blobs is still called fdt_debugfs, the list of blobs is called
"fdt_list", and most importantly, the subdirectory holding them in
debugfs is called "sub_fdts".

Update all this to use blob in the naming.

The only functional change is the rename of the debugfs subdirectory
from "sub_fdts" to "sub_blobs". Everything else is a pure rename.

Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
---
 kernel/liveupdate/kho_debugfs.c  | 50 ++++++++++++++++----------------
 kernel/liveupdate/kho_internal.h |  4 +--
 2 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/kernel/liveupdate/kho_debugfs.c b/kernel/liveupdate/kho_debugfs.c
index 8d04368c1978..1580e1a27566 100644
--- a/kernel/liveupdate/kho_debugfs.c
+++ b/kernel/liveupdate/kho_debugfs.c
@@ -17,7 +17,7 @@
 
 static struct dentry *debugfs_root;
 
-struct fdt_debugfs {
+struct kho_debugfs_blob {
 	struct list_head list;
 	struct debugfs_blob_wrapper wrapper;
 	struct dentry *file;
@@ -27,24 +27,24 @@ static int __kho_debugfs_blob_add(struct list_head *list, struct dentry *dir,
 				  const char *name, const void *blob,
 				  size_t size)
 {
-	struct fdt_debugfs *f;
+	struct kho_debugfs_blob *b;
 	struct dentry *file;
 
-	f = kmalloc_obj(*f);
-	if (!f)
+	b = kmalloc_obj(*b);
+	if (!b)
 		return -ENOMEM;
 
-	f->wrapper.data = (void *)blob;
-	f->wrapper.size = size;
+	b->wrapper.data = (void *)blob;
+	b->wrapper.size = size;
 
-	file = debugfs_create_blob(name, 0400, dir, &f->wrapper);
+	file = debugfs_create_blob(name, 0400, dir, &b->wrapper);
 	if (IS_ERR(file)) {
-		kfree(f);
+		kfree(b);
 		return PTR_ERR(file);
 	}
 
-	f->file = file;
-	list_add(&f->list, list);
+	b->file = file;
+	list_add(&b->list, list);
 
 	return 0;
 }
@@ -57,20 +57,20 @@ int kho_debugfs_blob_add(struct kho_debugfs *dbg, const char *name,
 	if (root)
 		dir = dbg->dir;
 	else
-		dir = dbg->sub_fdt_dir;
+		dir = dbg->sub_blob_dir;
 
-	return __kho_debugfs_blob_add(&dbg->fdt_list, dir, name, blob, size);
+	return __kho_debugfs_blob_add(&dbg->blob_list, dir, name, blob, size);
 }
 
 void kho_debugfs_blob_remove(struct kho_debugfs *dbg, void *blob)
 {
-	struct fdt_debugfs *ff;
+	struct kho_debugfs_blob *b;
 
-	list_for_each_entry(ff, &dbg->fdt_list, list) {
-		if (ff->wrapper.data == blob) {
-			debugfs_remove(ff->file);
-			list_del(&ff->list);
-			kfree(ff);
+	list_for_each_entry(b, &dbg->blob_list, list) {
+		if (b->wrapper.data == blob) {
+			debugfs_remove(b->file);
+			list_del(&b->list);
+			kfree(b);
 			break;
 		}
 	}
@@ -99,7 +99,7 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt)
 	struct dentry *dir;
 	int err;
 
-	INIT_LIST_HEAD(&dbg->fdt_list);
+	INIT_LIST_HEAD(&dbg->blob_list);
 
 	dir = debugfs_create_dir("in", debugfs_root);
 	if (IS_ERR(dir)) {
@@ -107,7 +107,7 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt)
 		goto err_out;
 	}
 
-	err = __kho_debugfs_blob_add(&dbg->fdt_list, dir, "fdt", fdt,
+	err = __kho_debugfs_blob_add(&dbg->blob_list, dir, "fdt", fdt,
 				     fdt_totalsize(fdt));
 	if (err)
 		goto err_rmdir;
@@ -131,16 +131,16 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt)
 
 __init int kho_out_debugfs_init(struct kho_debugfs *dbg)
 {
-	struct dentry *dir, *f, *sub_fdt_dir;
+	struct dentry *dir, *f, *sub_blob_dir;
 
-	INIT_LIST_HEAD(&dbg->fdt_list);
+	INIT_LIST_HEAD(&dbg->blob_list);
 
 	dir = debugfs_create_dir("out", debugfs_root);
 	if (IS_ERR(dir))
 		return -ENOMEM;
 
-	sub_fdt_dir = debugfs_create_dir("sub_fdts", dir);
-	if (IS_ERR(sub_fdt_dir))
+	sub_blob_dir = debugfs_create_dir("sub_blobs", dir);
+	if (IS_ERR(sub_blob_dir))
 		goto err_rmdir;
 
 	f = debugfs_create_file("bootmem_phys", 0400, dir, NULL,
@@ -154,7 +154,7 @@ __init int kho_out_debugfs_init(struct kho_debugfs *dbg)
 		goto err_rmdir;
 
 	dbg->dir = dir;
-	dbg->sub_fdt_dir = sub_fdt_dir;
+	dbg->sub_blob_dir = sub_blob_dir;
 	return 0;
 
 err_rmdir:
diff --git a/kernel/liveupdate/kho_internal.h b/kernel/liveupdate/kho_internal.h
index 5b349f451cf6..22950fe3bcc8 100644
--- a/kernel/liveupdate/kho_internal.h
+++ b/kernel/liveupdate/kho_internal.h
@@ -11,8 +11,8 @@
 
 struct kho_debugfs {
 	struct dentry *dir;
-	struct dentry *sub_fdt_dir;
-	struct list_head fdt_list;
+	struct dentry *sub_blob_dir;
+	struct list_head blob_list;
 };
 
 #else
-- 
2.56.1.839.g22a8290db9-goog



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-27 12:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 12:25 [PATCH 0/6] kho: housekeeping Pratyush Yadav
2026-11-27 12:25 ` [PATCH 1/6] kho: build KHO objects into a single kho.o Pratyush Yadav
2026-11-27 12:25 ` [PATCH 2/6] kho: use acronym for KHO .c files Pratyush Yadav
2026-11-27 12:25 ` [PATCH 3/6] kho: move kho_{block,radix_tree}.h into include/linux/kho/ Pratyush Yadav
2026-11-27 12:25 ` [PATCH 4/6] kho: use unsigned long for kho_preserve_pages() and co when KHO=n Pratyush Yadav
2026-11-27 12:25 ` [PATCH 5/6] kho: fix kernel-doc return for kho_alloc_preserve() Pratyush Yadav
2026-11-27 12:25 ` [PATCH 6/6] kho: don't reference subtree blobs as FDTs Pratyush Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox