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 3EDFB47CC67 for ; Wed, 6 May 2026 15:33:56 +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=1778081637; cv=none; b=X5o3D3CdzU10KnHoHNjD9+dyxI8EkPweG2F3EQOFNpu7bKirHaoNdqg6RJefiow2LAj8nRJ6O2Vi2Zs09ZUf78lrb+0Ep4x8WVIAkKLsPMM3XSOXs7UqAAEio3uGFwML2hchP9t6qMDefTP4fZEkjfljBC7zrJyt/zrMfz60vkQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778081637; c=relaxed/simple; bh=KAAcsVlrAQHEn5ZduHvrTDwo6rEBUA9pxPhqYP8VLFY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=KAWWUm30AsQ1rxL0iklgEttfCHyqRkVyY2l0leC27Gt4pTgMhwXcJQFfNe0t2nnQmglW6jIwXU+BwD9rx4ahlrA4NkJVDix5FdqGLe6LoC1u7IMFsnd98TKi9dZVkBKp+iPI2mkxArisSAZ0UUWYZbApkjNgDJZO7GelU/fLrA0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UuvduOM4; 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="UuvduOM4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF5B2C4AF09; Wed, 6 May 2026 15:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778081636; bh=KAAcsVlrAQHEn5ZduHvrTDwo6rEBUA9pxPhqYP8VLFY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=UuvduOM4TMhGvVA0HGnkNRuQTeLyw6AuYYj2dpTXhyAqb86Tn5+FbuzmIqyVCWEKU QvbI0SAOEgiH8q1h+7jsaWusaVnGAHIFy/fsFAFXbeM49p5olkEBnW51Anrmdad1M9 7/MbeYpwijXwy6+DFzC68IcUrdFPr98iboHAiycH6e92h9NxXskNkFJSjn1Y4NcLi2 qgVlUZJ46/3lu46tTxpBqh78r+yLgUk4QAiQHnhuYo3VhG/9fgaGP9+YJ0jIVfX5F2 im5hKkPaUHmLKNXTLBzC3sB5vKdscEyjOKgetIQxvlOl7kfFYYuUEEo+xXD3GbfNUQ /PdQ+ST0beJmA== From: Pratyush Yadav To: Pasha Tatashin Cc: Pratyush Yadav , rppt@kernel.org, sourabhjain@linux.ibm.com, jbouron@amazon.com, akpm@linux-foundation.org, bhe@redhat.com, linux-kernel@vger.kernel.org, dan.carpenter@linaro.org, liaoyuanhong@vivo.com, rafael.j.wysocki@intel.com, piliu@redhat.com, kexec@lists.infradead.org, graf@amazon.com, mario.limonciello@amd.com Subject: Re: [PATCH v1 1/3] liveupdate: skip serialization for context-preserving kexec In-Reply-To: (Pasha Tatashin's message of "Wed, 6 May 2026 11:12:26 -0400") References: <20260506043200.2025677-5-pasha.tatashin@soleen.com> <20260506043200.2025677-6-pasha.tatashin@soleen.com> <2vxz34050wi7.fsf@kernel.org> Date: Wed, 06 May 2026 17:33:52 +0200 Message-ID: <2vxzjytgzh5r.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 Wed, May 06 2026, Pasha Tatashin wrote: > On 05-06 10:31, Pratyush Yadav wrote: >> Hi Pasha, >> >> On Wed, May 06 2026, Pasha Tatashin wrote: >> >> > A preserve_context kexec returns to the current kernel, which >> > is unrelated to live update where the state is passed to the next >> > kernel. Skip liveupdate_reboot() in this case to avoid serialization >> > and prevent sessions from being left in a frozen state upon return. >> >> Should we also stop KHO? Now it is stateless and always finalized. I am > > No. KHO preserves kernel internal memory; for context-preserved > kexec, the 2nd kernel and the 1st kernel do not have overlapping > memory. So, whatever the 1st kernel maintains in KHO is an internal > detail of the 1st kernel. Once we return from the 2nd kernel to the 1st > kernel, all KHO memory is going to stay as-is, and the 1st kernel can > even perform a regular kexec or live update later. My point is that we keep KHO data in the 1st kernel but do not pass it to the 2nd kernel via setup_data or the devicetree because it should not use that memory anyway. So essentially we add a check in kho_fill_kimage() and return early if preserve_context is set. I don't think it makes much difference in practice so no strong opinions. Fine either way. [...] -- Regards, Pratyush Yadav