From nobody Mon Feb 9 17:35:46 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 139F635C1BC for ; Tue, 27 Jan 2026 14:38:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769524722; cv=none; b=QBmwW4ClY5Vj43x0PlLw9TjS0xbjiequb89SW4Tr4Fhb3wiwXHlNqjRrLAD/s5FgE0CAaE9OOO4pRSKEor15alVLtnkoxqifVqCuggcBIH3Hi18bWKoyQjS/Ke6OZpoTnWP1+Ntf9ZHc5hi0gaF8BRkpqXO0H3hnYjlhRUAnO+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769524722; c=relaxed/simple; bh=BibzqRu4Th29Z9ZLDMxo+dYOx89bJU5ET1VM3xltlKE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oLQo/h6sSP7UbUeDxlx+WJtUIvCLA8dkhwWCzRGV/ly52f1LqQ/02c7V3CQ4IP+v7/l1QrFxvx4MkrnBoWr0lOHjNnjHZMIA4+g23xF+qjbU9Qg5qO9VOp0YGqr8azdUB0VsGjBG9dM1BqFINDq+1gkE+10xQ4y0rQjEp6YeqrE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=none smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=Q1GNF3jd; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="Q1GNF3jd" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=mGV9QY0eKC+XLC5jci/d/FFQqBpectBL2Qr4Jd0liqE=; b=Q1GNF3jdZtMn3P4r5/R4swjm0H 3yUVhKTRKvrV3Kn3O6O6PrJZ9qQtu+MGveR9TBXf0QG/h7G4dfNYoNB0RTmvYrdehJ+TdBrfXiTQM opXZSQg5NymiQfotFJJXTlkF59l6CNxQoiM5Th3sNlsN36ssJi/h0zPw+Ty3AnQskbqOF6hha/A/U xt0ufAkOO4ewK5AGtMJkGqTXwejFC3MK43AXlxweD5Xg7SToiXnICmKYiojiWbLY6P2hbRGuUnwNS KM56g3mb5GJcjtdTCXmPTPuVNwY0f7xsd8d5zn94hZ20fwcDF40y6AvtWyNCtxF8OmB8vEtY56VWT F9BJlIqA==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1vkkDG-00H3bi-VI; Tue, 27 Jan 2026 14:38:39 +0000 From: Breno Leitao Date: Tue, 27 Jan 2026 06:37:39 -0800 Subject: [PATCH v6 4/4] kho: document kexec-metadata tracking feature 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-kho-v6-4-56f9396681c2@debian.org> References: <20260127-kho-v6-0-56f9396681c2@debian.org> In-Reply-To: <20260127-kho-v6-0-56f9396681c2@debian.org> To: Alexander Graf , Mike Rapoport , Pasha Tatashin , Pratyush Yadav Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org, usamaarif642@gmail.com, rmikey@meta.com, clm@fb.com, riel@surriel.com, Breno Leitao , SeongJae Park , kernel-team@meta.com X-Mailer: b4 0.15-dev-f4305 X-Developer-Signature: v=1; a=openpgp-sha256; l=2465; i=leitao@debian.org; h=from:subject:message-id; bh=BibzqRu4Th29Z9ZLDMxo+dYOx89bJU5ET1VM3xltlKE=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBpeM3XfBATMClwlLj2ScoQxI7DhQS7XCCiu3I5D FtWzWXHM32JAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaXjN1wAKCRA1o5Of/Hh3 bT7WD/41L7tomElTT+B/OFwWEDmD1wkVMFmcJDn4NThPerzTRJ16JJaxnLwDPKxdO9zeHGNw5d0 nN4ounqpCCm6im1A/MwlfK4BJHlPVp4yfZM/x1WKXGwwRELNyxBVx1rQCmzk76Jo30v0n7aqC/n 4374aKlmnLBDboqebEyzibBkMI3ORDPaQZyCz7IqZTc8wA35G5CqraUwN3GZjV99zsaFw/v18zt /3afIV7lpZD1KCUKxLsRgUQPUZV87oTOn/VmFI5BCfBt91jII4fRIaYeZf0ppOQKS7Hv7UkG+8+ halD0xRANRnrceVvs83HsA7SgrSMoM33X8xCo0DWbzJCuE9eXHAcd+7lXaCY4pJz+kuZ/RO8SIf 8wwjqyc64nteoaG8m4CYwL4mhRhWECW5VWer/xNKXZXwHTLUYR32eXDiYpetNvSLiG9B+eji/Uk CdtK/gTZK7aU7TXoJ79kI1uerPEyn7gSyK3ADnwBgaNK+ej5PmLec15uXw9mV1CHDaZB1IgQLc8 9Br6cicR2iiVlFYzDgpcVbVAyWEuVbOHuOSSvQsvgWj0p4Q6bmRc5KlFx5AwJKxaxL1B+JGGKUF Gh8ZblvWHSE/QeNGsxcvad8RwH4eZ86cTCjDM2HSvwNk36BWmSp/cZfgVeVoXbCkXh020Q35Hl9 xdCbfDI/GQcqWHA== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao Add documentation for the kexec-metadata feature that tracks the previous kernel version and kexec boot count across kexec reboots. This helps diagnose bugs that only reproduce when kexecing from specific kernel versions. Suggested-by: Mike Rapoport Reviewed-by: Mike Rapoport (Microsoft) Signed-off-by: Breno Leitao --- Documentation/admin-guide/mm/kho.rst | 39 ++++++++++++++++++++++++++++++++= ++++ 1 file changed, 39 insertions(+) diff --git a/Documentation/admin-guide/mm/kho.rst b/Documentation/admin-gui= de/mm/kho.rst index 6dc18ed4b8861..3771e764bb513 100644 --- a/Documentation/admin-guide/mm/kho.rst +++ b/Documentation/admin-guide/mm/kho.rst @@ -62,6 +62,45 @@ You can move the system out of KHO finalization phase ag= ain by calling :: After this command, the KHO FDT is no longer available in ``/sys/kernel/debug/kho/out/fdt``. =20 +Kexec Metadata +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +KHO automatically tracks metadata about the kexec chain, passing informati= on +about the previous kernel to the next kernel. This feature helps diagnose +bugs that only reproduce when kexecing from specific kernel versions. + +On each KHO kexec, the kernel logs the previous kernel's version and the +number of kexec reboots since the last cold boot:: + + [ 0.000000] KHO: exec from: 6.19.0-rc4-next-20260107 (count 1) + +The metadata includes: + +``previous_release`` + The kernel version string (from ``uname -r``) of the kernel that + initiated the kexec. + +``kexec_count`` + The number of kexec boots since the last cold boot. On cold boot, + this counter starts at 0 and increments with each kexec. This helps + identify issues that only manifest after multiple consecutive kexec + reboots. + +Use Cases +--------- + +This metadata is particularly useful for debugging kexec transition bugs, +where a buggy kernel kexecs into a new kernel and the bug manifests only +in the second kernel. Examples of such bugs include: + +- Memory corruption from the previous kernel affecting the new kernel +- Incorrect hardware state left by the previous kernel +- Firmware/ACPI state issues that only appear in kexec scenarios + +At scale, correlating crashes to the previous kernel version enables +faster root cause analysis when issues only occur in specific kernel +transition scenarios. + debugfs Interfaces =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.47.3