From nobody Thu Apr 9 12:04:50 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 EC9213C6A21 for ; Mon, 9 Mar 2026 13:42:42 +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=1773063764; cv=none; b=VNxwmiW1CHooEYnbZ3yY9SjaTcGkZxKpIaOLS3XGg47UAx8U295lKTO1fFeo/bnW0zufQU5kLVJ78JCyGEcJYFqvB3Wrar6v7o116q2Xh+lWx5yp6S546SvYEZhQZ7uDjl420C0g7xR3h3BZRdjq1WZ3kurhabzcO0x3JeUnD6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773063764; c=relaxed/simple; bh=GuS2S3Wn71jXKGx9RIpG1q7JVYnitQ1EXkky0LyglZk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WWuSmjuTBvQY9+k6f6WQI+3oiMoFy0cVXypW20AcvDdvB0ttW49UjcaWPl30RgQROm0Fvh+VHi8x4FE1mew2IXDA2Ou5oJHvvJ50BYOTAciKW8Z3pc/qO/wFoyQT6AEW+XxNBToBqlZCma/9yr8bE9eTdE97X6siFAocRF4qkBI= 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=QnXvFd2E; 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="QnXvFd2E" 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=O7Ml/vJyi0FRJgghGtQCc2586RzghnjwSv1hQiNW19c=; b=QnXvFd2Et5S90TK4Ts/A++2Ztl Cn/VR9gXgY/yUvfvqBzs6m7idnfnCuJpz9xk1huJY677VCStJcKu3lGhGjGPYntaChOsBlxa0KkK3 lq4feo/BjeHAMPAzBVwhmn6M4jCiBDGDZagI83LFOx90LaVIemMdN4DdP8zB+H0RDceNcJPzpjNcI Tebz/53FVEPqzrgkcNKeiKGnwt4krm7LfX5+X5WciPzDX0JEr+gwI8N3lad5FNMCTAdqboaikDpWn qKkK1CYSwBT5bOPFTETm8PmaVYQRcDqoVVKGd6flSNNmaa56En8XONgahWyMIJodab1IiJQ0+/Fp7 IGgthkzA==; 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 1vzasa-002G4H-Nw; Mon, 09 Mar 2026 13:42:41 +0000 From: Breno Leitao Date: Mon, 09 Mar 2026 06:41:49 -0700 Subject: [PATCH v8 6/6] 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: <20260309-kho-v8-6-c3abcf4ac750@debian.org> References: <20260309-kho-v8-0-c3abcf4ac750@debian.org> In-Reply-To: <20260309-kho-v8-0-c3abcf4ac750@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, Breno Leitao , SeongJae Park , kernel-team@meta.com X-Mailer: b4 0.15-dev-363b9 X-Developer-Signature: v=1; a=openpgp-sha256; l=2486; i=leitao@debian.org; h=from:subject:message-id; bh=GuS2S3Wn71jXKGx9RIpG1q7JVYnitQ1EXkky0LyglZk=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBprs4ze/rUp861RrV5t62pTbJLJtbdntrR9AyI8 qkmZylG1YeJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaa7OMwAKCRA1o5Of/Hh3 bZgPD/4v3Yod2PPxx34KIn9K3RWl7jTuWUrsFK1hW5GuknLIksUYSy1hNqVshjLJL0tJFoK3wbK Vtx8cP6mtyX6+bJqGT38vExtFo2tWIe/55xDb6xyYSFvL4b+tj3K3+A6nHr4S+5Pq94JzrFg99V NXoqxOcxj46lsy5L5BHNIABY5rDqSuHF84zlo/2CJ+7pMUrS25J5mMwyPpbbWBQuRZLk7JS190/ k6Uqk0QxlwagjSHgnnjKNxib/DwMW76TD67dadJv4hzW4JKA+zZvfKYG+wvfPs9dDdDb8ydbMHy sPol8dSYkjkF8rrvyXAFuzX3FMjQ8tmxTZInP/oXcwhfYGKDaUgYKb20OKL1CwkEUHZfOxlqIUx tlEPhKfp3oCZuYTt+HIQqeXLLNbIxRUdcAAag4DjWGdHgYnwbvrF35b1NZyDN7s0bCMAEb3mHQ/ OH8tyo88JiSVeNtJcd7fHF6i6L9B3jxJY953cHHLrHlYOpFJKe5QEO4kZ82UEiP7F5vjAOC82w3 Ce7XCPByc1m/rvbfXZnpIalWvsCeDzgO/XgUO/mNL7PVsHabR18OWb8DkeaBqsOg5xZ4Bz4v1dT /j6A+KxuQ8FbDrNLwb3mInMqwr2JH+L2rHio50MXWAPzeFhnPGkMnSSGknAarZQp+tpypF8BbJi 1Z9KvPbhp3tRUEw== 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 Reviewed-by: Pratyush Yadav --- 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 6a4ddf3440465..2c26e560bd78a 100644 --- a/Documentation/admin-guide/mm/kho.rst +++ b/Documentation/admin-guide/mm/kho.rst @@ -42,6 +42,45 @@ For example, if you used ``reserve_mem`` command line pa= rameter to create an early memory reservation, the new kernel will have that memory at the same physical address as the old kernel. =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