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 3A8D63D3D01 for ; Mon, 11 May 2026 10:38:17 +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=1778495897; cv=none; b=cYh8ca1NCEnRZcsmz1uwZ96vaH0Lck5t09nuTZlLtMpaixIep95tKBb1DxQsLQAz87BpI1GJlR8x/j4+v6G2+wapnNICaRka05Y4VIIO68UgS8o8ILZH7ZHs8a2bKh6RwqeNaXhVrSLzdWH+79iYWoNf0pzGTFbGGLm134tBtF8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778495897; c=relaxed/simple; bh=/5HeHYtYR3X7G2/ltDcaDNYVkBv+5CDR/1dSY68hK6U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T5aK7mZBIUBgBMFMZbbAJlhVPRN9euTXJArNYSnDpcMokitEjNHkibpq9wZ4D2SciweLy8/6zyzgYDT6cLv+fGGhLbW8r4cg3D4wSiSlbuNfvKQMtkzq55kBxiC+WslduUlqCXXSnbbAuwhmWJP8AOVTzYQZH2zzyE67WzXjmu8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iQ6e9yFF; 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="iQ6e9yFF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56287C2BCC9; Mon, 11 May 2026 10:38:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778495896; bh=/5HeHYtYR3X7G2/ltDcaDNYVkBv+5CDR/1dSY68hK6U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iQ6e9yFFbLBK9EIUuso90JtjHXZFN079j+U6DWcxrFgJWQ2PTwpzOgbyWXs4VFH16 wjjWxT61MuoHtWqV5F0O/ciED3sZNKoDUhwrP6oQ1oHkSyouJaeyBScU1D9lna8fIL znfciRTpn9Ym+eEckaq67/uz0npM533hUDJe1y07jYx50kE01WnbaYAx2beT93Eco8 P4EKPz5MTMBB5Eg6DjsqZxaSTD+4EaQFfICdKWtEh8S2/ZKnEaXKfP2XpITvg/xY0t mCmlO713v1JNcsETpFGkkeUooZ3jb+Endpu1Yd/zYugTuxsxYc+Hs5DjMQRyKY9hiS ADScn2yX/660A== Date: Mon, 11 May 2026 13:38:08 +0300 From: Mike Rapoport To: Pasha Tatashin Cc: 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 Message-ID: References: <20260506182039.2623553-5-pasha.tatashin@soleen.com> <20260506182039.2623553-6-pasha.tatashin@soleen.com> 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: <20260506182039.2623553-6-pasha.tatashin@soleen.com> 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 :) > image->kho.fdt = virt_to_phys(kho_out.fdt); > -- > 2.54.0.545.g6539524ca2-goog > -- Sincerely yours, Mike.