From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 95685337103 for ; Fri, 14 Nov 2025 16:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763139576; cv=none; b=Ay/QMpZS/j1A/Sl/s/+vR/mNTToizA43T4trLzgndtYxlZXKfdnqQkmGQ9ay8xtdh2VBRSvJc41/p5f7fC5QRV8iup2/9Fql4/q22b6PaaaszYn/kkzut353AKRA3EU5X8aMBgkPVOWqg3lHRe4uCiI8EjhJkjGwTPN3xvEk3Yg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763139576; c=relaxed/simple; bh=7cmvOMMRkq7ABj9bLQADRb0yWVUhjMz3dsMaV2GWWsY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Nehv9vLd8hz1Wz5ePLOGs47KQlvedb9/gOl9tvVUTMvaNpUyA+RdRAutb1s3pWuV1Q57VwpJyYBhojDVR94P2vY3QYiwk3yqrlq91FQITkzhqkXW40qCXu0eeheKqLeZuehHnP96XB/zlZlxDt76XGixWNIbV6Qu0kwxbASF16o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kBi+hiwo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kBi+hiwo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4000C4CEF1; Fri, 14 Nov 2025 16:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763139576; bh=7cmvOMMRkq7ABj9bLQADRb0yWVUhjMz3dsMaV2GWWsY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kBi+hiwo08/9mOe6EG2q1yq84Ff8LNY2+8836aE5rlJv1D7bXe9pmypkSuifU3fh3 euRqZaH2A3RgYi3jrloTypTJDJhUPQeUGuHW82BCUf2KyIzhyYeeb658jkRzdPQltK BoOJ1jIdNh+OuaIDgwTIapMLlHt2quM88bE7z6cU25Q0yZjj0ckknCg4fYq3Sf62Yp JwGmvLddaxWMIQextoL4nvDn5pBlZ3oVE+kUdvU0PafBTjXvBXo5Jt8f6KtG2hRHlk dfH3RoNx5t9DgwYtIVGi0xW0bHL/YKRb+rCXX7J5BvokHxLQWzvi15ewRV65ck05tr 6IgfkYlkHBIWw== From: Pratyush Yadav To: Pasha Tatashin Cc: akpm@linux-foundation.org, bhe@redhat.com, rppt@kernel.org, jasonmiu@google.com, arnd@arndb.de, coxu@redhat.com, dave@vasilevsky.ca, ebiggers@google.com, graf@amazon.com, kees@kernel.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH v1 05/13] kho: Always expose output FDT in debugfs In-Reply-To: <20251114155358.2884014-6-pasha.tatashin@soleen.com> (Pasha Tatashin's message of "Fri, 14 Nov 2025 10:53:50 -0500") References: <20251114155358.2884014-1-pasha.tatashin@soleen.com> <20251114155358.2884014-6-pasha.tatashin@soleen.com> Date: Fri, 14 Nov 2025 17:59:32 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Fri, Nov 14 2025, Pasha Tatashin wrote: > Currently, the output FDT is added to debugfs only when KHO is > finalized and removed when aborted. > > There is no need to hide the FDT based on the state. Always expose it > starting from initialization. This aids the transition toward removing > the explicit abort functionality and converting KHO to be fully > stateless. > > Also, pre-zero the FDT tree so we do not expose random bits to the > user and to the next kernel. > > Signed-off-by: Pasha Tatashin > --- > kernel/liveupdate/kexec_handover.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c > index 83aca3b4af15..cd8641725343 100644 > --- a/kernel/liveupdate/kexec_handover.c > +++ b/kernel/liveupdate/kexec_handover.c > @@ -1147,8 +1147,6 @@ int kho_abort(void) > __kho_abort(); > kho_out.finalized = false; > > - kho_debugfs_fdt_remove(&kho_out.dbg, kho_out.fdt); > - > return 0; > } > > @@ -1219,9 +1217,6 @@ int kho_finalize(void) > > kho_out.finalized = true; > > - WARN_ON_ONCE(kho_debugfs_fdt_add(&kho_out.dbg, "fdt", > - kho_out.fdt, true)); > - > return 0; > } > > @@ -1310,7 +1305,7 @@ static __init int kho_init(void) > if (!kho_enable) > return 0; > > - fdt_page = alloc_page(GFP_KERNEL); > + fdt_page = alloc_page(GFP_KERNEL | __GFP_ZERO); If I read the series right, patch 9 will make this a full FDT with no subnodes. That makes a lot more sense than a zero page. Thinking out loud. For this patch, Reviewed-by: Pratyush Yadav > if (!fdt_page) { > err = -ENOMEM; > goto err_free_scratch; > @@ -1344,6 +1339,9 @@ static __init int kho_init(void) > init_cma_reserved_pageblock(pfn_to_page(pfn)); > } > > + WARN_ON_ONCE(kho_debugfs_fdt_add(&kho_out.dbg, "fdt", > + kho_out.fdt, true)); > + > return 0; > > err_free_fdt: -- Regards, Pratyush Yadav