From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) (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 37EBF331EBA for ; Fri, 31 Jul 2026 21:53:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785534803; cv=none; b=CQB5HHWQabf2zjA2dqr/1bC0LAxozjI7H6fHdupUIdeF4h2qMLvFiANZvCzb1hUrFZGMhudD9/rKicS5W+740DbXI2aCsIHz3OMmrchCk1AVbts9dsFb/GOU+B91SmpubKu2C1/p9T7cBuZr/tlkXkwM+esOZwt1VKM/579Ji6I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785534803; c=relaxed/simple; bh=VlFqQBVHRVeDKOQGdRirMGbhxjDhGYQc4+JPJwShZMM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=LLwEg+B9fy8LcEKNadVLiQ7/UsilKCYLLysgT6Ezs7qnmYkdwoKq8Zsq0xdD98wQf2IPkY8HF4V5fN6bvgBfzRywCpD1/cp+mwNqpw/0wVt8E02mZcAC9tzq7aoUquNGySnZKOXGmARg/il8/fiOCIksg9ToDcPJgnZ/nW7pYyQ= 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=nrcWwsGr; arc=none smtp.client-ip=209.85.215.197 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="nrcWwsGr" Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-c9fe4c5eb39so1001230a12.1 for ; Fri, 31 Jul 2026 14:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785534801; x=1786139601; 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=IXN1kpPZzQWxyZLtIWIq6X9QJe/5QaMTFSKsE0QskIU=; b=nrcWwsGrEwy8WK9eGsOyKqWxxE7vHTc0+6qHuFwS/gCtjrY1lwa+lKRFmx2if49pL8 lfB/d5hyllDVR21NqOtgfCIS65pbtFpBPuKAojhL5ezGddIsVYkt9q+b22oKSYXPUXNR 7+CSia79TsPziT3J9YRb5jToG+VP7Xcb/kVwk/tzZS6zYDtyi95xwcAOANXv+JVLXrfh mvY1is6WhjFlukrkrE1w0dthVms8AjlFl88JJ5/m+Rkci7jPg0s6llOObEHk6FgtDg5j 0/2d1h4VpxywITvlVeESRDq5b3uZcYoJXVZ+taAomBD6I3Nc59raMelWuG9G3jLqHIDc sd1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785534801; x=1786139601; 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=IXN1kpPZzQWxyZLtIWIq6X9QJe/5QaMTFSKsE0QskIU=; b=lSAbYmujV1aTj6ttc91CvJNyikvFITrwUdZAtMAlkFkUabQI7RG8YOx8pcxkEybXVs dIz8JAj/qsDPPZRFkHgHMbw9F/mn2z+xv/3H0pqjKb8iVDHqBsueTEdabQoDUW0ziuvo ZdvaSu5fugXXE9KQwNKR09G+jYvVWVnggsT7ci6asDKMWkNzQIbhQ1IFuKhDNdO91oN6 HoH2oZeKdkREbGnZnpd+ac2f69RqsiwQgulgAhnNdP5NYnVpKlBjiQOGkKlPr5g/aAyG TxQXBzvMkNI2X/3jnKyNp0+mNcZlsyjqkFcKfXEfUDm/PkR2dt2tyC0WvFXfmIPlfpJb qchA== X-Forwarded-Encrypted: i=1; AHgh+RrolKMsdzanB93/8jTAKT+xqm07dLeflMR/GSK1k2tBk6A3Vs65VOA20OVDJDRkwH0X0D7lw2OwWk1/Fp8=@vger.kernel.org X-Gm-Message-State: AOJu0YzRPRik209GJZDpi09c7uUo2necGE9wUMqumTVN6wIRsiBUbP0k V13z2ymkM7c/OlJwIj223vpfGjoGmf8QPh+thfB/uPJRXNkXSFAHZfl5RgKyOa2Bo13GiZ3aspz gADW62IhLqehxS4wKPXFVzA== X-Received: from dybkz17.prod.google.com ([2002:a05:7301:1a11:b0:313:b255:3ca2]) (user=loganodell job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:3393:b0:3b1:a9ce:507e with SMTP id adf61e73a8af0-3c92a60a0f1mr1289190637.32.1785534801433; Fri, 31 Jul 2026 14:53:21 -0700 (PDT) Date: Fri, 31 Jul 2026 14:52:21 -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-2-loganodell@google.com> Subject: [RFC PATCH 1/4] kho: Move subtree blob logic to separate function 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" Move the logic to set the blob data in a subtree node into a separate function to allow for re-use. No functional change. Signed-off-by: Logan Odell --- kernel/liveupdate/kexec_handover.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c index cc68a3692905..29a05cec2625 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -722,6 +722,21 @@ static void __init kho_reserve_scratch(void) kho_enable = false; } +static int kho_add_subtree_node(const char *name, void *root_fdt, void *fdt, int off) +{ + int err; + phys_addr_t phys = virt_to_phys(fdt); + + err = fdt_setprop(root_fdt, off, KHO_FDT_SUB_TREE_PROP_NAME, + &phys, sizeof(phys)); + if (err) + return err; + + WARN_ON_ONCE(kho_debugfs_fdt_add(&kho_out.dbg, name, fdt, false)); + + return 0; +} + /** * kho_add_subtree - record the physical address of a sub FDT in KHO root tree. * @name: name of the sub tree. @@ -739,7 +754,6 @@ static void __init kho_reserve_scratch(void) */ int kho_add_subtree(const char *name, void *fdt) { - phys_addr_t phys = virt_to_phys(fdt); void *root_fdt = kho_out.fdt; int err = -ENOMEM; int off, fdt_err; @@ -757,12 +771,7 @@ int kho_add_subtree(const char *name, void *fdt) goto out_pack; } - err = fdt_setprop(root_fdt, off, KHO_FDT_SUB_TREE_PROP_NAME, - &phys, sizeof(phys)); - if (err < 0) - goto out_pack; - - WARN_ON_ONCE(kho_debugfs_fdt_add(&kho_out.dbg, name, fdt, false)); + err = kho_add_subtree_node(name, root_fdt, fdt, off); out_pack: fdt_pack(root_fdt); -- 2.55.0.508.g3f0d502094-goog