From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) (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 F252239FCDD for ; Mon, 11 May 2026 13:11:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778505107; cv=none; b=Dxd99TgVS8EAg1d28/5LGjXMqr0Zha1I1iZ04Juruwug4ogsKPLUenM0QvvjskuFqsWcgpmD3+lLO/5G2gEFzxnzRESB43/pCVV37+TYPoZbGRyo5V36hgHwBC47DRAiGKBcsAETJLBIcYZL4CEbFbJHIy5BEohFO/rxywtORLM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778505107; c=relaxed/simple; bh=YmN0xcwFtUYlOPK8UiX7BYi1ChbAXaBgnOed53MHve8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OpFIObb6UwwQW45MXc7ssZeVX2vSFLDB0u8q0O46AYpsoBCFtq7px7wN8nkbeO8sFD2MU9KUXQC9OgJYSE1tCrx+BMUq3vTWqHjqA+sGg9XXZnM2WdHNWeJcSTvkGJGrXcQmFMVdjwQ89CBquuvqa4ZGKBPDPBToMz35VO2os0M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=QjNj4GXg; arc=none smtp.client-ip=209.85.128.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="QjNj4GXg" Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-799001d73bdso28875147b3.0 for ; Mon, 11 May 2026 06:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1778505105; x=1779109905; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DwmcDFyZkGZV4b74fZllhwzC8fV4uJFXqCHKJqBwYe0=; b=QjNj4GXgPwhzpJT/tioPFHM22hVJ5OwrT4x870IaQL4oRfhCqPBo6Y/N99E09ZKsKi QmXmbvFiSETOHG57I/qUffC2nzwCyBRbEMsZUuL+MYtMqBGpOadScRYMU1SjOCF/uRB7 4DgOcmHEpCdihEVyTCRWbSzbbC19lsfn+OJZZlb6dcZIjIHk/9ZZPJq8ukd9nACRwtyI lZt2mZyNABrWXNa31J1Mx/yOTAEBJwunybKxy8kQCool1zm4R4xXaIXpBJj/oM++F3rE NZ8pD3jKxG9U0kCEO4ane50Gr4or77NP5IOgEXIvBQK/QnGirWQY9Z08gAbZo+WgE9Rv TheQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778505105; x=1779109905; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DwmcDFyZkGZV4b74fZllhwzC8fV4uJFXqCHKJqBwYe0=; b=fnXVtywR3sSxOxY/hjRr6kaq5Iog1tUGF5E2nCcGZzy9XlwOM4/2IGhJ21eya97rue DF9uXZVTeiw6+lti215VBRugiqPFiFuDC7ogm2y5FnTN46OqZ1thHEbnhpKq8mOTBeSh Kkwtx3BoP9zq8IhWKFQ3hpgX49TnVZFi2+oI+kRnFVbiwMZVD3WKthu/WG/2BDnjx77b mAqRHoz8/dZ9hR/tAfkYniWQVL5eNQ6xv6EVdSb/JPXIQYsFvyXOfXzEd1RBlrZd/VHe O4oBspaQ3yJSA9Gl+oiMoPVJ5ovIAVmj64u4xv8EOgtYVv/SsiyoD4qMH/GAYZTDUDpK sOag== X-Forwarded-Encrypted: i=1; AFNElJ8HAJrhCxJXTcInJODyjxSIgCcVvaf9K0Z4aDvzZe2F/HoNvkHLKUI8oXh5t34E92y57pMmAsp1jqyPJvg=@vger.kernel.org X-Gm-Message-State: AOJu0YxiRR3ykY+mIuDwcTsqEAetpKAaetwfhF3lmlvCVpYPj0WvMvJD Vezgv1f/MhNH9VoA9nkDBoeuOiN4eRgwRzbTYRTiQ9VHxtOzA/zUp5AdjcaMxLKeeLk= X-Gm-Gg: Acq92OH2PZDiCsAOZvjs92mhSGDYS21Y7rHdxws0g+mq2e2ueMhHGiyED5yx7pTkVr7 yGNh5I7gdI2pfmtc3g9Dc3407xaPwL4/k3vOinhAB4a4JMQ4U11qgJZE9+URWO9ORzpocCMp6WF kRM5xTRmRUVAq7ujN8OZ/+r2h6kaiCMnm347eOCNObwSM4GOav78LCu8bM8LzcY98srDoxgaG+4 HLpetIKC4xwk3wOHGLLuKcmO4XH56IM69VcwNSqKB/P4eSdBaf3p8BCNZkY2zkDTKLkNiPmdq2c d+eGXSWY89nF+EJ4GgwJmisq1A6eXZaOr+gr+P1dYBb/jU5vSHoeibdUjayyMZ26jbqIjSgJfLT k3yfKJfusbGqjhUu012kLYgVlYQQHNYOvg5pWyM8lDaEvjv2A2AjyKrmVsSu0EZWqk3kC6xcIZk NHuH/w9+Pvi+YrdEZJrHyRT2AkXxXAZj3NYxNoAfTrlWiZHAafew5o40tEfuvCyhDxqpRi+ZmSc PIV8W+vC1KElqTU5UP0V5tTgQAUpcngLP+VRFkBw+Y= X-Received: by 2002:a05:690c:dd3:b0:7ba:d5fb:b543 with SMTP id 00721157ae682-7bdf5dcc7b4mr239220107b3.13.1778505104887; Mon, 11 May 2026 06:11:44 -0700 (PDT) Received: from google.com (138.200.150.34.bc.googleusercontent.com. [34.150.200.138]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7bd6688c99bsm149750087b3.45.2026.05.11.06.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 06:11:44 -0700 (PDT) Date: Mon, 11 May 2026 09:11:43 -0400 From: Pasha Tatashin 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 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: On 05-11 13:38, 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 :) Awesome catch by Sashiko, I will drop this patch. Pasha > > > image->kho.fdt = virt_to_phys(kho_out.fdt); > > -- > > 2.54.0.545.g6539524ca2-goog > > > > -- > Sincerely yours, > Mike.