From nobody Fri Apr 3 04:33:06 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 0BE50392C49 for ; Mon, 16 Mar 2026 11:56:35 +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=1773662197; cv=none; b=gSSYvNwW0346Q436KnMueFaKrfuuI93DrKi3S31XLvzASSWM46jS0XkzB8FYPOco9KlHDTdPSc4q9G/gcjBEs3yynY3trMKGkQCYttW6JFGsmc5vxGxznAHv4NB2Pp+Dp3i/5PV88VMZ1E12/bZ8oqID5Sa+7wkQbWLzNAaqcxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662197; c=relaxed/simple; bh=Hlw5chBPs/GGmVd2Vfxvsk1mq2UGfEKb5hoy1/gHS0w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hME/t58N237QassLD8bnZ9S+dguXsYOmUEzhQk5DGGErYjp/aunkei4qPxEoBh79SOiUeUcyqy85HlLlMw/vcvr259YSWMmsv9OcDziG13igpA4E/Im1b2iLV5ORbtnKYHAafF2ajOV1UKOAf1+nh5JxDVzrtDY3lRMTooY523c= 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=dDQO5U45; 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="dDQO5U45" 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=BIYteLscNbuJ8M2TNSr6zCYdcchlP9A8lbucS9J/eKM=; b=dDQO5U45OCJInWUfMljGpNPgtG RwOlhLLZ/NVovVcj0BZxiSxD3u++sO4Yk0hEPH9w78eUOSub5y59p3743N7mO61WsJNaiWMt1XLCm 51I0YretIcEO314uOiH1306FlRQxx25idisr0wDsQi4B3zLwmNNN6SvJWiw6joUTXDvsiUEr7ez83 pD0aCItoagki9+0ZHpllMTrHb2O6+F2JDvwac6dx/KNevobmOfoL+7O7yNqK43QltNEBdZpoJHviW HFNnxNjmFDLKtPkJBTwtkrlCcqN7P1aQVgCeN/vHnpLtgHOvy1gIPZgTkHDAAzeXte+fCih66Ukeq 40SgN6Vw==; 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 1w26Yh-002600-Pc; Mon, 16 Mar 2026 11:56:30 +0000 From: Breno Leitao Date: Mon, 16 Mar 2026 04:54:36 -0700 Subject: [PATCH v9 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: <20260316-kho-v9-6-ed6dcd951988@debian.org> References: <20260316-kho-v9-0-ed6dcd951988@debian.org> In-Reply-To: <20260316-kho-v9-0-ed6dcd951988@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, usama.arif@linux.dev, Breno Leitao , SeongJae Park , kernel-team@meta.com X-Mailer: b4 0.15-dev-363b9 X-Developer-Signature: v=1; a=openpgp-sha256; l=2537; i=leitao@debian.org; h=from:subject:message-id; bh=Hlw5chBPs/GGmVd2Vfxvsk1mq2UGfEKb5hoy1/gHS0w=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBpt+/R5Ez+Wu4VpdqaIcba4CabNLUTikRuvc4JA kTxLX2vZ2aJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCabfv0QAKCRA1o5Of/Hh3 bZAvD/9v6OGnwOodgkswz4dXFI57BWYERIzbFFV8eyQEWwpYnEMvn4ucpEsAjnFtM3axRJvRZUQ zgtWrLUsGbsh6s/uzr7aNyorRMRMZgHtV2uPH9CwOzzeSuPU9KA+b/wg8i3QvsxKGYL3Twxp4Ma YnpTsVVYeOOzWRRbB4c/FmljQfVDpxkAvi33oKRYKxNXLQGJIZ1ffcnocBeVekqBJVWfltzSbuQ j3T6H8Lyyr7Iim59ZGeCACPdS1u/8vAz/zhFTIBeJxx6UCsdlpP5zK41ydlaOSAXoAhYtEckezK uuq2wrS5CdfYOKvH0K8qrf1qz0hxOseu3CVyOOgr4F/on1fmXkIpzh6+Gnjk92u9/W3UBho53HW QyXG6m5ZyBm+GWLTt8JbKCSRgTNIqwbC1bG2G9k7/CmhKDvWYI3eFkWfB9lTCQJoG6krEE74cTp vrhH9++h8XWFvj2Dwv5/xf8m9AltqFtKYS75RbhghrDxk+67/lWWVi3WDjxRhsmTgc/YgUyKZgS jkvyiMIDMiN8ewfgrfc+2myP0z3x5fNixbklx5B43LKvRLj6ulHHoxfux8nnIVjdoJaMo1ojCnB thkFsdEdhNDenMvPgUz4OfGYQNQGTicZumN3qLD+HWWKBxqrchmwlR2ByMqljUd7JUmu+csnS4n UHR5TfwPVACncRg== 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) Reviewed-by: Pratyush Yadav 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 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.52.0