From mboxrd@z Thu Jan 1 00:00:00 1970 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 0FC0136E49E for ; Mon, 9 Mar 2026 13:01:54 +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=1773061318; cv=none; b=eCXch/+/X1HMx0fjPggoWA7Yz1lsgf3B9PsKwQyu2pTF0VNO4THaQQ8lZwi5VUrG7aRI1P2F4r/YCwxlwFyWmQuiPXxw/eSj1/BDimQlN7FMAHkVJOrqoXVUCKQ4O42WjvD+mVkg28QaPAFaeQ+Hh6HTCOXhxRy1iThKBi0D6zk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773061318; c=relaxed/simple; bh=OZDn9MEK6I8p2Dzu4zsDHRxnGD9teUc0yyfLk7miwR8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MxLybeOMh3vlOWdpWa1Xz4hVwOfH8TPLdiHOZaeACKBsmdyvFAToqdDd2TO1O+yH9G3TLttlCRuF5sa1/CwxTm9pKBfA6yZS32Rj0mZIIFPECvF4Rn1hJEJ76kM8evmjseC3HYDZ3/LEGVTIcMKaJzfLHmrHeQattiXuWrvY+Xs= 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=NVFEsr7G; 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="NVFEsr7G" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xVZJ8HA1Bq2a4PhlPxh0lErV720ISPGpbYGMuWQZ5Lk=; b=NVFEsr7GEe+1IceOj9Tgde+bOM BC5ggZUCHv4FUkC8SvcoAo0kSlw6vUqgNYU0nkgjPTDujyZiRruV3N7EnE6SYJWyPj9GW4WINEhWf 8T8PeoS2LmMwfA6T+eHQ8RUJnDGNjuK24LvozWiuHSCEskCAwJpMcXL5gDGBnspQUvfeY+9264KwL a9FRenXm8GKp8RmaWOerp16NZe6KVgCBikixT/yAN8hbwjNjcrKabTTv5MN5+71FtdE9Kz0BtTDwF QrhlPTYFNs1zdtPbv+3n4gCqLylkfoz/64UetKXX2maA2RUtc2fcu0mUbn4pLW0isgBHZh+4mgGuL sksMAMIw==; 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 1vzaF2-002EbW-0v; Mon, 09 Mar 2026 13:01:48 +0000 Date: Mon, 9 Mar 2026 06:01:43 -0700 From: Breno Leitao To: Mike Rapoport Cc: Alexander Graf , Pasha Tatashin , Pratyush Yadav , linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org, usamaarif642@gmail.com, SeongJae Park , kernel-team@meta.com Subject: Re: [PATCH v7 4/6] kho: fix kho_in_debugfs_init() to handle non-FDT blobs Message-ID: References: <20260306-kho-v7-0-404d14c188bb@debian.org> <20260306-kho-v7-4-404d14c188bb@debian.org> 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=us-ascii Content-Disposition: inline In-Reply-To: X-Debian-User: leitao On Mon, Mar 09, 2026 at 10:22:50AM +0200, Mike Rapoport wrote: > On Fri, Mar 06, 2026 at 04:39:23AM -0800, Breno Leitao wrote: > > kho_in_debugfs_init() has two problems when displaying incoming > > sub-blobs in debugfs: > > > > 1. It uses the hardcoded property name "fdt" instead of > > KHO_FDT_SUB_TREE_PROP_NAME ("preserved-data"), so it never finds > > subtrees stored by the current kho_add_subtree(). > > > > 2. It calls fdt_totalsize() to determine blob sizes, which assumes > > all blobs are FDTs. This breaks for non-FDT blobs like struct > > kho_kexec_metadata. > > > > Fix both issues by using KHO_FDT_SUB_TREE_PROP_NAME to find subtrees > > and reading the "blob-size" property from the FDT (persisted by > > kho_add_subtree()) instead of calling fdt_totalsize(). > > > > Signed-off-by: Breno Leitao > > --- > > kernel/liveupdate/kexec_handover_debugfs.c | 38 ++++++++++++++++++++---------- > > 1 file changed, 26 insertions(+), 12 deletions(-) > > > > diff --git a/kernel/liveupdate/kexec_handover_debugfs.c b/kernel/liveupdate/kexec_handover_debugfs.c > > index 7a100f2bf3947..fc2baa8b104fd 100644 > > --- a/kernel/liveupdate/kexec_handover_debugfs.c > > +++ b/kernel/liveupdate/kexec_handover_debugfs.c > > @@ -13,6 +13,7 @@ > > #include > > #include > > #include > > +#include > > #include "kexec_handover_internal.h" > > > > static struct dentry *debugfs_root; > > @@ -121,23 +122,36 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt) > > fdt_for_each_subnode(child, fdt, 0) { > > int len = 0; > > const char *name = fdt_get_name(fdt, child, NULL); > > - const u64 *fdt_phys; > > - void *sub_fdt; > > - > > - fdt_phys = fdt_getprop(fdt, child, "fdt", &len); > > - if (!fdt_phys) > > + const u64 *blob_phys; > > + const u64 *blob_size; > > + void *blob; > > + size_t size; > > Do we really need two size variables? Can't we just have u64 *size and pass > *size to __kho_debugfs_blob_add()? We definitely can. let me respin with the other changes as well. Thanks for the review, --breno