From nobody Tue Jan 27 00:10:01 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 AE2022DB79D for ; Mon, 26 Jan 2026 16:08:15 +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=1769443697; cv=none; b=krYndwEyToWPgQt2aRrI34I90TmuIjUe5AhXmrcTdyKxGMrcY4Iet0Sd4V/klH8OMq2vusLP+1OOSclt4CdE/O8vvvMQfDtJjm03mA+2x7PNj6AEwMRPiutQ0YV5pMUDXCISJk2sENfjgbR4T2Tc7kxKHrvfNEd1CgdekJLi6Yc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769443697; c=relaxed/simple; bh=LPIeB1HXx7yrXcJ/f/iPyLV8CRN9XseGBN7nDn4O/z8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lPuaNZsKQtQPYwhyIg+FbgxXECGxHJluEIqIz95I31HC6y0iQpidMA46q8Q7XPECuP5CD7pGY8X+btIouHjaNosuWfRMmKycVin0z/BQnZxxhkv/7zC5jLD3eYPqbZegpKVNVWdKzNalE93yq6fiPrFzdNXUh8A/+SecY2XRXRo= 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=soYnZAFu; 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="soYnZAFu" 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=wD58s7Afm/VpqSfRj+q5T+RmL4WmAdEhDa4vBZoYFyo=; b=soYnZAFuPhU1DxNnsHIw5UePTQ a6FXz3eyOoC936m2ACmAu9h/bYT69r9a6FJkP5u/k8yIwyw4lDlocxXTrhrEOxQmn5IZZHzHTKgXd jJYDjTiSrC48CAIgY86GknFCOdTNCJr+jmto+pl/ijgnrxE3gMb2vLTDGDjb8+4BCegUjjcVqxlsE QapioKiqUz+On5qkl0WtwX6K80gtpXX9fDCQt0pkROmlusOjAyDfQBYX8b0K8eiVlkED2/NSsJjs+ fu/zDA8SfFrx3kMoT44WLucMzOsil77KxgDd7m2mmtKf7vYTG+vQQWIN+MCz7AFbinrs2zrO5akJG P6FvYxbw==; 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 1vkP8H-00GI7w-Im; Mon, 26 Jan 2026 16:08:05 +0000 From: Breno Leitao Date: Mon, 26 Jan 2026 08:07:26 -0800 Subject: [PATCH v5 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: <20260126-kho-v5-4-7cd0f69ab204@debian.org> References: <20260126-kho-v5-0-7cd0f69ab204@debian.org> In-Reply-To: <20260126-kho-v5-0-7cd0f69ab204@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-47773 X-Developer-Signature: v=1; a=openpgp-sha256; l=2407; i=leitao@debian.org; h=from:subject:message-id; bh=LPIeB1HXx7yrXcJ/f/iPyLV8CRN9XseGBN7nDn4O/z8=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBpd5FNsYxGYOfmgeChAKbgeCeJ4Qsp0Qy+6Zkp4 dy+wiT4aQKJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaXeRTQAKCRA1o5Of/Hh3 bT06EACm9JDRKk0yip7QtOwGH/xtGviLyn0x0lI5qHFZZWp/yqdNbU8HOP9iETSZuG/x1Tjn0+t 5wWTV05RZgrHkuZX3izl50nBeBf4TaWcMcYT+HojQG10w77/61U7/ZX/9skWqlbyfS68KrgAfGZ 6p7IfV/c99GbqvTo++uo3Q9aygJQ7lfkBdOMAFCC4oYMiP4CCGdWVsmNAzfH6K3RnYSL24QKHxc 0mmmkLaZnceiRq9U4spubZkyXtIP+s4Ul2zxOEXYBOQBcvCmGFCC6FPfYoi15Tzxe8sC/EIzZQX 4mYzZ9S4gT6QDj8L/FToall4nJr3eCua466cKVXuD2KAP/5Ns7RJTnbfMO2WH6LhdTmrlKEYK77 QX+WNSWjlXAzAsRh6XJ4IeRwUzhPDYtcLRblq97HB+Dw2R7O/tGM/QXcNiN66jXpYi2Ww14Pmnu yFRucwlpyVrkCsqOLuFoLa5EkMZONFYPUTYkWQLk7+VV7vQqS3A7/N2wIndlp4P9CLNSJK1yiCA CJ2ASYS8X84qZyg5UvZSO4ywk6UhmVdbMZrWheyFJ7ccGfggPxuocfWNsFPb2PRJDrCpnutsQ0O SoRrEEJkjnuY6dqwX8x1+Z5d3nf8RjSpga1r6jXGq0ApRL53Ho7IN6JHQ3Q8St4MqPN6CN3Vu8i qa1gXGhv4nZSXWA== 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 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