From nobody Mon Feb 9 12:24:28 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B42D35CB6E for ; Tue, 27 Jan 2026 14:38:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769524714; cv=none; b=m+T5kptIGl3rCK3rCIsC0WZVKFi8Ywr8tj7nAmhVyPm9N8RDhW448dGXvw5vzydS0yEzONw+kqRqHkaLHdCy7vtUBTzGJc4GTRayIkG6hKP0KzsklFShJg4qT4hQ6Ta5on63Uo3FKJKgbfcoyal7w1avApILzsxHGeTLmEYhe7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769524714; c=relaxed/simple; bh=fBFjGCRbh8U8cSZ/cSJa5284Iw7B+/T8EZSL8NRnjyA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OFZhOJwI9K/R/L2NinUz1dyleHy8XDlik7qXiZTpcLNxL8+DtjfQUIy39S2YMFVFs2IXhgrid69vO3QoHnAL/JqyjSkXErgQWjr2T0wqN6J+v4Yn5UkvwgP3gj+TaVEh2g/AVqc9M906DJGc5uTXJoNVPycbdNt5KsabACFXfVE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=none smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=PWIeUnf4; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="PWIeUnf4" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=dFfwAjrRh4mQezNKju2gMfLCWiP68PLgDj7Wjykp+Uk=; b=PWIeUnf4oRHiE9UCxOc8AVN6JC xK1rEZD0FYsudh4HY0nB/2APUnIfyspi1GgozGWy81LPauwPEzWarfK6+hVtmZjnJM9MEbtHP898j 0DZispTLlFbuzPwsGKECLGxXpt1+pOBCALScHcQWs525+5Lx434FvDRrd/jc8dfQXn64vA8YBYCM6 wioLHVH8lZNDSFVPoCxBhCd6vdQ4cRrOB/HOq+Kag5UhJgigSnyOjDyl/S3KN4bKSW3r+IKwQMTpX Se1rdaToknhAhpWqo+KeHQS3rdMi2eyG6UiBIQvVTD+Ugil5tVdiklKUXR2kYQScdj8PNH+QVuOTC tAlWcMdg==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1vkkD8-00H3bH-8P; Tue, 27 Jan 2026 14:38:30 +0000 From: Breno Leitao Date: Tue, 27 Jan 2026 06:37:37 -0800 Subject: [PATCH v6 2/4] kho: rename fdt parameter to blob in kho_add/remove_subtree() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-kho-v6-2-56f9396681c2@debian.org> References: <20260127-kho-v6-0-56f9396681c2@debian.org> In-Reply-To: <20260127-kho-v6-0-56f9396681c2@debian.org> To: Alexander Graf , Mike Rapoport , Pasha Tatashin , Pratyush Yadav Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org, usamaarif642@gmail.com, rmikey@meta.com, clm@fb.com, riel@surriel.com, Breno Leitao , SeongJae Park , kernel-team@meta.com X-Mailer: b4 0.15-dev-f4305 X-Developer-Signature: v=1; a=openpgp-sha256; l=9203; i=leitao@debian.org; h=from:subject:message-id; bh=fBFjGCRbh8U8cSZ/cSJa5284Iw7B+/T8EZSL8NRnjyA=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBpeM3WjdulbFNE7ZsiXr2cBZ7aAadiSvtDild7e Q1wcrkuPROJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaXjN1gAKCRA1o5Of/Hh3 bZDPD/9fwANioD6pzsQEgUpAGHOIhaG9zgspZi2bhghkFkExBaoAuxBUE5iLc2xetKfL0DlhiJH jGt8hTUWgXxy5gtjQDOipnwCjdpBoMCsSoRmDOVbaNN3SxImfFuO4IgOUd/9+2NdBYXllVqt65H Szo8P/ZISwyHgqpWrYuUWcPFhNUCY3JUexB27+OrufuiBcXrDF3PtfoAGSOmO5OfXsjgFkdhPz1 REiEc0dPmcs/RDJ5z6KnpVesEHIN8tI15Gz0sydtnUC0BdawEwgti36v5i2mDxeJ3qFwCoIubjw Jl/V1eE3JbIQI1GSbVeXIK+IS8XH5TPPBlBAVvGanCR9rQ3X55PVSfERC4KqDCeND2DRT1g1tDc gLDBsg9K2AWz17PLJhzJaoQR7E0E7SwbZRwVp3dh7pwTtWTvA60XtUncgosDbFTPHbze27A/JuH ld84Xnmz07hBvWm749O4quWzy/Eg6w6f+vgS67MvAs9trOGcerCBv+InGbyrssUyVDq1R9q5r0e raY7PjnMKgyMSmnpf/pSei/CFIeWTGZyUvlR8xBmuR4BoR6DsTtLuznHHBkPYrkcs3ayDgLD68Y xjsp51ZBU9dWvtk8clATOgHTA7JKzb69UlOMCN4mWYQmrGk2BzbI3siulFBcqybvCWHMm41ccEL Hes55jBXqIqrf7w== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao Since kho_add_subtree() now accepts arbitrary data blobs (not just FDTs), rename the parameter from 'fdt' to 'blob' to better reflect its purpose. Apply the same rename to kho_remove_subtree() for consistency. Also rename kho_debugfs_fdt_add() and kho_debugfs_fdt_remove() to kho_debugfs_blob_add() and kho_debugfs_blob_remove() respectively, with the same parameter rename from 'fdt' to 'blob'. Signed-off-by: Breno Leitao Reviewed-by: Mike Rapoport (Microsoft) --- include/linux/kexec_handover.h | 8 ++++---- kernel/liveupdate/kexec_handover.c | 25 +++++++++++++------------ kernel/liveupdate/kexec_handover_debugfs.c | 25 +++++++++++++------------ kernel/liveupdate/kexec_handover_internal.h | 16 ++++++++-------- 4 files changed, 38 insertions(+), 36 deletions(-) diff --git a/include/linux/kexec_handover.h b/include/linux/kexec_handover.h index abb1d324f42d0..0666cf298c7f4 100644 --- a/include/linux/kexec_handover.h +++ b/include/linux/kexec_handover.h @@ -32,8 +32,8 @@ void kho_restore_free(void *mem); struct folio *kho_restore_folio(phys_addr_t phys); struct page *kho_restore_pages(phys_addr_t phys, unsigned long nr_pages); void *kho_restore_vmalloc(const struct kho_vmalloc *preservation); -int kho_add_subtree(const char *name, void *fdt, size_t size); -void kho_remove_subtree(void *fdt); +int kho_add_subtree(const char *name, void *blob, size_t size); +void kho_remove_subtree(void *blob); int kho_retrieve_subtree(const char *name, phys_addr_t *phys); =20 void kho_memory_init(void); @@ -97,12 +97,12 @@ static inline void *kho_restore_vmalloc(const struct kh= o_vmalloc *preservation) return NULL; } =20 -static inline int kho_add_subtree(const char *name, void *fdt, size_t size) +static inline int kho_add_subtree(const char *name, void *blob, size_t siz= e) { return -EOPNOTSUPP; } =20 -static inline void kho_remove_subtree(void *fdt) { } +static inline void kho_remove_subtree(void *blob) { } =20 static inline int kho_retrieve_subtree(const char *name, phys_addr_t *phys) { diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index ad2da9e4e6a04..e87f77e43acef 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -723,13 +723,13 @@ static void __init kho_reserve_scratch(void) } =20 /** - * kho_add_subtree - record the physical address of a sub FDT in KHO root = tree. + * kho_add_subtree - record the physical address of a sub blob in KHO root= tree. * @name: name of the sub tree. - * @fdt: the sub tree blob. + * @blob: the sub tree blob. * @size: size of the blob in bytes. * * Creates a new child node named @name in KHO root FDT and records - * the physical address of @fdt. The pages of @fdt must also be preserved + * the physical address of @blob. The pages of @blob must also be preserved * by KHO for the new kernel to retrieve it after kexec. * * A debugfs blob entry is also created at @@ -738,9 +738,9 @@ static void __init kho_reserve_scratch(void) * * Return: 0 on success, error code on failure */ -int kho_add_subtree(const char *name, void *fdt, size_t size) +int kho_add_subtree(const char *name, void *blob, size_t size) { - phys_addr_t phys =3D virt_to_phys(fdt); + phys_addr_t phys =3D virt_to_phys(blob); void *root_fdt =3D kho_out.fdt; int err =3D -ENOMEM; int off, fdt_err; @@ -763,7 +763,8 @@ int kho_add_subtree(const char *name, void *fdt, size_t= size) if (err < 0) goto out_pack; =20 - WARN_ON_ONCE(kho_debugfs_fdt_add(&kho_out.dbg, name, fdt, size, false)); + WARN_ON_ONCE(kho_debugfs_blob_add(&kho_out.dbg, name, blob, + size, false)); =20 out_pack: fdt_pack(root_fdt); @@ -772,9 +773,9 @@ int kho_add_subtree(const char *name, void *fdt, size_t= size) } EXPORT_SYMBOL_GPL(kho_add_subtree); =20 -void kho_remove_subtree(void *fdt) +void kho_remove_subtree(void *blob) { - phys_addr_t target_phys =3D virt_to_phys(fdt); + phys_addr_t target_phys =3D virt_to_phys(blob); void *root_fdt =3D kho_out.fdt; int off; int err; @@ -796,7 +797,7 @@ void kho_remove_subtree(void *fdt) =20 if ((phys_addr_t)*val =3D=3D target_phys) { fdt_del_node(root_fdt, off); - kho_debugfs_fdt_remove(&kho_out.dbg, fdt); + kho_debugfs_blob_remove(&kho_out.dbg, blob); break; } } @@ -1402,9 +1403,9 @@ static __init int kho_init(void) init_cma_reserved_pageblock(pfn_to_page(pfn)); } =20 - WARN_ON_ONCE(kho_debugfs_fdt_add(&kho_out.dbg, "fdt", - kho_out.fdt, - fdt_totalsize(kho_out.fdt), true)); + WARN_ON_ONCE(kho_debugfs_blob_add(&kho_out.dbg, "fdt", + kho_out.fdt, + fdt_totalsize(kho_out.fdt), true)); =20 return 0; =20 diff --git a/kernel/liveupdate/kexec_handover_debugfs.c b/kernel/liveupdate= /kexec_handover_debugfs.c index 64970c88c483c..6fdb558669b7c 100644 --- a/kernel/liveupdate/kexec_handover_debugfs.c +++ b/kernel/liveupdate/kexec_handover_debugfs.c @@ -23,8 +23,9 @@ struct fdt_debugfs { struct dentry *file; }; =20 -static int __kho_debugfs_fdt_add(struct list_head *list, struct dentry *di= r, - const char *name, const void *fdt, size_t size) +static int __kho_debugfs_blob_add(struct list_head *list, struct dentry *d= ir, + const char *name, const void *blob, + size_t size) { struct fdt_debugfs *f; struct dentry *file; @@ -33,7 +34,7 @@ static int __kho_debugfs_fdt_add(struct list_head *list, = struct dentry *dir, if (!f) return -ENOMEM; =20 - f->wrapper.data =3D (void *)fdt; + f->wrapper.data =3D (void *)blob; f->wrapper.size =3D size; =20 file =3D debugfs_create_blob(name, 0400, dir, &f->wrapper); @@ -48,8 +49,8 @@ static int __kho_debugfs_fdt_add(struct list_head *list, = struct dentry *dir, return 0; } =20 -int kho_debugfs_fdt_add(struct kho_debugfs *dbg, const char *name, - const void *fdt, size_t size, bool root) +int kho_debugfs_blob_add(struct kho_debugfs *dbg, const char *name, + const void *blob, size_t size, bool root) { struct dentry *dir; =20 @@ -58,15 +59,15 @@ int kho_debugfs_fdt_add(struct kho_debugfs *dbg, const = char *name, else dir =3D dbg->sub_fdt_dir; =20 - return __kho_debugfs_fdt_add(&dbg->fdt_list, dir, name, fdt, size); + return __kho_debugfs_blob_add(&dbg->fdt_list, dir, name, blob, size); } =20 -void kho_debugfs_fdt_remove(struct kho_debugfs *dbg, void *fdt) +void kho_debugfs_blob_remove(struct kho_debugfs *dbg, void *blob) { struct fdt_debugfs *ff; =20 list_for_each_entry(ff, &dbg->fdt_list, list) { - if (ff->wrapper.data =3D=3D fdt) { + if (ff->wrapper.data =3D=3D blob) { debugfs_remove(ff->file); list_del(&ff->list); kfree(ff); @@ -130,8 +131,8 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg= , const void *fdt) goto err_rmdir; } =20 - err =3D __kho_debugfs_fdt_add(&dbg->fdt_list, dir, "fdt", fdt, - fdt_totalsize(fdt)); + err =3D __kho_debugfs_blob_add(&dbg->fdt_list, dir, "fdt", fdt, + fdt_totalsize(fdt)); if (err) goto err_rmdir; =20 @@ -150,8 +151,8 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg= , const void *fdt) continue; } sub_fdt =3D phys_to_virt(*fdt_phys); - err =3D __kho_debugfs_fdt_add(&dbg->fdt_list, sub_fdt_dir, name, - sub_fdt, fdt_totalsize(sub_fdt)); + err =3D __kho_debugfs_blob_add(&dbg->fdt_list, sub_fdt_dir, name, + sub_fdt, fdt_totalsize(sub_fdt)); if (err) { pr_warn("failed to add fdt %s to debugfs: %pe\n", name, ERR_PTR(err)); diff --git a/kernel/liveupdate/kexec_handover_internal.h b/kernel/liveupdat= e/kexec_handover_internal.h index a51f97f0fa0e6..080a62ad61ea3 100644 --- a/kernel/liveupdate/kexec_handover_internal.h +++ b/kernel/liveupdate/kexec_handover_internal.h @@ -29,19 +29,19 @@ int kho_finalize(void); int kho_debugfs_init(void); void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt); int kho_out_debugfs_init(struct kho_debugfs *dbg); -int kho_debugfs_fdt_add(struct kho_debugfs *dbg, const char *name, - const void *fdt, size_t size, bool root); -void kho_debugfs_fdt_remove(struct kho_debugfs *dbg, void *fdt); +int kho_debugfs_blob_add(struct kho_debugfs *dbg, const char *name, + const void *blob, size_t size, bool root); +void kho_debugfs_blob_remove(struct kho_debugfs *dbg, void *blob); #else static inline int kho_debugfs_init(void) { return 0; } static inline void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt) { } static inline int kho_out_debugfs_init(struct kho_debugfs *dbg) { return 0= ; } -static inline int kho_debugfs_fdt_add(struct kho_debugfs *dbg, const char = *name, - const void *fdt, size_t size, - bool root) { return 0; } -static inline void kho_debugfs_fdt_remove(struct kho_debugfs *dbg, - void *fdt) { } +static inline int kho_debugfs_blob_add(struct kho_debugfs *dbg, + const char *name, const void *blob, + size_t size, bool root) { return 0; } +static inline void kho_debugfs_blob_remove(struct kho_debugfs *dbg, + void *blob) { } #endif /* CONFIG_KEXEC_HANDOVER_DEBUGFS */ =20 #ifdef CONFIG_KEXEC_HANDOVER_DEBUG --=20 2.47.3