linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] kexec: history: track previous kernel version and kexec boot count
@ 2026-01-02 14:53 Breno Leitao
  2026-01-02 14:53 ` [PATCH v2 1/2] kexec: history: track previous kernel version Breno Leitao
  2026-01-02 14:53 ` [PATCH v2 2/2] kexec: history: track kexec boot counter Breno Leitao
  0 siblings, 2 replies; 11+ messages in thread
From: Breno Leitao @ 2026-01-02 14:53 UTC (permalink / raw)
  To: Alexander Graf, Mike Rapoport, Pasha Tatashin, Pratyush Yadav
  Cc: linux-kernel, kexec, linux-mm, usamaarif642, rmikey, clm, riel,
	Breno Leitao, kernel-team

Use Kexec Handover (KHO) to pass the previous kernel's version string
and the number of kexec reboots since the last cold boot to the next
kernel, and print it at boot time.

Example
=======
	[    0.000000] Linux version 6.19.0-rc3-upstream-00047-ge5d992347849
	...
        [    0.000000] KHO: This kernel was kexec'ed from kernel release: 6.19.0-rc3-upstream-00048-geda7d9110f99 (kexec count: 3)

Motivation
==========

Bugs that only reproduce when kexecing from specific kernel versions
are difficult to diagnose. These issues occur when a buggy kernel
kexecs into a new kernel, with the bug manifesting only in the second
kernel.

Recent examples include:

 * eb2266312507 ("x86/boot: Fix page table access in 5-level to 4-level
   paging transition")
 * 77d48d39e991 ("efistub/tpm: Use ACPI reclaim memory for event log to
   avoid corruption")
 * 64b45dd46e15 ("x86/efi: skip memattr table on kexec boot")

As kexec-based reboots become more common, these version-dependent bugs
are appearing more frequently. At scale, correlating crashes to the
previous kernel version is challenging, especially when issues only
occur in specific transition scenarios.

Some bugs manifest only after multiple consecutive kexec reboots.
Tracking the kexec count helps identify these cases (this metric is
already used by live update sub-system).

KHO provides a reliable mechanism to pass information between kernels.
By carrying the previous kernel's release string and kexec count
forward, we can print this context at boot time to aid debugging.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changes from v1 to RFC
- Track the number of kexecs since cold boot (Pasha)
- Change the printk() order compared to KHO
- Rewording of the commit summary
- Link to RFC: https://patch.msgid.link/20251230-kho-v1-1-4d795a24da9e@debian.org

---
Breno Leitao (2):
      kexec: history: track previous kernel version
      kexec: history: track kexec boot counter

 kernel/Kconfig.kexec               | 13 ++++++++++
 kernel/liveupdate/kexec_handover.c | 50 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
---
base-commit: 7620f9ccfabbdaf07620381264d8b8d91412542f
change-id: 20251230-kho-7707e8a2ef1e

Best regards,
--  
Breno Leitao <leitao@debian.org>



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-01-02 16:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-02 14:53 [PATCH v2 0/2] kexec: history: track previous kernel version and kexec boot count Breno Leitao
2026-01-02 14:53 ` [PATCH v2 1/2] kexec: history: track previous kernel version Breno Leitao
2026-01-02 15:02   ` Usama Arif
2026-01-02 15:14     ` Breno Leitao
2026-01-02 15:33       ` Usama Arif
2026-01-02 16:18   ` Pasha Tatashin
2026-01-02 14:53 ` [PATCH v2 2/2] kexec: history: track kexec boot counter Breno Leitao
2026-01-02 15:09   ` Usama Arif
2026-01-02 15:24     ` Breno Leitao
2026-01-02 15:31       ` Usama Arif
2026-01-02 16:20   ` Pasha Tatashin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox