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 8D0DA36C9ED for ; Mon, 11 May 2026 11:16:12 +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=1778498172; cv=none; b=dzy8P1FRti5pS/KMSuP8bZYSp7tgbgeDH2+nAu7xWWs0o6N/sPq8x6x8JYa2TP1uTji9+huNs9LWlUZKavLLazOCYpd32vrB4nJgZ9VEOZPkqHFOo/3z61QyKnZNJx8R7YSXh95yqOuilooYCZkhqdtSHMZi0HWsnQwNbXzcD6E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778498172; c=relaxed/simple; bh=Cgr7dbdvhm+vZKERk5dxhhhYWa222txnv0pTlKfbbPA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=SZnEBxnWzGcnwYpgTwZmOd5dSNswCr2RdISaxbcHjN6O3aJgLM3S9eZ4m5gxa5IPv95/RWfJAOq+AQopgmW5/NwZmgq20jGuLTZUyCavUD2VmXNvz4XMxFRMifqWnfYLv8NkSoaLT9MqXgjcQIAPIlSLMHjP4PnfEQJaEAQkLMM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XxDLx8OQ; 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="XxDLx8OQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C53BEC2BCB0; Mon, 11 May 2026 11:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778498172; bh=Cgr7dbdvhm+vZKERk5dxhhhYWa222txnv0pTlKfbbPA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=XxDLx8OQlTJzTWhzEJVMPQxzWbFEUDSCJSCegy80OPVoDTShXI2Tdm4lfz33ZL4PS 54OVbyNThxvluqIIA2UTAXbzddMOUCH20W5rJiX6TPY7tNr/+r3uBTk12Dp6STSbQ/ u4jk+TQanegSXftX5NC9CQary5YfBScG3s1SxsOyT475F4Wr1lWNik0F+ihmDe1Uaz lDpdL6DKACihz3aVjsR9LGkpGy3KUxYsqG2M4/Yz5JSnokvXMst9UVLl8a2USUBon7 sTvOeve5KCd2HBslzPxND+MbXaIwXB9+4qnspcwDN96IMiZP9ie8EAi0qJoR/knnq9 FJHkv5gIEzJkg== From: Pratyush Yadav To: Mike Rapoport Cc: Pasha Tatashin , sourabhjain@linux.ibm.com, jbouron@amazon.com, akpm@linux-foundation.org, linux-mm@kvack.org, bhe@redhat.com, linux-kernel@vger.kernel.org, dan.carpenter@linaro.org, rafael.j.wysocki@intel.com, piliu@redhat.com, kexec@lists.infradead.org, pratyush@kernel.org, graf@amazon.com, changyuanl@google.com, mario.limonciello@amd.com Subject: Re: [PATCH v2 1/3] kho: skip KHO data for context-preserving kexec In-Reply-To: (Mike Rapoport's message of "Mon, 11 May 2026 13:38:08 +0300") References: <20260506182039.2623553-5-pasha.tatashin@soleen.com> <20260506182039.2623553-6-pasha.tatashin@soleen.com> Date: Mon, 11 May 2026 13:16:08 +0200 Message-ID: <2vxzik8uci2v.fsf@kernel.org> 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 Mon, May 11 2026, Mike Rapoport wrote: > On Wed, May 06, 2026 at 02:20:41PM -0400, Pasha Tatashin wrote: >> A preserve_context kexec returns to the current kernel, which means the >> 2nd kernel does not use KHO data (and their memory spaces don't >> overlap). Passing KHO data to the 2nd kernel via setup_data or >> devicetree is unnecessary. >> >> Add a check in kho_fill_kimage() and return early if preserve_context is >> set, to avoid passing KHO state during context-preserving kexecs. >> >> Fixes: 3bdecc3c93f9 ("kexec: add KHO support to kexec file loads") >> Signed-off-by: Pasha Tatashin >> --- >> kernel/liveupdate/kexec_handover.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c >> index 4fde8325c49f..2eec2a169c83 100644 >> --- a/kernel/liveupdate/kexec_handover.c >> +++ b/kernel/liveupdate/kexec_handover.c >> @@ -1702,7 +1702,8 @@ int kho_fill_kimage(struct kimage *image) >> int err = 0; >> struct kexec_buf scratch; >> >> - if (!kho_enable || image->type == KEXEC_TYPE_CRASH) >> + if (!kho_enable || image->type == KEXEC_TYPE_CRASH || >> + image->preserve_context) >> return 0; > > Sashiko says it's unnecessary: > > https://sashiko.dev/#/patchset/20260506182039.2623553-5-pasha.tatashin@soleen.com > > I tend to agree :) Hmm, good point. I take back my suggestion then. -- Regards, Pratyush Yadav