From nobody Tue Feb 10 10:18:44 2026 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (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 EF7942DF158 for ; Fri, 14 Nov 2025 19:00:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763146822; cv=none; b=WsvzVrzU4QSU77LmDjWLqzxh/NnnOAltAxaYWcAsR+DlYYEWo5i7wZyPZtB2rLL/KCaoQHM+pH0uA0d8melFvF9CK99J5Y5WWcyboEHz5Wg6J/moUgRnRQciVzVTmR7d3aXnXV3YPQSKgydHpTC73cEjvis2gbyhNxH7ylqFxHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763146822; c=relaxed/simple; bh=1HbAJDs1cE8PPm5NxBgENjTLqdxG0YIHQ9mrIeZo39c=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=etnrq8U1wZ743pTmixy7MyJ/AGnarQXYHbsiH8sOd7JQ4xF4j7jCCwESYMEIggIc7OzoheaAppGpk6Ug8tGfVqqm4geVr+lB5VceCJTNBytqyrSDKVSNFALmQcknlOU8QfnjAyj4epzHjaVmTpnad+afQpDGxt1zgRPLPqqMuis= 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=jAeo1+Vw; arc=none smtp.client-ip=209.85.128.179 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="jAeo1+Vw" Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-786d1658793so22745717b3.1 for ; Fri, 14 Nov 2025 11:00:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1763146819; x=1763751619; 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=osro0vvPDoUw7oalQJZ+pquNaUniT3EqRQtsUW/shDY=; b=jAeo1+VwWD2QnEATqm6a7eLGGtx/x4fMJp43tGPlAFiqmsbdml5xkuMUK7w4mDRe+8 V50B0Z9BbtmdLXiiUAn3AyHo4L5FzfPjwvd4FLYKUIkzKYrhOWQvR67K97JCQRI52gvY 1Dwcpq7jUl/iB+/6JaBceYILrsVV9rKOOvVhREdlKUk76XFQ3hqD2Gxa4pJk6lfaSVlz tKIAjhCky0vR7txBZu/QKUSZzoh5WEEkL5jkwqzgfekzlgh780NHFCcO5mzkeOycZdVh kVlTeDhihWuQMujWbNteMCgtBn93O9hdAjJ+1NqvTOHsb+QkvLtZEIWD5eKXFohGtY9w Z2kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763146819; x=1763751619; 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=osro0vvPDoUw7oalQJZ+pquNaUniT3EqRQtsUW/shDY=; b=JiUedv3wjYdIeDn8uuEgytqGPXQ36OC/QBFUlNSzRboQS832I2LCnIKY6f6SP7t4t6 HcuhYHg5+Q+avk1G/nYWDUObTQ5QU+XR4zuW/07FC6T1CHdsVWU9YgxGgLfotKAz0uWW dy6SFfnCZKuaCdnfvvIARWxc6INvJHidGD6RoT3hy793eMkDxrh2cXz4h9wkehA4IQ+H NmGjuQ5XNYrrbLokjgyyYFzivFPHht/KBpoG2QGV6tTisvhLJ5yRZE7fDkNSkVlGYgfH QiCjveAfkcdQk9weanpyTb+Qonfie1ZTgvDcDGHCVVB3OkS9ieqayCBa4QM/Ga1aLx4j 9DJA== X-Forwarded-Encrypted: i=1; AJvYcCWWuvbN+GWjJkurH/bfNHPUKXr+zP/i/PxDTlcsTimdPhZ6lZ7tU1mHd0Evq8oUUYH7YXyblnhcs63Ro4Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yyb+U6At88D9+76HidZCS0cm2UpRh5PbXLJh8F2pA+1osCKzEZM yvzdb+DcNO3BrGuFoI1Mz934DGBAg75J2ZTgaNtx6qEstCUePRHdNkzjUwUzuHik2h8= X-Gm-Gg: ASbGncuPTFIWjTA+4uuoXo3rEgzXcVlRUKRhum0gBn7ISZdIf4nzeDUr09fmdALKojW m0pI3YrBFaM58giMlvTEIL1Ea0hzt0/ysnabiOsLXJy9Yr94lBCVN0u9pgPgKwRxmtiO6beQTcz CW+nDg4Pl/A9oyuj6S+nm3T41XbXPu5eDKtl8LhgNj9FngmwME3pHiXepwYs+H2vuJc7a39QGwc F1Wz3Gk1MngzwzRBAHLM3ido/YOHlrMlVRT5KH4q9CtYL0cPwQAy4fMTAo3vZAbvq9ePJJQMPg6 RUSLUBQe7e8lo55Bp//nVsW52EJZaQzyUJW89YIjdgcIk5Hjf9fXYiRCqsy614bq4/uzIfA0SN0 qPwsDDInI8TEzA5YnvCZ+QkpBDiuahE5PE+8Gga9GPNBwGUMaNb+1yzqoX3i099JYGy4gXVuQob EVk9STOVg/xEi7Zl+St0gEi3BOx8R9DClNIyd1xJcCx0KPimhMt/8NMcZG8yPa3Hdhxy9iQppJJ L1SRRY= X-Google-Smtp-Source: AGHT+IGvr9tG1xjF2akJwFSXf2zHKR6TH3Z9kXWzZ9fYjencDngFKKzCA89Ng2VGtn4u+YBqr0oiew== X-Received: by 2002:a05:690c:a0aa:20b0:781:64f:2b18 with SMTP id 00721157ae682-78929f0ce7fmr58794497b3.58.1763146818865; Fri, 14 Nov 2025 11:00:18 -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 956f58d0204a3-6410e8f4f2esm2014058d50.0.2025.11.14.11.00.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 11:00:18 -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 v2 11/13] kho: Allow kexec load before KHO finalization Date: Fri, 14 Nov 2025 14:00:00 -0500 Message-ID: <20251114190002.3311679-12-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.52.0.rc1.455.g30608eb744-goog In-Reply-To: <20251114190002.3311679-1-pasha.tatashin@soleen.com> References: <20251114190002.3311679-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, kho_fill_kimage() checks kho_out.finalized and returns early if KHO is not yet finalized. This enforces a strict ordering where userspace must finalize KHO *before* loading the kexec image. This is restrictive, as standard workflows often involve loading the target kernel early in the lifecycle and finalizing the state (FDT) only immediately before the reboot. Since the KHO FDT resides at a physical address allocated during boot (kho_init), its location is stable. We can attach this stable address to the kimage regardless of whether the content has been finalized yet. Relax the check to only require kho_enable, allowing kexec_file_load to proceed at any time. Signed-off-by: Pasha Tatashin Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Pratyush Yadav --- kernel/liveupdate/kexec_handover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index 461d96084c12..4596e67de832 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -1550,7 +1550,7 @@ int kho_fill_kimage(struct kimage *image) int err =3D 0; struct kexec_buf scratch; =20 - if (!kho_out.finalized) + if (!kho_enable) return 0; =20 image->kho.fdt =3D virt_to_phys(kho_out.fdt); --=20 2.52.0.rc1.455.g30608eb744-goog