From nobody Mon Feb 9 20:09:33 2026 Received: from mail-yx1-f41.google.com (mail-yx1-f41.google.com [74.125.224.41]) (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 0CC0432ED56 for ; Fri, 14 Nov 2025 15:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763135648; cv=none; b=GoNWJd+rMwzl41iOG2mvG6/56iMxp/6zbuymRbc6aozItAMNzZdE5WwCAW8bzSi1EbiTkaen8x725EBlrx9jVr193uBzcT8xKQXSSd6Neh6KuicGWDMWTKpgAdHouDpFvAshW+c4jV1+RE8I1iFVnszYCUZoNgynYxazkQvbCCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763135648; c=relaxed/simple; bh=bZyUs+PK+rvHnpZOxQKGl6TLnFzqA8gbt0HI7yQrRVw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EGe4wY6yIm6vi+Ni59s/5CV2Y/1MHkezHrvsrq66/hsn/dOm31X3lbq4neNSVzi+hGhdNdD95+yxuTr8bwzxz3ZyjEczGGap5G+f9h0sYfZP2IYct3p/G4jUKDiqJ8x2O+DveoSo5BSHHBEOZM2EvgMAyko9FF+O5hOtiGvRI8I= 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=gw/AAg17; arc=none smtp.client-ip=74.125.224.41 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="gw/AAg17" Received: by mail-yx1-f41.google.com with SMTP id 956f58d0204a3-640d0895d7cso2705362d50.1 for ; Fri, 14 Nov 2025 07:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1763135646; x=1763740446; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=BNA42wzRtY6tumJLzcBMrDKp0mvbCSdRF1f9tLE+ESU=; b=gw/AAg17z8gQ/94TQ71Q0MlyWUzglvLeOtmpeXHUVh9fo3bC3uAwOGVp7JE4RxXzav J0uaQ/dq1W2UddRfZSyNldPxvtgNOso2Hz4te8nmTN/sYLA9PSmQ+8WbFB6PWh/kqMqG WM77XEh5EWSal4jGt+6nX07KopZI6QvZULjtYs+bq5g1ievAXDiOS4GyOY4Z/I7k3gI+ GwxsDH13HvLrNwEPCmpJzyLLw2UwH2Qlv3dKEHtX40tLOZQ5Z1q0UfuLinpcBOrmJSHL WdclMFefNDeMCTNLBCIXTLXMoKCVCEzeo1APGPXTT/ILPi4Z9gYFNS2czxCnJAlbJWxS dpBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763135646; x=1763740446; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=BNA42wzRtY6tumJLzcBMrDKp0mvbCSdRF1f9tLE+ESU=; b=azIn5rbjL9gXlpbes7+qK3cx8kK0qwFmXAlRxVbCvfsThbK6NKtOQngfCskaDZpQC+ q4Agz87JWPTGGddTDcbmFl1vB+SSrR6gj1G4hWbglWSERg6L/05kLUeF1VynuAYueU6S aCi0W5XUB6ltj8rnN/YavMhS4f6V6hwyMMHcV0SBi8/ps2p9LtAdlfRiebekISZZi6OW d2uY/OkpGHdG2diMuxyn60g3WLKhUjWo8U8vqUlDPiAjUpdp8iPefOr2Sw1aJnwqgZYb Nh2nYbDGlfzZEt66tLF/EepOQI/Phrl9dSYPKqdnkt8hHbTcTWclKkh743CmsWHmeIYu 0hWw== X-Forwarded-Encrypted: i=1; AJvYcCUfkJ2WCfd6Zrxhmanv3uP2f4a1nvKa2ahp+3De/tEOfzqUPuxtKIcqAsRhE3mCc/+tgRFIsPMXhz7aUag=@vger.kernel.org X-Gm-Message-State: AOJu0YytZULZyyN7kaw46NtTVBF8YygnOssaekHcVjeNAMK2Wpvs3OEO jt8H0mAx+h20JthXmy5tCT8f/ZJtHRFmD9OAkDFnkEsfGA4zqTLJ9MEWBCscQ87phd4= X-Gm-Gg: ASbGnctSjrsPD/u+eXq0Y4SQEZhogwjOSFHllZjV0Of4zAVRaw5cwm+/C946qASjWUy C+AbYMLWGVnLYIv5Vcb/H78Dhz5sVEMee5fg/7VkzhAWOIwKT/4+AoY8WZ2UDvgq3Y/N4XMgG5l 92/p/iTjGPUxDYXGXYok4tXxA3iJjrYofr/QcNbOxdUykp03meeqrIbn0HbREnCSm5XJxLgTz2O 80s4WLhHb8nyeVIpFHrrxQb9gh0TPhxfQxyDGYkET4oX5kWS6xrTkOcT0ES3U0wWdGCpBDkOEAc co4mhtx77M276UA+/incy5V1YWretAEsBQw/8a9V2woOZ7S8wYL4Ua9uQddxh+I2AMLQijRoH+T mhYLGN2FVZqh5jHP8Dw2tikjK0CANTHtMgujL4j8wT/zQWm+lw8EjLnQTdgQjdoA/xiZhiTdFFR UfN8Ol/vcZfNicXA8fPyRfeuyNyGtkxM5C2XCRqPTX5KO8+G1d293NZarshTb16D9tQ8eU X-Google-Smtp-Source: AGHT+IFexeZ69gOmsixo4URTVxxOjfKW66ZjvkgEzVhORcXdny0LfmoMUzobq4DDg3SxMb7wc7hsuQ== X-Received: by 2002:a05:690e:4008:b0:640:d864:6e64 with SMTP id 956f58d0204a3-6410d0acb20mr6556525d50.14.1763135645970; Fri, 14 Nov 2025 07:54:05 -0800 (PST) Received: from soleen.c.googlers.com.com (182.221.85.34.bc.googleusercontent.com. [34.85.221.182]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78822125317sm16468577b3.37.2025.11.14.07.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 07:54:05 -0800 (PST) From: Pasha Tatashin To: akpm@linux-foundation.org, bhe@redhat.com, pasha.tatashin@soleen.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: [PATCH v1 03/13] kho: Preserve FDT folio only once during initialization Date: Fri, 14 Nov 2025 10:53:48 -0500 Message-ID: <20251114155358.2884014-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.52.0.rc1.455.g30608eb744-goog In-Reply-To: <20251114155358.2884014-1-pasha.tatashin@soleen.com> References: <20251114155358.2884014-1-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently, the FDT folio is preserved inside __kho_finalize(). If the user performs multiple finalize/abort cycles, kho_preserve_folio() is called repeatedly for the same FDT folio. Since the FDT folio is allocated once during kho_init(), it should be marked for preservation at the same time. Move the preservation call to kho_init() to align the preservation state with the object's lifecycle and simplify the finalize path. Signed-off-by: Pasha Tatashin Reviewed-by: Pratyush Yadav --- kernel/liveupdate/kexec_handover.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index bc7f046a1313..a4b33ca79246 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -1164,10 +1164,6 @@ static int __kho_finalize(void) if (err) goto abort; =20 - err =3D kho_preserve_folio(virt_to_folio(kho_out.fdt)); - if (err) - goto abort; - err =3D kho_mem_serialize(&kho_out); if (err) goto abort; @@ -1319,6 +1315,10 @@ static __init int kho_init(void) if (err) goto err_free_fdt; =20 + err =3D kho_preserve_folio(virt_to_folio(kho_out.fdt)); + if (err) + goto err_free_fdt; + if (fdt) { kho_in_debugfs_init(&kho_in.dbg, fdt); return 0; --=20 2.52.0.rc1.455.g30608eb744-goog