From nobody Tue Dec 2 01:07:40 2025 Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (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 B13BE2D060B for ; Sat, 22 Nov 2025 22:24:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763850246; cv=none; b=IV+xKgKtqTxSwTyMtZWazJ1NY/cynzQYvjTYWWa+PlD6vce8KtqninSyyhg/nZsHgt7sS3s92qgJzGMPtMoCF27SDL6bvjL+m4571PUGnVdFYpIzn+Li2BpoMSxNvodokrZ86828S6z5cDurX9Io+iE/8EOUGKgG1qNxNnqHScw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763850246; c=relaxed/simple; bh=yqW0eNnuY6iaIAb81qp9+q3ixuk1RWq84gZvp3pOj+Q=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cam8skFeYZlGB9oeEWBipENjfqbTj6ScoAcF6cHuDYBiXbIy1htEsfvuoPX8K8CsJZ0atHm2W2eiE0bEL1AYwmzaTpCH67Hp5zg3fozljiHEFBLnat3zZ9mav4arfPDnkotIHfs9b8gRHz4HjuytiVNzt8khfUWNq8nX1lqd8TM= 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=ahw62As7; arc=none smtp.client-ip=209.85.128.173 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="ahw62As7" Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-78a7af9fe4fso33199217b3.2 for ; Sat, 22 Nov 2025 14:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1763850242; x=1764455042; 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=I5KiW0twGUwiDqt6nePE1kGiL7dytg0Q0KVXgthRcks=; b=ahw62As7z5Pp8+KVpJHLR9K98pdIlj4hIScu5BSMiqHYogLBwdt0Z3cU0D8d6e4cQt KEdBqtYBy+hQMXiTLQf73825DkW9KUJlGFg5wrca2+TTLZI1Ur4KXZqPrj5A1aLjpM3v w3L1ODvFkjxH01tstd9dWyuBICRTf96ckT7HYnN7rCREQ5ruCucOR91nlwm7W0CGPePH yoQmUtOBjgdVuBMaCbFfF4thHh/bOOVJImlmIY2YqT0YGOqj2UzZ2AZpVIixd38MOMNp UVM5X1Dlvuxe3qHPkEuvpKUCjkPTOehJIUCBlwzitQsR1h2Q4l7ayDq+dCI99jJVKS0t +7Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763850242; x=1764455042; 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=I5KiW0twGUwiDqt6nePE1kGiL7dytg0Q0KVXgthRcks=; b=gBPFIxOYLQ78XdjFkCk85c2O3Oc0fm7cGe27xgA3wKKtysUC2JPGiGnL714XIioeUy XAPYimjwxGtDwGYgTgI5L2VyA2uKOy6pAgSXV9vt2Od88byqOf3RSDwna20+X49I7YNQ FFo6iqq6znrH2T4S9Hu7/mqyXz7JW2OeLjcq7Bc0wXH+2PJxCT42/d36plQxrEcm8tRH dWbPl2cthhvkEsGFaTYqA/0XB7BotI102cJQfWLlkhrPu6F3ZPSaSZHOlIGFV7yCV1c/ MyziRAQvd3etmFLP2bvDQw7c13oc8SP66D103dlFmLchrHe5yHHS6CKqyQarwRxMQZo/ CsoQ== X-Forwarded-Encrypted: i=1; AJvYcCWhH7ZDimC030eG5aGS3kl70U76q2vOV8QXY0FCbMsOxF8m5Lr4FG5TT5mFfO7SJ2hkHOzbvQgZcl2B5CQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyctNdWDec6G+6kMYFx+Y/GYDSHh9HkRHj0rcH7hxGwhPMmK6XE ppxsBPkLLjLgnh9mxd4gxRWPmCu2Afr+A2sJHyk7bQA3NhqYXMwdqMqS6W0iA5JV32k= X-Gm-Gg: ASbGncsxKHpzZGo6kp6yPLsTIKjHZhkgVNPoqt7tEGROgTGelkGEiSZJKm5C6uyfOAd Ao7IJ2gCYsi7OnF33ZTOJmF0ceRrh0+ZLR00nazmS7SPh2X7NsUNsT5TSmvjCWwiHGU+gv2BLPk oea//P5pC1pPdq59tihu6utaK6Tvjcl/mFwMM4XRJeB9SqFGOJlqlXG/x0Ze3XKB4YjIjYvwFxc wvT8k17V6wR6EIrecI7dT3vILFLZ6PEE7+or9zWLshdS2W9wef8Ms3whCS7zEw9VzHS1VlglStP 1Mg5oNiST/Sxj5/a2fcytDBHlNgI91ni9LuWD/jScbcAyAaatsw9QgFJ7eYvvpgZ1Zlmp5Hyou1 QASxCl5WRsesiZPcQx30dfCXTmxqWRJduKkD4rmzilBfvt9a3jTtoNUOVdS7mC+nG32aQnFG0vm E9rQZAzGxj1pz9UbSgffVO+xKRO/48w0ugkj2YHCOTtGmrtj5y/Y4V8wnW58mcgEI1SmJhCKNLq ZXre1A= X-Google-Smtp-Source: AGHT+IHuoY23QTvRNhRkhmDmGHRrDBpwbesFLAGgRZdemrA8LoJ/P/EIeiLQ/hTmePkctRQeLMtVhA== X-Received: by 2002:a05:690e:130d:b0:63f:abf6:1c9 with SMTP id 956f58d0204a3-64302a4b3fdmr5160190d50.25.1763850242430; Sat, 22 Nov 2025 14:24:02 -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-78a79779a4esm28858937b3.0.2025.11.22.14.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Nov 2025 14:24:02 -0800 (PST) From: Pasha Tatashin To: pratyush@kernel.org, jasonmiu@google.com, graf@amazon.com, pasha.tatashin@soleen.com, rppt@kernel.org, dmatlack@google.com, rientjes@google.com, corbet@lwn.net, rdunlap@infradead.org, ilpo.jarvinen@linux.intel.com, kanie@linux.alibaba.com, ojeda@kernel.org, aliceryhl@google.com, masahiroy@kernel.org, akpm@linux-foundation.org, tj@kernel.org, yoann.congal@smile.fr, mmaurer@google.com, roman.gushchin@linux.dev, chenridong@huawei.com, axboe@kernel.dk, mark.rutland@arm.com, jannh@google.com, vincent.guittot@linaro.org, hannes@cmpxchg.org, dan.j.williams@intel.com, david@redhat.com, joel.granados@kernel.org, rostedt@goodmis.org, anna.schumaker@oracle.com, song@kernel.org, linux@weissschuh.net, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, gregkh@linuxfoundation.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, rafael@kernel.org, dakr@kernel.org, bartosz.golaszewski@linaro.org, cw00.choi@samsung.com, myungjoo.ham@samsung.com, yesanishhere@gmail.com, Jonathan.Cameron@huawei.com, quic_zijuhu@quicinc.com, aleksander.lobakin@intel.com, ira.weiny@intel.com, andriy.shevchenko@linux.intel.com, leon@kernel.org, lukas@wunner.de, bhelgaas@google.com, wagi@kernel.org, djeffery@redhat.com, stuart.w.hayes@gmail.com, ptyadav@amazon.de, lennart@poettering.net, brauner@kernel.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, saeedm@nvidia.com, ajayachandra@nvidia.com, jgg@nvidia.com, parav@nvidia.com, leonro@nvidia.com, witu@nvidia.com, hughd@google.com, skhawaja@google.com, chrisl@kernel.org Subject: [PATCH v7 03/22] kexec: call liveupdate_reboot() before kexec Date: Sat, 22 Nov 2025 17:23:30 -0500 Message-ID: <20251122222351.1059049-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.52.0.rc2.455.g230fcf2819-goog In-Reply-To: <20251122222351.1059049-1-pasha.tatashin@soleen.com> References: <20251122222351.1059049-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" Modify the kernel_kexec() to call liveupdate_reboot(). This ensures that the Live Update Orchestrator is notified just before the kernel executes the kexec jump. The liveupdate_reboot() function triggers the final freeze event, allowing participating FDs perform last-minute check or state saving within the blackout window. If liveupdate_reboot() returns an error (indicating a failure during LUO finalization), the kexec operation is aborted to prevent proceeding with an inconsistent state. An error is returned to user. Signed-off-by: Pasha Tatashin Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Pratyush Yadav --- kernel/kexec_core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index a8890dd03a1d..3122235c225b 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -1145,6 +1146,10 @@ int kernel_kexec(void) goto Unlock; } =20 + error =3D liveupdate_reboot(); + if (error) + goto Unlock; + #ifdef CONFIG_KEXEC_JUMP if (kexec_image->preserve_context) { /* --=20 2.52.0.rc2.455.g230fcf2819-goog