From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03AE435F185 for ; Fri, 31 Jul 2026 21:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785534805; cv=none; b=sOzou9MvbUtXdEeO3qJAfcy070LOASJWNS30rqQWxUGHKKEVyKC0+FgCt85a0m/RSzTFN9pl9wPpm4iUNL9MzGRLBjJgD2fIhhiIsraFq30fuAsrmw4CP35XFxDnLUM+MpcCb7lpZY31bGUCJWBs5uTCxq/K7hOABp/t6vLxqAg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785534805; c=relaxed/simple; bh=4E8xyICGCcGsJ1StAscsDxgjIkTmBCAuU6VW+ox0bJI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=mkHwB8GmUkuu0Jj/KeLJqVixTXccDk+/QlxLM+1024BPXj0zfM38QGDhvdcvqpfAjPYgD4fF4yNbKWymM07f1S18YBprgxUMhUrXf9iqdxLn5idFEeXDz9MTmom5/r6EbSyOdmZPaCSpSJoGyPIDymSb/2OPaRCQQzsX7uSwx/I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--loganodell.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ptSRlaBD; arc=none smtp.client-ip=209.85.216.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--loganodell.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ptSRlaBD" Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38ea32e57e2so2655679a91.1 for ; Fri, 31 Jul 2026 14:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785534803; x=1786139603; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=als7b8ug69mz+jjevN//6dwMY7mF0ZGUUEH5Txoyuyo=; b=ptSRlaBDdRc8bGfNf4KamWfq8Z90lYin2lWzBqwN9e6l1rkm3Mm0WUUcIpNL2CWWlU hKSQgZj4InXpaOp3Vl3MbSZgQzEgSUBjoXgU1rlmlwNcyfjSdlwRL8evcsCr9pOpIOds SbERnjiCxq+qRXGYfrwCLLfxGXtY9+wWqvPGkHX3HLocagjoLjZfEeBnNXsxF6geoV2X 0c8V1bEAC3U5uS45qg7SCd8j73nuA/O9TzhUbQTSeJV8C+DSWBaW+2RLwW8IgIrT+k+a W6XM3+kFoTvx33eJdgMlD8DVDW+tWtRJYBtoxv5tkU5EJXExfTJkChqBVFPyxV5Ttdjq OKKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785534803; x=1786139603; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=als7b8ug69mz+jjevN//6dwMY7mF0ZGUUEH5Txoyuyo=; b=ehyr2LfV8fKhnTLCiRZX6o2M24YBF3GVDkhhGz6YlO6EnlFe8bYNRRnmd37cQE7Auh GOhLIG4gEVjeYmqyk6MxnoMdeP+ZWc/dJtKQD2IYjuqOuUP6tmWY8akybB3YhT+6n0bO By0t46NWQvQQCXC1I3jsW+tM82b+UpZ8pwnxbb3YJag0zwfRimL5QJ5c3wYSzjZAA988 TwylASBHPZDWYgo2jEGYkwzpJhMhGX0z5V+ydmHWa9QDcYSTtDnWmFjO2GB1OE7lAjbd ddK2awS9BNUBO+TO+st0guzi7pUO+7gh5r13tjaACtMOjTOY9Vw5rnsOWm3ZYHOWa7Gc i2BQ== X-Forwarded-Encrypted: i=1; AHgh+RpEjB78aBzHrrfYXjEotzD2rxAOELw2zaI5kudtdE2aOprd/61YzW541GVoMdWEIH+artvCINWwta66iJM=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1JuhUAf+5MueOipfJTWjunc3romlMbXWueMkwZRg8oEHY5P/l /bvdvrWNo/KONfR3/lDnYPl2Wg+XmQuDF3SZ6tbRYZmrUQjgOIQW4/Krtghd49i2XQKyB+uR/KF Zn1q9zcJiXPhmJEQWZwjrJw== X-Received: from dycmf5.prod.google.com ([2002:a05:693c:2485:b0:30f:42b1:df2b]) (user=loganodell job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2dc7:b0:37f:9ce2:348c with SMTP id 98e67ed59e1d1-38fbc4eead6mr1133723a91.29.1785534803101; Fri, 31 Jul 2026 14:53:23 -0700 (PDT) Date: Fri, 31 Jul 2026 14:52:23 -0700 In-Reply-To: <20260731215224.831696-1-loganodell@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260731215224.831696-1-loganodell@google.com> X-Mailer: git-send-email 2.55.0.508.g3f0d502094-goog Message-ID: <20260731215224.831696-4-loganodell@google.com> Subject: [RFC PATCH 3/4] kho: Add support for multiple versions to debugfs From: Logan Odell To: graf@amazon.com, rppt@kernel.org, pasha.tatashin@soleen.com Cc: pratyush@kernel.org, akpm@linux-foundation.org, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Logan Odell Content-Type: text/plain; charset="UTF-8" Update kho_in_debugfs_init to search for versioned subnodes (depth 2) and expose them as name-version in the input debugfs. This ensures versioned subtrees are visible to userspace for debugging, matching the behavior of the output side. Signed-off-by: Logan Odell --- kernel/liveupdate/kexec_handover_debugfs.c | 57 +++++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/kernel/liveupdate/kexec_handover_debugfs.c b/kernel/liveupdate/kexec_handover_debugfs.c index 2f93939168ab..2ca055219900 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; @@ -140,19 +141,49 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt) const u64 *fdt_phys; fdt_phys = fdt_getprop(fdt, child, "fdt", &len); - if (!fdt_phys) - continue; - if (len != sizeof(*fdt_phys)) { - pr_warn("node %s prop fdt has invalid length: %d\n", - name, len); - continue; - } - err = __kho_debugfs_fdt_add(&dbg->fdt_list, sub_fdt_dir, name, - phys_to_virt(*fdt_phys)); - if (err) { - pr_warn("failed to add fdt %s to debugfs: %pe\n", name, - ERR_PTR(err)); - continue; + if (fdt_phys) { + if (len != sizeof(*fdt_phys)) { + pr_warn("node %s prop fdt has invalid length: %d\n", + name, len); + continue; + } + err = __kho_debugfs_fdt_add(&dbg->fdt_list, sub_fdt_dir, name, + phys_to_virt(get_unaligned(fdt_phys))); + if (err) { + pr_warn("failed to add fdt %s to debugfs: %pe\n", name, + ERR_PTR(err)); + } + } else { + int grandchild; + + fdt_for_each_subnode(grandchild, fdt, child) { + const char *gc_name = fdt_get_name(fdt, grandchild, NULL); + const u64 *gc_fdt_phys; + char *combined_name; + + gc_fdt_phys = fdt_getprop(fdt, grandchild, "fdt", &len); + if (!gc_fdt_phys) + continue; + + if (len != sizeof(*gc_fdt_phys)) { + pr_warn("node %s/%s prop fdt has invalid length: %d\n", + name, gc_name, len); + continue; + } + + combined_name = kasprintf(GFP_KERNEL, "%s-%s", name, gc_name); + if (!combined_name) + continue; + + err = __kho_debugfs_fdt_add(&dbg->fdt_list, sub_fdt_dir, + combined_name, + phys_to_virt(get_unaligned(gc_fdt_phys))); + kfree(combined_name); + if (err) { + pr_warn("failed to add fdt %s-%s to debugfs: %pe\n", + name, gc_name, ERR_PTR(err)); + } + } } } -- 2.55.0.508.g3f0d502094-goog